platform.getTotalStake - AVAX

Example code for the platform.getTotalStake JSON-RPC method. Complete guide on how to use platform.getTotalStake JSON-RPC in GetBlock Web3 documentation.

Returns the total amount of AVAX staked on a given subnet, in nAVAX. For the Primary Network, this is the network's total stake securing consensus.

Parameters

Parameter
Type
Required
Description

subnetID

string

No

Subnet ID (default: Primary Network)

Request Example

curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>/ext/bc/P' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "platform.getTotalStake",
    "params": {},
    "id": "getblock.io"
}'

Response Example

{
    "jsonrpc": "2.0",
    "id": "getblock.io",
    "result": {
        "stake": "275000000000000000",
        "weight": "275000000000000000"
    }
}

Response Parameters

Field
Type
Description

result.stake

string

Total stake in nAVAX (decimal string)

result.weight

string

Total weight (equal to stake on Primary Network)

Use Cases

  • Network security dashboards

  • Computing staking rewards APR estimates

  • Tracking subnet adoption by stake weight

Error Handling

Status Code
Error Message
Cause

404

Not Found

Missing or invalid <ACCESS-TOKEN>

-32602

Invalid params

Request parameters are missing or malformed

429

Too Many Requests

Rate limit exceeded for your plan

SDK Integration

Last updated

Was this helpful?