INNER CODE UNIT · TypeScript

monitorMarketCap

bitman09/pumpfun-sniper-bot · src/index.ts:274

const monitorMarketCap = (bondingCurvePub: PublicKey): Promise<boolean> => {
    console.log("Monitoring MarketCap...")
    let totalTime = 0;
    return new Promise((resolve) => {
        const monitor = setInterval(async () => {
            const mc = await getMC(connection, bondingCurvePub);
            console.log("🚀 Current Market Cap Sol:", mc)
            if (mc >= MARKET_CAP) {
                clearInterval(monitor);
                resolve(true); // Resolve the promise when the market cap condition is met
            }
            totalTime += 500;
            if ((totalTime / 1000) >= TIME_OUT) {
                console.log("Time Out! Going to skip this token!")
                clearInterval(monitor);
                resolve(false);
            }
        }, 500);

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…