Skip to main content
POST
/
api
/
v1
/
developer
/
wallet
/
pnl-by-token
Get Pnl By Token
curl --request POST \
  --url https://api.allium.so/api/v1/developer/wallet/pnl-by-token \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: <api-key>' \
  --data '[
  {
    "chain": "<string>",
    "address": "<string>",
    "token_address": "<string>"
  }
]'
{
  "items": [
    {
      "chain": "<string>",
      "address": "<string>",
      "token_address": "<string>",
      "current_tokens": "<string>",
      "current_balance": {
        "currency": "USD",
        "amount": "<string>"
      },
      "current_price": {
        "currency": "USD",
        "amount": "<string>"
      },
      "unrealized_pnl": {
        "currency": "USD",
        "amount": "<string>"
      },
      "realized_pnl": {
        "currency": "USD",
        "amount": "<string>"
      },
      "average_cost": {
        "currency": "USD",
        "amount": "<string>"
      },
      "unrealized_pnl_ratio_change": 123,
      "attributes": {
        "total_liquidity_usd": {
          "amount": 123,
          "details": "<string>"
        }
      }
    }
  ],
  "error": "<string>"
}
This endpoint provides current PnL metrics for specific wallet and token address combinations, including unrealized PnL, realized PnL, average cost, current balance, and current USD balance.
This is a beta endpoint currently under active development. We’re working to stabilize the API and will minimize breaking changes wherever possible, but they may still occur as we refine the interface.For production support or migration assistance, reach out at hello@allium.so.

Supported Chains

Authorizations

X-API-KEY
string
header
required

Body

application/json · PayloadAddressHoldingsByToken · object[]
chain
string
required
address
string
required
token_address
string
required

Response

Successful Response

items
Items · array
  • PnlByToken
  • PnlError
error
string | null
I