API Reference

Retrieve all DEX trades made by a wallet.

Method: GET

Endpoint: https://api.syve.ai/v1/wallet-api/historical-dex-trades

📘

Use the Filter API for greater flexibility

You can use the Filter API in combination with the DEX Trades table to return wallet DEX trades as well. The Filter API offers greater flexibility in terms of the conditions you can filter DEX trades on.

Request Parameters

NameType(s)Description
wallet_addressstring, requiredThe wallet address(es) to return DEX trades for.
This is a required parameter.

Use a comma separated string to return DEX trades for multiple wallets.
token_addressstringIf provided returns DEX trades of the given token only.
sizeintegerThe size parameter controls how many records to return in the response. Default is 100. Maximum is 100,000.
price_typestringThis determines what price to return in the response.

If all it will return all prices. Default is price_token_usd_robust_total_1h.

All possible options for price_type are given below.
compactbooleanIf true returns less fields in the response. This can speed up response time when requesting many records. If false returns all fields. The default is true.
from_timestampintegerReturn results whose timestamp are greater than or equal to the provided value. The default value is 10 periods before until_timestamp, where the period depends on the interval chosen.
until_timestampintegerReturn results whose timestamp are less than or equal to the provided value. The default value is the current timestamp (at the time the request is made).

Response Fields

FieldTypeDescription
block_numberintegerThe block number (i.e. height) of the event log.
timestampintegerUNIX timestamp in seconds.

The zero value corresponds to the 1st of January 1970 at UTC, called the Unix Epoch.
transaction_hashstringThe transaction has of the transaction that the DEX trade happened in.
trader_addressstringThe wallet address that made the DEX trade.
token_addressstringThe unique address of the ERC20 token.
token_symbolstringThe symbol of the token that was traded.
token_namestringThe name of the token that was traded.
pool_addressstringThe address of the pool on which the trade happened.
protocol_namestringThe name of the DEX protocol on which the trade happened.
{price_type}stringThe price at which the token was traded.

The quoted price depends on the method used. Each price type uses a different method. The possible price types are listed in the table above.
volume_{1h|24h}_usdfloatThe total value (in dollars) of a token that was traded in the last 1h or 24h across all on-chain pools.
num_trades_{1h|24h}integerThe total number of trades made of a token in the last 1h or 24h across all on-chain pools.
sidestringWhether the token was bought or sold.

If the token with address token_address leaves the pool after a swap we consider that buy otherwise it's a sell.
amount_tokendoubleThe amount of the token that was traded.
amount_ethdoubleThe value in ether that was traded.
amount_usddoubleThe value in dollars that was traded.
gas_usedintegerThe amount of gas used to process the transaction.
gas_price_ethdoubleThe price of one unit of gas in ether.
gas_price_usddoubleThe price of one unit of gas in dollars.
transaction_fee_ethdoubleThe amount in ether that was paid in gas fees to process the transaction.
transaction_fee_usddoubleThe calculated dollar amount that was paid in gas fees to process the transaction.
price_eth_usddoubleThe price of Ethereum (in dollars) at the given timestamp of the trade.

📘

Possible price types

In the response you will find different prices. Each price corresponds to a different method of calculating the price of a token that was traded.

Price TypeDescription
price_token_usd_tick_1The price at which a token was traded based on the most recent swap.

Note: The price on a given swap can be a significant outlier; therefore it is not recommended for calculating OHLC.
price_token_usd_robust_total_{1h|24h}This provides the total price, in USD, based on both buy and sell trades executed in the last 1 or 24 hour(s).
price_token_usd_robust_buy_{1h|24h}This metric gives the total price, in USD, based solely on buy trades that have occurred in the last 1 or 24 hour(s).
price_token_usd_robust_sell_{1h|24}This shows the total price, in USD, accumulated from all sell trades in the last 1 or 24 hour(s).
price_token_usd_robust_mid_{1h|24h}The mid price is the average of the buy price and the sell price.

Live Example

Press Try It to make a request and see what the response looks like. Feel free to try different query parameters.

Language
Click Try It! to start a request and see the response here!