API Reference

Retrieve a summary of the total trading performance of a wallet.

Method: GET

Endpoint: https://api.syve.ai/v1/wallet-api/batch-latest-total-performance

📘

Fetching 1,000 addresses in a single request

You have to use a POSTrequest. GET requests are limited to 25 addresses per request. Look at the example at the bottom of this page for how to construct a POST request.

Request Parameters

NameType(s)Description
wallet_addressstringThe wallet address or list of addresses for which to calculate performance.

If making a GET request use a comma separated list to provide the list of addresses. If POST use a list in the request body.

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

Response Fields

Response FieldTypeDescription
wallet_addressstringThe given wallet address for which trading performance was calculated.
total_tokens_tradedintegerThe number of unique tokens the wallet bought or sold using a DEX.
pnldoubleThe difference between realized_value and total_investment, which is the same as the difference between total_sell_volume and total_buy_volume.
total_profitdoubleThe sum of realized_profit and unrealized_profit.
total_valuedoubleThe sum of realized_value and unrealized_value.
total_investmentdoubleThe sum of realized_investment and unrealized_investment.
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.
realized_profitdoubleThe difference between realized_value and realized_investment.
realized_valuedoubleThe total dollar revenue generated by the wallet across all tokens.

For a given token, it is calculated by multiplying the quantity sold by the average selling price across all trades.
realized_investmentdoubleThe total dollar cost of purchasing the tokens that were sold.

For a given token, it is calculated by multiplying the quantity sold by the average buying price.
realized_returndoubleThe realized_profit relative to total_invesment expressed as a percentage.
unrealized_profitdoubleThe difference between unrealized_value and unrealized_investment.
unrealized_valuedoubleThe unrealized value is the dollar value of all tokens that were bought but are not sold yet.
unrealized_investmentdoubleThe total dollar cost of purchasing the tokens not sold yet.

For a given token, it is calculated by multiplying the quantity not sold yet by the average buying price.
unrealized_returndoubleThe unrealized_profit relative to the total_investment expressed as a percentage.
win_ratedoubleThe fraction of tokens for which the total profit is positive.
total_tradesintegerThe total number of DEX trades made by the wallet.
total_buysintegerThe total number of buy trades made by the wallet.
total_sellsintegerThe total number of sell trades made by the wallet.
first_trade_timestampintegerThe time of the earliest DEX trade made by the wallet (in UNIX seconds timestamp format).
last_trade_timestampintegerThe time of the most recent DEX trade made by the wallet (in UNIX seconds timestamp format).
total_buy_volumedoubleThe total dollar value of all DEX purchases made by a wallet.
total_sell_volumedoubleThe total dollar value of all DEX sales made by a wallet.
excluded.totalstringIf total_exclude is true, it contains the list of token addresses excluded from the calculation.

The remainder response field

The remainder field contains the list of wallet addresses for which performance was not calculated. The endpoint is designed subject to the following two constraints:

  • A maximum of 1,000 wallet addresses can be processed in a single request.
  • The total number of trades made by the list of wallet addresses must be less than or equal to 100,000.

If the any of the above constraints are broken the response will return a list of wallet addresses in the remainder field.

You can use the list of wallet addresses in the remainder to make a subsequent request to process the next batch of wallet addresses.

Example: Total performance for two wallets

📘

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/batch-latest-total-performance?wallet_address=0xa9abc362000d3c95f79d4c1e7d7d2545c22a3fee,0x6c325a587f4fc663b23d51668015f7b8ed9d3264

Example POST Request

curl --location --request POST 'https://api.syve.ai/v1/wallet-api/batch-latest-total-performance' \
--header 'Content-Type: application/json' \
--data '{
    "wallet_address": [
        "0xa9abc362000d3c95f79d4c1e7d7d2545c22a3fee",
        "0x6c325a587f4fc663b23d51668015f7b8ed9d3264"
    ]
}'

Response

{
    "data": {
        "0xa9abc362000d3c95f79d4c1e7d7d2545c22a3fee": {
            "wallet_address": "0xa9abc362000d3c95f79d4c1e7d7d2545c22a3fee",
            "total_tokens_traded": 1,
            "pnl": -36603.52165596647,
            "total_profit": -36603.52165596647,
            "total_value": 1503.1451927405913,
            "total_investment": 38106.666848707064,
            "total_return": -96.0554272597274,
            "realized_profit": -36603.52165596647,
            "realized_value": 1503.1451927405913,
            "realized_investment": 38106.666848707064,
            "realized_return": -96.0554272597274,
            "unrealized_profit": 0.0,
            "unrealized_value": 0.0,
            "unrealized_investment": 0.0,
            "unrealized_return": 0.0,
            "win_rate": 0.0,
            "total_trades": 21,
            "total_buys": 18,
            "total_sells": 3,
            "first_trade_timestamp": 1606375244,
            "last_trade_timestamp": 1609151641,
            "total_buy_volume": 38106.666848707064,
            "total_sell_volume": 1503.1451927405913
        },
        "0x6c325a587f4fc663b23d51668015f7b8ed9d3264": {
            "wallet_address": "0x6c325a587f4fc663b23d51668015f7b8ed9d3264",
            "total_tokens_traded": 96,
            "pnl": -288982.9376481087,
            "total_profit": -241204.3172669621,
            "total_value": 675348.2709539961,
            "total_investment": 916552.5882209579,
            "total_return": -26.31647331171071,
            "realized_profit": -174872.72976305848,
            "realized_value": 627569.6505728492,
            "realized_investment": 802442.3803359076,
            "realized_return": -19.079399481320436,
            "unrealized_profit": -66331.58750390362,
            "unrealized_value": 47778.62038114686,
            "unrealized_investment": 114110.20788505046,
            "unrealized_return": -7.237073830390268,
            "win_rate": 0.23958333333333334,
            "total_trades": 760,
            "total_buys": 490,
            "total_sells": 270,
            "first_trade_timestamp": 1613335612,
            "last_trade_timestamp": 1722535127,
            "total_buy_volume": 916552.5882209578,
            "total_sell_volume": 627569.6505728492
        }
    },
    "remainder": []
}

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!