get https://api.syve.ai/v1/wallet-api/historical-dex-trades
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
Name | Type(s) | Description |
---|---|---|
wallet_address | string , required | The 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_address | string | If provided returns DEX trades of the given token only. |
size | integer | The size parameter controls how many records to return in the response. Default is 100. Maximum is 100,000. |
price_type | string | This 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. |
compact | boolean | If 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_timestamp | integer | Return 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_timestamp | integer | Return 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
Field | Type | Description |
---|---|---|
block_number | integer | The block number (i.e. height) of the event log. |
timestamp | integer | UNIX timestamp in seconds. The zero value corresponds to the 1st of January 1970 at UTC, called the Unix Epoch. |
transaction_hash | string | The transaction has of the transaction that the DEX trade happened in. |
trader_address | string | The wallet address that made the DEX trade. |
token_address | string | The unique address of the ERC20 token. |
token_symbol | string | The symbol of the token that was traded. |
token_name | string | The name of the token that was traded. |
pool_address | string | The address of the pool on which the trade happened. |
protocol_name | string | The name of the DEX protocol on which the trade happened. |
{price_type} | string | The 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}_usd | float | The 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} | integer | The total number of trades made of a token in the last 1h or 24h across all on-chain pools. |
side | string | Whether 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_token | double | The amount of the token that was traded. |
amount_eth | double | The value in ether that was traded. |
amount_usd | double | The value in dollars that was traded. |
gas_used | integer | The amount of gas used to process the transaction. |
gas_price_eth | double | The price of one unit of gas in ether. |
gas_price_usd | double | The price of one unit of gas in dollars. |
transaction_fee_eth | double | The amount in ether that was paid in gas fees to process the transaction. |
transaction_fee_usd | double | The calculated dollar amount that was paid in gas fees to process the transaction. |
price_eth_usd | double | The 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 Type | Description |
---|---|
price_token_usd_tick_1 | The 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.