Skip to content

What one coldkey paid for the shares of a fund it still holds

GET
/v1/beta-baskets/{hotkey}/cost-basis/

One coldkey’s purchases of this fund since its last claim of it: a claim redeems bought shares and dividends whole, so only later purchases are still held. Dividends cost nothing and are not counted.

Rate limit: 300 requests per minute per IP (scope explore).

  • None
hotkey
required
string

Validator hotkey SS58 address.

coldkey
required
string

The buyer. 400 when missing.

The coldkey’s purchases still held, with what it paid.

Media typeapplication/json

/v1/beta-baskets/{hotkey}/cost-basis/?coldkey=: the coldkey’s purchases of the fund since its last claim of it, the shares it still holds by purchase. A claim redeems bought shares and root dividends whole; dividends cost nothing.

object
hotkey
required
string
coldkey
required
string
paid_tao
required

TAO paid for those purchases. 0 when none since the last claim.

number format: double
value_tao
required

What they added to the fund’s realizable NAV: paid_tao - value_tao is their entry cost.

number format: double
shares
required

Fund shares they received, in the units of the fund’s shares.

integer
purchases
required

The purchases counted: those since the coldkey’s last claim of this fund.

integer
first_purchase_block
required

Of the purchases counted; null when there is none.

integer
nullable
last_claim_block
required

The coldkey’s last claim of this fund after its first purchase; null when there is none.

integer
nullable
as_of_block
required

The newest indexed block the answer covers: a purchase or claim in a later block is not in it yet.

integer
nullable

Example generated

{
"hotkey": "example",
"coldkey": "example",
"paid_tao": 1,
"value_tao": 1,
"shares": 1,
"purchases": 1,
"first_purchase_block": 1,
"last_claim_block": 1,
"as_of_block": 1
}

A parameter failed its check, which message names. code is usually VALIDATION_ERROR.

Media typeapplication/json

The error envelope every 4xx and 5xx response carries. The introduction lists the code values.

object
error
required

Always true. Lets a client branch without reading the status code.

boolean
code
required

Machine-readable error code, such as VALIDATION_ERROR or RESOURCE_NOT_FOUND. Branch on it, not on message.

string
message
required

One human-readable sentence.

string
detail
required

Extra context for some codes, such as the invalid fields of a VALIDATION_ERROR or retry_after on RATE_LIMITED; else null.

nullable

Examples

ExampleVALIDATIONERROR

VALIDATION_ERROR

{
"error": true,
"code": "VALIDATION_ERROR",
"message": "coldkey is required",
"detail": null
}

RESOURCE_NOT_FOUND. Carries Cache-Control: public, max-age=15, short because a new block or extrinsic is indexed up to a minute late.

Media typeapplication/json

The error envelope every 4xx and 5xx response carries. The introduction lists the code values.

object
error
required

Always true. Lets a client branch without reading the status code.

boolean
code
required

Machine-readable error code, such as VALIDATION_ERROR or RESOURCE_NOT_FOUND. Branch on it, not on message.

string
message
required

One human-readable sentence.

string
detail
required

Extra context for some codes, such as the invalid fields of a VALIDATION_ERROR or retry_after on RATE_LIMITED; else null.

nullable

Examples

ExampleRESOURCENOTFOUND

RESOURCE_NOT_FOUND

{
"error": true,
"code": "RESOURCE_NOT_FOUND",
"message": "Not found",
"detail": null
}

Rate limit exceeded (300/minute, per IP). Retry-After carries the seconds to wait.

Media typeapplication/json

The error envelope every 4xx and 5xx response carries. The introduction lists the code values.

object
error
required

Always true. Lets a client branch without reading the status code.

boolean
code
required

Machine-readable error code, such as VALIDATION_ERROR or RESOURCE_NOT_FOUND. Branch on it, not on message.

string
message
required

One human-readable sentence.

string
detail
required

Extra context for some codes, such as the invalid fields of a VALIDATION_ERROR or retry_after on RATE_LIMITED; else null.

nullable

Examples

ExampleRATELIMITED

RATE_LIMITED

{
"error": true,
"code": "RATE_LIMITED",
"message": "Request was throttled",
"detail": {
"retry_after": 12
}
}
Retry-After
integer

Seconds before the next request is accepted.

QUERY_TIMEOUT: the query exceeded its budget. detail carries budget_ms, elapsed_ms, path and query.

Media typeapplication/json

The error envelope every 4xx and 5xx response carries. The introduction lists the code values.

object
error
required

Always true. Lets a client branch without reading the status code.

boolean
code
required

Machine-readable error code, such as VALIDATION_ERROR or RESOURCE_NOT_FOUND. Branch on it, not on message.

string
message
required

One human-readable sentence.

string
detail
required

Extra context for some codes, such as the invalid fields of a VALIDATION_ERROR or retry_after on RATE_LIMITED; else null.

nullable

Examples

ExampleQUERYTIMEOUT

QUERY_TIMEOUT

{
"error": true,
"code": "QUERY_TIMEOUT",
"message": "query exceeded the 12000 ms budget; retry, or narrow the requested range",
"detail": {
"budget_ms": 12000,
"elapsed_ms": 12004,
"path": "/trades/summary/",
"query": "coldkey=5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY&resolution=day"
}
}