orderBy Enum
Each Cube generates an{Cube}OrderBy enum with ASC and DESC variants for every sortable dimension. The naming convention follows the dimension path joined by underscores:
Common orderBy Values
| Enum Value | Cube(s) | Description |
|---|---|---|
Block_Time_ASC | DEXTrades, Transfers, BalanceUpdates, DEXPools, TokenSupplyUpdates, Pairs, Tokens | Oldest first |
Block_Time_DESC | DEXTrades, Transfers, BalanceUpdates, DEXPools, TokenSupplyUpdates, Pairs, Tokens | Newest first |
Interval_Time_Start_ASC | Pairs, Tokens | Oldest first (interval start time) |
Interval_Time_Start_DESC | Pairs, Tokens | Newest first (interval start time) |
Trade_Buy_Amount_DESC | DEXTrades | Largest buy amount first |
Trade_Buy_PriceInUSD_DESC | DEXTrades | Highest USD price first |
Transfer_AmountInUSD_DESC | Transfers | Largest USD transfer first |
LatestBalanceUSD_DESC | TokenHolders | Largest holder first |
BuyVolumeUSDState_DESC | WalletTokenPnL | Highest buy volume first |
Usage
Pass a single enum value to theorderBy argument:
orderBy accepts a single enum value. Multi-column sorting is not supported — the query is sorted by one dimension at a time.limit Argument
Thelimit argument controls how many rows are returned and supports offset-based pagination:
Default and Maximum Limits
Each Cube has a default limit applied when you omit thelimit argument, and a maximum cap:
| Cube | Default count | Maximum count |
|---|---|---|
| DEXTrades | 25 | 10,000 |
| Transfers | 25 | 10,000 |
| BalanceUpdates | 25 | 10,000 |
| DEXPools | 25 | 10,000 |
| TokenSupplyUpdates | 25 | 10,000 |
| Pairs | 25 | 10,000 |
| Tokens | 25 | 10,000 |
| DEXPoolEvents | 25 | 10,000 |
| TokenHolders | 25 | 10,000 |
| WalletTokenPnL | 25 | 10,000 |
If you request a
count exceeding the maximum, the server silently caps it at the maximum value.Offset-Based Pagination
Useoffset to page through result sets. The pattern is straightforward:
- Page 1:
limit: { count: 50, offset: 0 } - Page 2:
limit: { count: 50, offset: 50 } - Page 3:
limit: { count: 50, offset: 100 }
Example: Paginated Token Holders
- Page 1
- Page 2
Pagination Tips
Always use orderBy with pagination
Always use orderBy with pagination
Without a stable sort order, rows may shift between pages. Always pair
limit with an orderBy that produces a deterministic order.Avoid deep offsets
Avoid deep offsets
Large
offset values (e.g., 50,000+) may degrade performance since the database must scan and skip rows. For very large datasets, narrow your query with where filters instead of paginating deeply.Use count to detect end of results
Use count to detect end of results
If a page returns fewer rows than the requested
count, you’ve reached the end of the dataset. Alternatively, use the count metric field to get total row count upfront.Practical Examples
Latest Large Trades
Fetch the 10 most recent DEX trades on Solana with a buy value over $10,000:OHLC Candles — Last 60 Minutes
Fetch 1-minute candles for a token, sorted chronologically:Top 50 Token Holders
Fetch the top 50 holders sorted by USD balance:Next Steps
Filtering
Combine ordering with filters to build precise analytical queries.
Metrics & Aggregation
Aggregate ordered data with count, sum, avg, min, max, uniq.

