INNER CODE UNIT · JavaScript
rows
pamgarcia1993/robinhood-lp-bot · legacy/bot.js:49
const rows = pools.map((p, i) => [{ text: `${i + 1}. fee ${(p.fee / 10000).toFixed(2)}% · WETH ${p.wethInPool.toFixed(3)}`, callback_data: `pool:${i}` }]);
await send(`Ketemu <b>${pools.length}</b> pool ${meta.symbol}/WETH. Pilih:`, { reply_markup: { inline_keyboard: rows } });
}
const GAS_RESERVE = 0.0004; // ETH native disisain buat gas (~4-5 tx; gas Robinhood ~0.0001/tx)
// Usable = WETH (udah wrap) + ETH native yang bisa di-wrap (dikurang cadangan gas)
function usableEth(b) {
return Number(b.weth) + Math.max(0, Number(b.eth) - GAS_RESERVE);
}
// Pilih pool → TANYA jumlah ETH (user ketik sendiri)
async function onPick(idx, mid) {
const st = pending.get(chatId);
if (!st) return;
const p = st.pools[idx];
st.chosen = p;
st.awaitingAmount = true;