Wallet position in a token
const url = 'https://api.chainmetric.io/v2/wallet/1/4d5f47fa6a74757f35c14fd3a6ef8e3c9bc514e8/position/c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2';const options = {method: 'GET', headers: {Authorization: '<Authorization>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Chain id: 1 Ethereum, 56 BNB Chain, 8453 Base, 1399811149 Solana.
Example
1The wallet. EVM is 40 lowercase hex characters without 0x; Solana is base58.
Example
4d5f47fa6a74757f35c14fd3a6ef8e3c9bc514e8The token. Same format as wallet.
Example
c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2Responses
Section titled “Responses”The position.
object
The document type, for example token_stats.
The document schema version.
The chain the document is about.
The token or wallet the document is about.
The stream topic of this document: <kind>.<chain_id>.<address>.
fast data is published as soon as a block is seen. safe data is published again once the block is final and replaces it.
How settled the data is: processed (Solana fast), confirmed (EVM fast) or finalized (safe).
The block height (or Solana slot) the document reflects.
Increases with every newer version of the document. Keep the highest.
When the document was built, Unix microseconds.
The document body. Its shape depends on kind.
object
object
Balance in the token’s smallest unit, as an integer string.
Balance value in USD.
True when the token’s price failed a cross-pool agreement check.
Percent of total supply held.
Percent of circulating supply held.
Buy count.
Sell count.
Tokens bought, in whole units.
Tokens sold, in whole units.
USD spent on buys.
USD received from sells.
The wallet’s native-currency balance in its smallest unit.
First trade time, Unix microseconds.
Latest activity time, Unix microseconds.
Wallet labels.
Block the position was read at. Solana answers carry slot.
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.
Every error answer has this shape. error and message carry the same text.
object
What went wrong. For 5xx answers this is the status text.
The same text as error.
The HTTP status.
Examples
{ "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>.
Every error answer has this shape. error and message carry the same text.
object
What went wrong. For 5xx answers this is the status text.
The same text as error.
The HTTP status.
Examples
{ "error": "api key missing", "message": "api key missing", "statusCode": 401}The chain is not served, or the token or resource is not known.
Every error answer has this shape. error and message carry the same text.
object
What went wrong. For 5xx answers this is the status text.
The same text as error.
The HTTP status.
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.
Every error answer has this shape. error and message carry the same text.
object
What went wrong. For 5xx answers this is the status text.
The same text as error.
The HTTP status.
Examples
{ "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.
Every error answer has this shape. error and message carry the same text.
object
What went wrong. For 5xx answers this is the status text.
The same text as error.
The HTTP status.
Examples
{ "error": "Service Unavailable", "message": "Service Unavailable", "statusCode": 503}Headers
Section titled “Headers”Seconds to wait before retrying.
The read ran past its time limit. Retry later, or narrow the request.
Every error answer has this shape. error and message carry the same text.
object
What went wrong. For 5xx answers this is the status text.
The same text as error.
The HTTP status.
Example generated
{ "error": "example", "message": "example", "statusCode": 1}