Skip to content

Wallet position in a token

View as Markdown
GET
/v2/wallet/{chain_id}/{wallet}/position/{token}
curl --request GET \
--url https://api.chainmetric.io/v2/wallet/1/4d5f47fa6a74757f35c14fd3a6ef8e3c9bc514e8/position/c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2 \
--header 'Authorization: <Authorization>'

Returns one wallet’s position in one token: balance, its USD value, share of supply, buy and sell counts and volumes, and labels. Use it to answer “how much of this token does this wallet hold, and how has it traded it”. A value that cannot be computed is null.

chain_id
required
integer
Allowed values: 1 56 8453 1399811149

Chain id: 1 Ethereum, 56 BNB Chain, 8453 Base, 1399811149 Solana.

Example

1
wallet
required
string

The wallet. EVM is 40 lowercase hex characters without 0x; Solana is base58.

Example

4d5f47fa6a74757f35c14fd3a6ef8e3c9bc514e8
token
required
string

The token. Same format as wallet.

Example

c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2

The position.

Media typeapplication/json
object
kind
required

The document type, for example token_stats.

string
version
required

The document schema version.

integer
chain_id
required

The chain the document is about.

integer
address

The token or wallet the document is about.

string
subject

The stream topic of this document: <kind>.<chain_id>.<address>.

string
lane
required

fast data is published as soon as a block is seen. safe data is published again once the block is final and replaces it.

string
Allowed values: fast safe
commitment
required

How settled the data is: processed (Solana fast), confirmed (EVM fast) or finalized (safe).

string
Allowed values: processed confirmed finalized
as_of

The block height (or Solana slot) the document reflects.

integer format: int64
seq
required

Increases with every newer version of the document. Keep the highest.

integer format: int64
updated_us

When the document was built, Unix microseconds.

integer format: int64
data
required

The document body. Its shape depends on kind.

object
data
required
object
chain_id
integer
wallet
string
token
string
balance

Balance in the token’s smallest unit, as an integer string.

string
balance_usd

Balance value in USD.

number | null
price_flagged

True when the token’s price failed a cross-pool agreement check.

boolean
supply_pct

Percent of total supply held.

number | null
circulating_supply_pct

Percent of circulating supply held.

number | null
buys

Buy count.

integer
sells

Sell count.

integer
volume_buy_token

Tokens bought, in whole units.

number | null
volume_sell_token

Tokens sold, in whole units.

number | null
volume_buy_usd

USD spent on buys.

number | null
volume_sell_usd

USD received from sells.

number | null
native_balance

The wallet’s native-currency balance in its smallest unit.

string | null
first_trade_at_us

First trade time, Unix microseconds.

integer | null format: int64
last_activity_at_us

Latest activity time, Unix microseconds.

integer | null format: int64
labels

Wallet labels.

Array<string>
Allowed values: bundler dev cluster fresh_trader liquidity_pool
block

Block the position was read at. Solana answers carry slot.

integer format: int64
approximate
boolean

Example

{
"kind": "token_stats",
"lane": "fast",
"commitment": "processed",
"data": {
"labels": [
"bundler"
]
}
}

The request is malformed, for example a bad address, an unknown chain or an out-of-range parameter. Do not retry unchanged.

Media typeapplication/json

Every error answer has this shape. error and message carry the same text.

object
error
required

What went wrong. For 5xx answers this is the status text.

string
message
required

The same text as error.

string
statusCode
required

The HTTP status.

integer

Examples

ExampleunknownChain
{
"error": "blockchain: unknown chain: \"ethereum\"",
"message": "blockchain: unknown chain: \"ethereum\"",
"statusCode": 400
}

The key is missing (api key missing), unknown (api key unknown) or revoked (api key revoked). Send Authorization: <key>.

Media typeapplication/json

Every error answer has this shape. error and message carry the same text.

object
error
required

What went wrong. For 5xx answers this is the status text.

string
message
required

The same text as error.

string
statusCode
required

The HTTP status.

integer

Examples

Examplemissing
{
"error": "api key missing",
"message": "api key missing",
"statusCode": 401
}

The chain is not served, or the token or resource is not known.

Media typeapplication/json

Every error answer has this shape. error and message carry the same text.

object
error
required

What went wrong. For 5xx answers this is the status text.

string
message
required

The same text as error.

string
statusCode
required

The HTTP status.

integer

Example generated

{
"error": "example",
"message": "example",
"statusCode": 1
}

The key’s request rate limit is reached. No Retry-After is sent; back off and retry.

Media typeapplication/json

Every error answer has this shape. error and message carry the same text.

object
error
required

What went wrong. For 5xx answers this is the status text.

string
message
required

The same text as error.

string
statusCode
required

The HTTP status.

integer

Examples

Examplelimited
{
"error": "api key rate limit reached",
"message": "api key rate limit reached",
"statusCode": 429
}

The service is busy or catching up. Wait for the Retry-After header’s seconds when present (5 or 10), then retry. Without it, retry with exponential backoff.

Media typeapplication/json

Every error answer has this shape. error and message carry the same text.

object
error
required

What went wrong. For 5xx answers this is the status text.

string
message
required

The same text as error.

string
statusCode
required

The HTTP status.

integer

Examples

Exampleunavailable
{
"error": "Service Unavailable",
"message": "Service Unavailable",
"statusCode": 503
}
Retry-After
integer

Seconds to wait before retrying.

The read ran past its time limit. Retry later, or narrow the request.

Media typeapplication/json

Every error answer has this shape. error and message carry the same text.

object
error
required

What went wrong. For 5xx answers this is the status text.

string
message
required

The same text as error.

string
statusCode
required

The HTTP status.

integer

Example generated

{
"error": "example",
"message": "example",
"statusCode": 1
}