API Reference

The trading performance of a wallet broken down by each token they traded.

Method: GET

Endpoint: https://api.syve.ai/v1/wallet-api/latest-performance-per-token

📘

Methodology

For a detailed explanation of how profit and loss is calculated read our blog here.

📘

Dashboard

See the API in action by trying our wallet performance dashboard here.

Request Parameters

NameType(s)Description
wallet_addressstringThe wallet address for which to calculate performance.

This is a required parameter.
chainstringUse eth for Ethereum, and base for Base.

Default: eth
total_excludebooleanIf truewill exclude stable coins from the total profit calculation.

Default: false
max_size_okbooleanIf true the most recent 10,000 trades are processed. If false and the wallet has more than 10,000 trades, and error message is returned.

Default: false

Response Fields

Response FieldTypeDescription
data.token_addressstring.The address of the token traded.
data.token_symbolstringThe symbol of the token traded.
data.token_namestringThe name of the token traded.
data.pnldoubleThe difference between realized_value and total_investment, which is the same as the difference between total_sell_volume and total_buy_volume.
data.total_profitdoubleThe sum of realized_profit and unrealized_profit.
data.total_valuedoubleThe sum of realized_value and unrealized_value.
data.total_investmentdoubleThe sum of realized_investment and unrealized_investment.
data.total_returndoubleThe total_profit relative to total_investment expressed as a percentage.

It is the same as the sum of realized_return and unrealized_return.
data.realized_profitdoubleThe difference between realized_value and realized_investment.
data.realized_valuedoubleThe total dollar revenue generated by the wallet from the total_sell_amount sold of the token.

It is calculated by multiplying the total_sell_amountby the avg_sell_price of the token.
data.realized_investmentdoubleThe total dollar cost of purchasing the tokens that were sold.

It is calculated by multiplying the total_sell_amount by the avg_buy_price of the token.
data.realized_returndoubleThe realized_profit relative to total_invesment expressed as a percentage.
data.unrealized_profitdoubleThe difference between unrealized_value and unrealized_investment.
data.unrealized_valuedoubleThe unrealized value is the dollar value of the quantity of the token bought but not sold yet.
data.unrealized_investmentdoubleThe total dollar cost of purchasing the tokens not sold yet.

It is calculated by multiplying the quantity not sold yet by the avg_buy_price of the token.
data.unrealized_returndoubleThe unrealized_profit relative to the total_investment expressed as a percentage.
data.win_ratedoubleThe fraction of tokens for which the total profit is positive.
data.total_tradesintegerThe total number of DEX trades for the token made by the wallet.
data.total_buysintegerThe total amount of buy trades for the token made by the wallet.
data.total_sellsintegerThe total number of sell trades for the token made by the wallet.
data.first_trade_timestampintegerThe earliest DEX trade of the token made by the wallet (in UNIX seconds timestamp format).
data.last_trade_timestampintegerThe most recent DEX trade of the token made by the wallet (in UNIX seconds timestamp format).
data.avg_buy_pricedoubleThe average purchase price of a token, calculated by dividing the total dollar amount spent on the token by the number of tokens acquired.
data.avg_sell_pricedoubleThe average selling price of a token, calculated by dividing the total dollar revenue from selling the token by the number of tokens sold.
data.current_pricedoubleThe current dollar market price of the token.
data.total_buy_amountdoubleThe total quantity of the token purchased.
data.total_sell_amountdoubleThe total quantity of the token sold.
data.trading_balancedoubleThe quantity of the token bought but not sold yet. It is the difference between total_buy_amount and total_sell_amount.
data.total_buy_volumedoubleThe total dollar value of all DEX purchases of the token by the wallet.
data.total_sell_volumedoubleThe total dollar value of all DEX sales of the token by the wallet.
excluded.totalstringIf total_exclude is true, it contains the list of token addresses excluded from the calculation.

Example

📘

Try it out

In the Live Example section you can try out the request with different arguments.

Query

Example GET Request

Request: https://api.syve.ai/v1/wallet-api/latest-performance-per-token?wallet_address=0x4a7c6899cdcb379e284fbfd045462e751da4c7ce

Response

{
    "data": [
        {
            "token_address": "0xabea7663c472648d674bd3403d94c858dfeef728",
            "token_symbol": "PUDGY",
            "token_name": "Pudgy Penguins",
            "pnl": -13844.339617842956,
            "total_profit": 89106.80660562252,
            "total_value": 102951.14622346548,
            "total_investment": 13844.339617842956,
            "total_return": 643.6334925703446,
            "realized_profit": 0,
            "realized_value": 0,
            "realized_investment": 0,
            "realized_return": 0.0,
            "unrealized_profit": 89106.80660562252,
            "unrealized_value": 102951.14622346548,
            "unrealized_investment": 13844.339617842956,
            "unrealized_return": 643.6334925703446,
            "total_trades": 3,
            "total_buys": 3,
            "total_sells": 0,
            "first_trade_timestamp": 1628397607,
            "last_trade_timestamp": 1682180891,
            "avg_buy_price": 4409.0253560009405,
            "avg_sell_price": null,
            "current_price": 32786.98924314186,
            "total_buy_amount": 3.1400000000000006,
            "total_sell_amount": 0,
            "trading_balance": 3.1400000000000006,
            "total_buy_volume": 13844.339617842956,
            "total_sell_volume": 0
        },
        ...
        {
            "token_address": "0xb6ca7399b4f9ca56fc27cbff44f4d2e4eef1fc81",
            "token_symbol": "MUSE",
            "token_name": "Muse",
            "pnl": -64755.11484450988,
            "total_profit": -29151.492872389135,
            "total_value": 35603.621972120745,
            "total_investment": 64755.11484450988,
            "total_return": -45.01805446934618,
            "realized_profit": 0,
            "realized_value": 0,
            "realized_investment": 0,
            "realized_return": 0.0,
            "unrealized_profit": -29151.492872389135,
            "unrealized_value": 35603.621972120745,
            "unrealized_investment": 64755.11484450988,
            "unrealized_return": -45.01805446934618,
            "total_trades": 3,
            "total_buys": 3,
            "total_sells": 0,
            "first_trade_timestamp": 1621414673,
            "last_trade_timestamp": 1621439002,
            "avg_buy_price": 17.452588601819574,
            "avg_sell_price": null,
            "current_price": 9.595772758741536,
            "total_buy_amount": 3710.3444263711476,
            "total_sell_amount": 0,
            "trading_balance": 3710.3444263711476,
            "total_buy_volume": 64755.11484450988,
            "total_sell_volume": 0
        }
    ],
    "excluded": {
        "total": [
            "0x6b175474e89094c44da98b954eedeac495271d0f",
            "0xdac17f958d2ee523a2206206994597c13d831ec7",
            "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"
        ],
        "unrealized": []
    }
}

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!