LittlerDataGnear AI deposits and returns
    Updated 2025-03-05
    with create_capital as (

    select
    tx_hash
    ,block_timestamp
    ,action_data:args:entry_amount / 1e6 as usdc_position
    ,action_data:args:entry_token_id as token
    ,action_data:args:owner_id as trader
    ,action_data:method_name as method_name
    ,receipt_status_value:SuccessValue as allocation_id
    from near.core.ez_actions
    where 1=1
    and block_timestamp > '2025-01-20'
    and tx_receiver = 'defai.gnearai.near'
    and tx_signer = 'agent.defai.gnearai.near'
    and action_name = 'FunctionCall'
    and action_data:method_name = 'create_capital_allocation'
    --and tx_hash = '7tWfvAR5PkwoG85dZnV3FNt8PWArAbTfur9gipfY4D1y'
    ),

    exit_value as (
    select
    tx_hash
    ,block_timestamp
    ,action_data:args:capital_id as allocation_id
    ,action_data:args:exit_amount / 1e6 as usdc_return
    ,action_data:method_name as method_name
    from near.core.ez_actions
    where 1=1
    and block_timestamp > '2025-01-20'
    and tx_receiver = 'defai.gnearai.near'
    and tx_signer = 'agent.defai.gnearai.near'
    and action_data:method_name = 'set_capital_exit_value'
    --and tx_hash = 'A8HUsNSkU1dz8QVCkH3qUMEVuXi55G5uydaZ3wvvjGvu'
    ),