lxv0umAptos-bot balance check daily
    Updated 1 day ago
    -- forked from Aptos-bot balance check @ https://flipsidecrypto.xyz/studio/queries/77b129af-1368-49c3-8d0a-83601290facf

    with bot_balance as (
    select to_char(block_timestamp, 'yyyy-MM-dd') as activity_date,
    MAX(change_data:"coin":"value" / 100000000) as balance,
    COUNT(block_timestamp) as arbitrage_done
    from aptos.core.fact_changes
    where change_type = 'write_resource'
    and change_address = '0x31deb490728ae8e1a89675ee4c1877af8e5849c526d2c9a64238c49d8ece08a0'
    and change_resource = 'CoinStore<0x1::aptos_coin::AptosCoin>'
    group by activity_date
    ), gas_balance as (
    select to_char(block_timestamp, 'yyyy-MM-dd') as activity_date,
    MIN(change_data:"coin":"value" / 100000000) as balance,
    COUNT(block_timestamp) as try_done
    from aptos.core.fact_changes
    where change_type = 'write_resource'
    and address = '0x31deb490728ae8e1a89675ee4c1877af8e5849c526d2c9a64238c49d8ece08a0'
    and change_address = '0x1'
    and change_resource = 'CoinStore<0x1::aptos_coin::AptosCoin>'
    group by activity_date
    )



    select bot.activity_date,
    arbitrage_done,
    try_done,
    arbitrage_done * 100 / try_done as percentage,
    bot.balance as bot_balance,
    gas.balance as gas_balance,
    bot.balance + gas.balance as total
    from bot_balance bot
    LEFT JOIN gas_balance gas ON bot.activity_date = gas.activity_date
    order by bot.activity_date desc


    Last run: 1 day ago
    ACTIVITY_DATE
    ARBITRAGE_DONE
    TRY_DONE
    PERCENTAGE
    BOT_BALANCE
    GAS_BALANCE
    TOTAL
    1
    2025-03-1312339331.2977119816.557520065.2486360919821.80615615
    2
    2025-03-12393174722.49570719815.724995755.3270478519821.0520436
    3
    2025-03-11942379824.80252819791.788611295.0983750719796.88698636
    4
    2025-03-101203449926.73927519773.05812535.0959933719778.15411867
    5
    2025-03-091130893812.64264919707.266334145.0885361519712.35487029
    6
    2025-03-08661440415.00908319621.151212825.0999009319626.25111375
    7
    2025-03-072462271619.06446719612.901482344.9437196119617.84520195
    8
    2025-03-061040150236.92271819581.850138755.0891960919586.93933484
    9
    2025-03-0514601129412.92721819551.147527295.0921367519556.23966404
    10
    2025-03-041104595618.5359319405.713016015.0956006719410.80861668
    11
    2025-03-03657370017.75675719363.553714845.0996612919368.65337613
    12
    2025-03-02600525311.42204519336.689692135.0443364919341.73402862
    13
    2025-03-01229124318.4231719309.570442425.0986473119314.66908973
    14
    2025-02-281275592121.53352519304.006306075.1752768519309.18158292
    15
    2025-02-271098458623.94243317848.701428346.3368508117855.03827915
    16
    2025-02-26812311326.08416317506.762274167.5054025917514.26767675
    17
    2025-02-25841485817.31165117484.606617938.3467322517492.95335018
    18
    2025-02-24514286817.92189717450.060648329.4116657317459.47231405
    19
    2025-02-23393112634.90230917434.9141809610.0592555717444.97343653
    20
    2025-02-2220764931.89522317425.8009245810.2573450317436.05826961
    ...
    438
    31KB
    430s