Skip to main content
POST
/
account
/
positions
cURL
curl --request POST \
  --url https://core-api-dev.vanish.trade/account/positions \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '{
  "timestamp": "<string>",
  "user_address": "<string>",
  "signature": "<string>"
}'
[
  {
    "token_address": "<string>",
    "sol_bought": "<string>",
    "usd_bought": 123,
    "tokens_bought": "<string>",
    "sol_sold": "<string>",
    "usd_sold": 123,
    "tokens_sold": "<string>",
    "tokens_remaining": "<string>",
    "token_decimals": 123,
    "created_at": "2023-11-07T05:31:56Z",
    "last_updated_at": "2023-11-07T05:31:56Z"
  }
]

Authorizations

x-api-key
string
header
required

Query Parameters

active
boolean

Optional flag to filter positions. Set to true to return only active positions (tokens with remaining balance > 0), or false to return only inactive positions (balance = 0). If omitted, all positions are returned.

Body

application/json

Request payload for querying positions.

timestamp
required

The current timestamp in milliseconds used for signature verification. Can be provided as a string or a number.

user_address
string
required

The Solana wallet address of the user.

signature
string
required

Signature of the 'read:{timestamp}' string signed using the user's wallet.

Response

A successful response containing the user's positions.

token_address
string
required

The token mint address associated with this position.

sol_bought
string<int64>
required

Total amount of SOL spent buying this token (in lamports).

usd_bought
number
required

Total USD value spent buying this token, based on SOL price at the time of transactions.

tokens_bought
string<int64>
required

Total number of tokens purchased (in smallest units).

sol_sold
string<int64>
required

Total amount of SOL received from selling this token (in lamports).

usd_sold
number
required

Total USD value received from selling this token, based on SOL price at the time of transactions.

tokens_sold
string<int64>
required

Total number of tokens sold (in smallest units).

tokens_remaining
string<uint64>
required

Current remaining token balance for this token (in smallest units).

token_decimals
integer
required

Number of decimal places used by the token (e.g., 9 for SOL).

created_at
string<date-time> | null

Timestamp of the first trade related to this token position (ISO 8601 format).

last_updated_at
string<date-time> | null

Timestamp of the latest trade related to this token position (ISO 8601 format).

I