bro-n-bro / spacebox

MIT License
34 stars 4 forks source link

Add swap table #71

Open bro-n-bro-0 opened 1 month ago

bro-n-bro-0 commented 1 month ago

The table definition

CREATE TABLE spacebox.swap
(
    `timestamp` DateTime,
    `height` Int64,
    `batch_index` UInt32,
    `pool_id` UInt32,
    `swap_requester` String,
    `offer_coin_denom` String,
    `offer_coin_amount` Float64,
    `demand_coin_denom` String,
    `exchanged_demand_coin_amount` Float64,
    `transacted_coin_amount` Float64,
    `remaining_offer_coin_amount` Float64,
    `offer_coin_fee_amount` Float64,
    `order_expiry_height` Int64,
    `exchanged_coin_fee_amount` Float64,
    `order_price` Float64,
    `swap_price` Float64,
    `success` Bool
)
ENGINE = MergeTree
ORDER BY (
 timestamp,
 height,
 pool_id,
 swap_requester,
 offer_coin_denom,
 demand_coin_denom
)
SETTINGS index_granularity = 8192;

can be found in the end_block_events

iljagrabar14 commented 1 month ago

at raw_block_results

bro-n-bro-0 commented 1 month ago

inside end_block_events, the event type is swap_transacted

the rpc example is /block_results?height=13509655

iljagrabar14 commented 3 weeks ago

try switch warp dex api to this DB