NEWDirect chain access. 50% cheaper than competitors.

GET /ticks

Get raw tick-level swap data

Understanding Blockchain Tick Data

If you are coming from a traditional Centralized Exchange (CEX) background, handling Decentralized Exchange (DEX) tick data requires a slight shift in mental model.

1. Block Timestamps vs. Exact Execution Time

In traditional finance, every trade has a precise millisecond or nanosecond timestamp representing the exact moment of matching.

In DeFi, trades are "confirmed" when a block is mined. All trades within the same block share the exact same timestamp.

  • CEX: T1: 12:00:00.001, T2: 12:00:00.005, T3: 12:00:00.012
  • DEX: Trade 1, Trade 2, and Trade 3 might all share 12:00:12 if they were included in the same block.

2. Ordering within Blocks

Since timestamps are identical for same-block trades, time alone is not enough to sort trades. We return trades sorted by blockNumber (implied by time) and logIndex.

3. Atomic Transactions & MEV

You may often see complex bundles of trades (MEV bots, arbitrage) executing atomically. The price you see is the execution price of that specific swap event within the pool, which might differ momentarily from the "market price" due to flash loans or sandwich attacks in the same block.

Parameters

symbolstring

Trading pair (e.g., "WETH-USDT"). Provide either symbol OR pool.

poolstring

Pool address. Provide either symbol OR pool.

fromstring

Start time (ISO 8601). Default: 1 hour ago.

tostring

End time (ISO 8601). Default: now (live data).

limitinteger

Max ticks to return (1-1000). Default: 100.

networksstring

Comma-separated networks (e.g. ethereum,arbitrum).

Response

dataarray

Array of swap ticks

Tick
idstring
Unique identifier (tx hash + log index)
timestampstring
ISO 8601 Block timestamp
pricenumber
Execution price (token1 per token0)
sidestring
"buy" or "sell"
amount0string
Amount of Token0
amount1string
Amount of Token1
amountUSDnumber
USD Value of the swap
token0string
Token0 Symbol
token1string
Token1 Symbol
credits_usedinteger

Credits consumed by this request.

curl "https://api.qoery.com/v0/ticks?pool=0x88e6...&limit=50" \
  -H "X-API-KEY: your_api_key_here"
const response = await fetch(
  'https://api.qoery.com/v0/ticks?pool=0x88e6...&limit=50',
  { headers: { 'X-API-KEY': 'your_api_key_here' } }
);
import requests

response = requests.get(
    'https://api.qoery.com/v0/ticks',
    headers={'X-API-KEY': 'your_api_key_here'},
    params={'pool': '0x88e6...', 'limit': 50}
)
{
  "data": [
    {
      "id": "0x123...-15",
      "timestamp": "2023-11-30T12:00:12Z",
      "price": 2050.50,
      "side": "buy",
      "amount0": "-1.5",
      "amount1": "3075.75",
      "amountUSD": 3075.75,
      "token0": "WETH",
      "token1": "USDT"
    }
  ],
  "credits_used": 2
}