Skip to main content
The dex.trades model combines dex protocols indexed by Allium into a single table. This model includes core information pertaining to a swap, including token bought, sold, the account that initiated the swap (from_account) DEX Project coverage includes: kswap, kdlaunch.
This query shows recent trades from the KDSwap exchange:
select *
from kadena.dex.trades
where project = 'kdswap-exchange'
order by block_creation_time desc
limit 100
This query shows the top 10 trades by USD value over the last 7 days:
select *
from kadena.dex.trades
where block_creation_time >= current_date - 7
order by usd_amount desc nulls last
limit 10

Table Columns

_str columns are numeric fields cast to varchar to retain precision. Unique Key: unique_id
ColumnDescription
chainThe kadena chain name
chain_idThe unique identifier for the kadena chain
projectThe project (decentralized exchange) of the liquidity pool that the swap occurred from.
protocolDEX protocol (& version, if applicable) of the contract address facilitating the swap.
from_accountThe account that initiated the swap
to_accountThe recipient account of the swap
token_sold_addressToken address of the token sold.
token_sold_nameName of the token sold.
token_sold_symbolSymbol of the token sold.
token_sold_decimalsToken decimals of the token sold.
token_sold_amount_raw_strRaw amount of tokens sold (unnormalized) in string.
token_sold_amount_rawRaw amount of tokens sold (unnormalized).
token_sold_amountAmount of tokens sold in string.
usd_sold_amountAmount of token sold in USD value.
token_bought_addressToken address of the token bought, i.e. the asset acquired from the trade.
token_bought_nameName of the token bought.
token_bought_symbolSymbol of the token bought.
token_bought_decimalsToken decimals of the token bought.
token_bought_amount_raw_strRaw amount of tokens bought (unnormalized) in string.
token_bought_amount_rawRaw amount of tokens bought (unnormalized).
token_bought_amountAmount of tokens bought in string.
usd_bought_amountAmount of token bought in USD value.
usd_amountUSD value of the swap. This field preferentially selects the USD value of ETH and Stablecoin (USDT/USDC) tokens, as spam token prices may conflate the true swap value.
statusThe status of the transaction
transaction_request_keyUnique identifier for the transaction request
transaction_indexThe position of this transaction in the block that it belongs to. The first transaction has index 0.
event_indexThe index of the event within the transaction
block_creation_timeTimestamp of the block creation
block_heightBlock height of the swap event.
block_hashBlock hash of the swap event.
unique_idUnique ID of each trade.
_created_atThe timestamp when the record was created
_updated_atThe timestamp when the record was last updated
_changed_since_full_refreshIndicates if the record has changed since full refresh
I