Skip to main content

index/interfaces/GetTradesOptions.md

Options for querying trades via GET /v1/trades

At least one of tokenName or userAddress must be provided.

Example​

// Query by token
const result = await sdk.getTrades({ tokenName: 'anime' });

// Query by user
const result = await sdk.getTrades({ userAddress: 'eth|123...' });

// Query by both with filters
const result = await sdk.getTrades({
tokenName: 'anime',
userAddress: 'eth|123...',
txnType: 'BUY',
startDate: '2024-01-01',
endDate: '2024-12-31',
minAmount: 100,
maxAmount: 10000
});

Since​

6.11.0 - Now extends BasePaginationOptions for DRY compliance

Extends​

Properties​

PropertyTypeDescriptionInherited from
cursor?stringCursor token for fetching the next page (omit for first page) - for cursor-based paginationBasePaginationOptions.cursor
endDate?stringFilter by date range end (ISO 8601 date string) Example: "2024-12-31" or "2024-12-31T23:59:59Z"-
maxAmount?numberFilter by maximum trade amount (applies to inputAmount for BUY, outputAmount for SELL)-
minAmount?numberFilter by minimum trade amount (applies to inputAmount for BUY, outputAmount for SELL)-
pageSize?numberPage size for cursor-based pagination (defaults to 50, max 1000)BasePaginationOptions.pageSize
search?stringFuzzy search by token name (LIKE %search%). Ignored when tokenName is provided (exact match takes precedence). Must be alphanumeric, max 256 characters.-
startDate?stringFilter by date range start (ISO 8601 date string) Example: "2024-01-01" or "2024-01-01T00:00:00Z"-
tokenName?stringFilter by token name (e.g., "anime")-
txnType?"BUY" | "SELL"Filter by transaction type (BUY or SELL)-
userAddress?stringFilter by user wallet address (eth|... or 0x... format)-