Trades

The avalanche.dex.trades contains successful swaps made on major decentralized exchanges (DEXs), consolidated into a single table.

Project Coverage:

ProtocolProject

kyberswap_elastic

kyberswap

trader_joe_v2

trader_joe

trader_joe_v2_1

trader_joe

uniswap_v2

zeroswap, canary, pangolin, trader_joe, olive, alligator, sushiswap, partyswap, baguette, thorus, hurricaneswap, pandaswap, lydiafinance, swapsicle, onavax, vavalon, hakuswap, radioshackswap, elkfinance, yetiswap, pyreswap, complusswap, vapordex

uniswap_v3

vapordex, pharaoh, sushiswap, pangolin, uniswap

Sample Query

Finding the swap volume of indexed projects on Avax in the last 7 days.

select 
  date(block_timestamp) as date,
  project, 
  sum(usd_amount) as usd_volume 
from avalanche.dex.trades
  where current_date - date(block_timestamp) < 7
  group by date, project
  order by date desc 

Table Columns

_str columns are numeric fields casted as varchar to retain precision when summing.

Column NameDescriptionExample

project

The project (decentralized exchange) of the liquidity pool that the swap occurred from.

trader_joe

protocol

Version of the protocol.

uniswap_v2

liquidity_pool_address

Contract address of the liquidity pool holding the asset. For protocol without the concept of LP such as airswap, this will be null.

0xed8cbd9f0ce3c6986b22002f03c6475ceb7a6256

sender_address

The address of the sender emitted on the swap event logs. This can be a router or pool address, which is different from the transaction initiator transaction_from_address that initiated the swap.

0x60ae616a2155ee3d9a68541ba4544862310933d4

to_address

Address of the recipient emitted on the swap event logs. For example, we use the to_address from the uniswap v2 swap event log and the recipient_address from the uniswap v3 swap event log.

0x140cac5f0e05cbec857e65353839fddd0d8482c1

token_sold_address

Token address of the token sold.

0xc7198437980c041c805a1edcba50c1ce5db95118

token_sold_name

Name of the token sold.

Tether USD

token_sold_symbol

Symbol of the token sold.

USDT.e

token_sold_amount_raw

Raw amount of tokens sold (unnormalized).

550000000.0

token_sold_amount_raw_str

Raw amount of tokens sold (unnormalized) in string.

550000000

token_sold_amount

Amount of tokens sold.

550.0

token_sold_amount_str

Amount of tokens sold in string.

550

usd_sold_amount

Amount of token sold in USD value.

nan

token_bought_address

Token address of the token bought, i.e. the asset acquired from the trade.

0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7

token_bought_name

Name of the token bought.

Wrapped AVAX

token_bought_symbol

Symbol of the token bought.

WAVAX

token_bought_amount_raw

Raw amount of tokens bought (unnormalized).

5.293783314951018e+18

token_bought_amount_raw_str

Raw amount of tokens bought (unnormalized) in string.

5293783314951018978

token_bought_amount

Amount of tokens bought.

5.293783314951019

token_bought_amount_str

Amount of tokens bought in string.

5.293783314951018978

usd_bought_amount

Amount of token bought in USD value.

558.4941397273325

usd_amount

USD 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.

558.4941397273325

transaction_from_address

Transaction sender address. I.e. the address of the transaction initiator. (from_address in the raw.transactions field for the transaction_hash of this swap).

0xf808141d4dbe6739d2d0a71d07150241bd6e2510

transaction_to_address

Transaction receiver. (to_address in the raw.transactions field for the transaction_hash of this swap).

0x60ae616a2155ee3d9a68541ba4544862310933d4

transaction_hash

Transaction hash that this swap belongs to.

0x3405860af1bf8e59503c456c1934ae8217f811887da27b4588b6108f69989a9b

transaction_index

The position of this transaction in the block that it belongs to. The first transaction has index 0.

5

log_index

The position of the swap event log in the transaction.

26

block_timestamp

Block timestamp of the swap event.

2021-12-16 17:40:58+00:00

block_number

Block number of the swap event.

8322808

block_hash

Block hash of the swap event.

0xb441b2b974330486ec4c3e24bae3f3a10ff7c3f0eb4115b0b4ab03b5a68d1832

unique_id

Unique ID of the swap.

txn-0x3405860af1bf8e59503c456c1934ae8217f811887da27b4588b6108f69989a9b_log_index-26

Last updated