Skip to main content

Endpoints

API Usage

Once you have access to the Staking API with a validated user and existing API keys, you can start using this service.

Try it live

tip

Every endpoint on this page can be executed from the interactive Swagger console, using your own X-API-KEY.

The machine-readable OpenAPI schema is available at:

Authentication

In order to use the Staking API endpoints you need to include your API KEY.

tip

Heads up! To obtain a valid API key required for authentication, please refer to the Authentication > Create API keys section of the documentation.

Header:

NameDescriptionExample valueRequired
X-API-KEYYour api key value<API_KEY_VALUE>
X-NETWORKBlockchain network/cluster identifiermainnet-beta
X-IDENTITYCaller-defined identity stored in the audit loguser-1234

X-NETWORK header

Use the X-NETWORK header to select the Solana cluster to operate on (e.g., mainnet-beta, devnet).

info

Supported values match the RPC cluster identifier that Solana exposes (the cluster argument in web3). If you omit the header the API falls back to the default Solana network configured for your account.

tip

Currently supported values: mainnet-beta and devnet. Contact [email protected] if you need another cluster enabled.

X-IDENTITY header

Use the X-IDENTITY header to attribute a request to the end user or account acting through your integration. The value is caller-defined and is stored with the request in the audit log, so activity can be traced back to it later.

info

The header is optional and does not change the response. Prefer an opaque internal identifier such as a user ID or account reference over personal data like emails or names. If you omit it, the request is attributed only to your API key.

List available networks

Need to know which Solana clusters are enabled for your API key? Ask the API directly.

  • Endpoint: /api/v1/solana/native/networks

Each item in the response includes:

FieldTypeRequiredDescription
namestringInternal descriptor for the Solana blockchain entry
typestringBlockchain type string (always SOLANA)
chain_idstringCluster identifier such as mainnet-beta or devnet
is_defaultbooleantrue when the cluster is used as fallback

Example

curl "https://staking-api.stakely.io/api/v1/solana/native/networks" \
-H "X-API-KEY: $STAKELY_API_KEY" \
-H "X-NETWORK: mainnet-beta"

Response:

[
{
"name": "solana",
"type": "SOLANA",
"chain_id": "mainnet-beta",
"is_default": true
}
]

Staking information

Get the staking parameters of this protocol:

  • Endpoint: /api/v1/solana/native/staking-info

Description

Staking parameters for Solana mainnet: activation, deactivation and withdrawal times in minutes, fees, current APR/APY, slashing risk and stake limits. Served from an in-memory snapshot refreshed hourly.

Returned

FieldTypeRequiredDescription
stake_activation_max_timenumberMaximum time, in minutes, for a new stake to become active and start accruing rewards. 0 means it is effective immediately.
stake_deactivation_max_timenumberMaximum time, in minutes, for an unstake request to complete the unbonding/exit period. 0 means the stake is released immediately.
withdrawal_max_timenumberMaximum time, in minutes, between a completed deactivation and the funds being spendable again. 0 means the funds are available as soon as the deactivation completes.
staking_reward_feenumberAggregate fee charged on staking rewards, as a percentage of the rewards generated (validator commission plus any protocol fee).
withdrawal_feenumberFee charged when withdrawing the stake, as a percentage of the withdrawn amount. Network transaction (gas) costs are not included.
staking_aprnumberCurrent annual percentage rate (rewards without compounding), as a percentage.
staking_apynumberCurrent annual percentage yield (rewards with compounding), as a percentage.
max_slashing_percentagenumberMaximum percentage of the staked amount that the protocol can slash. 0 means the protocol implements no slashing.
min_stake_amountstringMinimum amount that can be staked, as a decimal string in the native token of the chain.
max_stake_amountstringMaximum amount that can be staked, as a decimal string in the native token of the chain. null means the protocol enforces no upper limit.
usersnumberNumber of addresses currently staking with Stakely on this chain. Live figure, refreshed hourly. null on protocol-scoped endpoints (liquid staking, vaults), because the feed only publishes this per chain and the chain-wide figure is not that protocol's.
tvl_usdnumberTotal value staked with Stakely on this chain, in USD. Live figure, refreshed hourly. null on protocol-scoped endpoints, for the same reason as users.
tvl_tokennumberTotal value staked with Stakely on this chain, in the native token of the chain. Live figure, refreshed hourly. null on protocol-scoped endpoints, for the same reason as users.

Example

curl "https://staking-api.stakely.io/api/v1/solana/native/staking-info" \
-H "X-API-KEY: $STAKELY_API_KEY"

Response:

{
"stake_activation_max_time": 2880,
"stake_deactivation_max_time": 2880,
"withdrawal_max_time": 0,
"staking_reward_fee": 0,
"withdrawal_fee": 0,
"staking_apr": null,
"staking_apy": 5.9,
"max_slashing_percentage": 0,
"min_stake_amount": "1",
"max_stake_amount": null,
"users": 454,
"tvl_usd": 11027034.54,
"tvl_token": 148532.254
}

Create nonce account action

Craft a create nonce account transaction:

  • Endpoint: /api/v1/solana/native/action/create-nonce-account

Description

This endpoint will craft a create nonce account transaction ready to be signed. Creating a nonce account is an optional step, useful when you cannot sign the transaction inmediately after it the payload is created, since it has a short expiry time.

Request body parameters

FieldTypeRequiredDescription
wallet_addressstringWallet address of the user that will perform the staking action

Returned

FieldTypeRequiredDescription
unsigned_tx_hexstringUnsigned craft transaction hex string

Example

curl -X POST "https://staking-api.stakely.io/api/v1/solana/native/action/create-nonce-account" \
-H "X-API-KEY: $STAKELY_API_KEY" \
-H "X-NETWORK: mainnet-beta" \
-H "Content-Type: application/json" \
-d '{
"wallet_address": "CgA24Ai2v3Px7vjyaDrQEf2bvT9a2SmQbhzY1dxjsfyv"
}'

Response:

{
"unsigned_tx_hex": "0100000000000000000000000000000000000000...000405000000"
}

Stake action

Craft a stake transaction:

  • Endpoint: /api/v1/solana/native/action/stake

Description

This endpoint will craft a stake transaction ready to be signed.

The stake action combines these steps into a single transaction, simplifying the process for users. When you initiate a stake action through the Staking API, it will craft a transaction that creates the stake account, funds it, and delegates to our validator in one go.

Request body parameters

FieldTypeRequiredDescription
wallet_addressstringWallet address of the user that will perform the staking action
nonce_account_addressstringNonce account address, if not provided, the nonce will not be durable in time
amountnumberAmount of stake to perform in solana units, Minimum 1
signbooleanWhether to partial-sign the transaction with the stake account key. Defaults to true when omitted. Set to false to return an unsigned transaction for external signing.

Returned

FieldTypeRequiredDescription
unsigned_tx_hexstringUnsigned craft transaction hex string

Example

curl -X POST "https://staking-api.stakely.io/api/v1/solana/native/action/stake" \
-H "X-API-KEY: $STAKELY_API_KEY" \
-H "X-NETWORK: mainnet-beta" \
-H "Content-Type: application/json" \
-d '{
"wallet_address": "CgA24Ai2v3Px7vjyaDrQEf2bvT9a2SmQbhzY1dxjsfyv",
"nonce_account_address": "3JGZKRWKBuhdbxkpmGRBhi47Jnj8W1ec5guUToYKw9ny",
"amount": 1,
"sign": true
}'

Response:

{
"unsigned_tx_hex": "0100000000000000000000000000000000000000...000405000000"
}

Unstake action (deactivate)

Craft an unstake transaction:

  • Endpoint: /api/v1/solana/native/action/unstake

Description

This endpoint will craft an unstake transaction ready to be signed.

The unstake action through the Staking API initiates this process by creating a transaction that deactivates your stake account. It's important to note that this doesn't immediately return your tokens - you'll need to wait for the cooldown period and then perform a separate withdrawal action.

Request body parameters

FieldTypeRequiredDescription
wallet_addressstringWallet address of the user that will perform the staking action
stake_account_addressstringStake account address to be unstaked will all its balance
nonce_account_addressstringNonce account address, if not provided, the nonce will not be durable in time

Returned

FieldTypeRequiredDescription
unsigned_tx_hexstringUnsigned craft transaction hex string

Example

curl -X POST "https://staking-api.stakely.io/api/v1/solana/native/action/unstake" \
-H "X-API-KEY: $STAKELY_API_KEY" \
-H "X-NETWORK: mainnet-beta" \
-H "Content-Type: application/json" \
-d '{
"wallet_address": "CgA24Ai2v3Px7vjyaDrQEf2bvT9a2SmQbhzY1dxjsfyv",
"stake_account_address": "3ztZzUBzfeJ17VoZyNngBW9Uezs9pDkPyJPcBYQMZDWu",
"nonce_account_address": "3JGZKRWKBuhdbxkpmGRBhi47Jnj8W1ec5guUToYKw9ny"
}'

Response:

{
"unsigned_tx_hex": "0100000000000000000000000000000000000000...000405000000"
}

Withdraw deactivated stake action

Craft a withdraw deactivated stake transaction:

  • Endpoint: /api/v1/solana/native/action/withdraw

Description

This endpoint will craft a withdraw deactivated stake transaction ready to be signed.

After your stake has been fully deactivated, you can withdraw the tokens back to your main wallet. This process is called withdrawing deactivated stake. Here's an overview of the withdraw action.

The withdraw action through the Staking API creates a transaction that performs this withdrawal. While it's possible to partially withdraw funds in multiple transactions, the most common approach is to fully withdraw the entire balance in a single transaction.

Request body parameters

FieldTypeRequiredDescription
wallet_addressstringWallet address of the user that will perform the staking action to withdraw the funds and also be the recipient of the withdrawn funds
stake_account_addressstringStake account address from which the withdraw will be performed
nonce_account_addressstringNonce account address, if not provided, the nonce will not be durable in time
amountnumberAmount of stake to perform in solana units, Minimum 1. If Not provided, the entire stake will be withdrawn

Returned

FieldTypeRequiredDescription
unsigned_tx_hexstringUnsigned craft transaction hex string

Example

curl -X POST "https://staking-api.stakely.io/api/v1/solana/native/action/withdraw" \
-H "X-API-KEY: $STAKELY_API_KEY" \
-H "X-NETWORK: mainnet-beta" \
-H "Content-Type: application/json" \
-d '{
"wallet_address": "CgA24Ai2v3Px7vjyaDrQEf2bvT9a2SmQbhzY1dxjsfyv",
"stake_account_address": "3ztZzUBzfeJ17VoZyNngBW9Uezs9pDkPyJPcBYQMZDWu",
"nonce_account_address": "3JGZKRWKBuhdbxkpmGRBhi47Jnj8W1ec5guUToYKw9ny",
"amount": 1
}'

Response:

{
"unsigned_tx_hex": "0100000000000000000000000000000000000000...000405000000"
}

Prepare action

Gathers signature and unsigned tx:

  • Endpoint: /api/v1/solana/native/action/prepare

Description

Prepare a signed transaction by gathering the provided signatures with the unsigned transaction hex string:

Request body parameters

FieldTypeRequiredDescription
unsigned_tx_hexstringUnsigned transaction body hex string
signaturesstring[]Array of transaction signature hex strings

Returned

FieldTypeRequiredDescription
signed_tx_hexstringSigned transaction string (hex encoded) ready to be broadcasted

Example

curl -X POST "https://staking-api.stakely.io/api/v1/solana/native/action/prepare" \
-H "X-API-KEY: $STAKELY_API_KEY" \
-H "X-NETWORK: mainnet-beta" \
-H "Content-Type: application/json" \
-d '{
"unsigned_tx_hex": "0100000000000000000000000000000000000000...000405000000",
"signatures": [
"b6c291475834980a1db41bad1bcc23e2930295c4...5151deabf80a"
]
}'

Response:

{
"signed_tx_hex": "01392e8e2d590173daa411c2b5c2cceb943458c3...000405000000"
}

Broadcast action

Broadcast a signed transaction

  • Endpoint: /api/v1/solana/native/action/broadcast

Description

Broadcast a signed transaction. Usually you will brodcast the signed transaction returned in prepare previous step:

Request body parameters

FieldTypeRequiredDescription
signed_tx_hexstringSigned transaction string (hex encoded) to be broadcasted

Returned

FieldTypeRequiredDescription
tx_hashstringTransaction hash of the broadcasted transaction

Example

curl -X POST "https://staking-api.stakely.io/api/v1/solana/native/action/broadcast" \
-H "X-API-KEY: $STAKELY_API_KEY" \
-H "X-NETWORK: mainnet-beta" \
-H "Content-Type: application/json" \
-d '{
"signed_tx_hex": "01392e8e2d590173daa411c2b5c2cceb943458c3...000405000000"
}'

Response:

{
"tx_hash": "29JtVkmnVR2EHZN9h79UU1wYs1xhfM7EB9hAL7Zf...VxrBQk3SLnCk"
}

Unified staking balance

Get the staking balance for the given address in the unified cross-protocol shape:

  • Endpoint: /api/v1/solana/native/staking-balance/{address}

Description

Staking balance for an address in the unified cross-protocol shape, in SOL. Stake accounts are classified against the current epoch into activating, active, deactivating and withdrawable. Rewards are paid into the stake accounts every epoch, so they are already part of the staked amount. Every stake account is listed as a staking object, with its validator vote account and epochs; its id is the stake_account_address the unstake and withdraw endpoints take.

Amounts are in SOL. The field names are the same on every protocol Stakely supports, so a single integration can read a position on any of them; a bucket that does not apply here is null.

Request parameters

ParameterInTypeRequiredDescription
addresspathstringSolana wallet address

Returned

FieldTypeRequiredDescription
staked_amountnumberStake that is currently active and earning rewards, in native token units.
stake_activation_amountnumberStake that has been delegated but is still warming up, in native token units. null when the protocol activates stake immediately.
stake_deactivation_amountnumberStake that is unbonding and has not completed its deactivation period yet, in native token units. null when the protocol has no unbonding period.
stake_withdrawing_amountnumberStake that finished deactivating and is waiting for a withdrawal transaction, in native token units. null when the protocol releases the funds automatically.
stake_rewards_amountnumberRewards that can be claimed, in native token units. null when the protocol compounds rewards into staked_amount instead of accruing them separately.
staking_objectsStakingObjectDto[]Individually addressable units that make up the position, normalised across protocols. The amounts above are the aggregate; these are the handles needed to act on the position, because protocols such as Solana and Sui require an object id to craft an unstake or withdraw transaction. null means the protocol exposes no addressable objects at all and every action is amount-based; an empty array means it does expose them and the address currently holds none. An object is only listed when the protocol publishes a real identifier for it, so the listed objects do not necessarily add up to the totals above.

Each item in staking_objects is a StakingObjectDto:

FieldTypeRequiredDescription
idstringIdentifier of this object on its protocol, passed back to the action endpoints of that protocol (see below).
typeStakingObjectTypeWhether the object holds stake (delegation) or represents an exit already requested (withdrawal_request).
statusStakingObjectStatusLifecycle phase of the object. Objects sharing a status add up to the matching amount bucket of the response.
amountnumberPrincipal held by this object, in native token units. null when it could not be read.
rewards_amountnumberRewards accrued by this object on top of its principal, in native token units. null when the protocol reports rewards only at address level, compounds them into the principal, or when they could not be derived.
validator_addressstringValidator this object is delegated to, in the protocol native format (a vote account on Solana, a validator address on Sui). null when the protocol does not attribute the object to a single validator.
activation_epochnumberEpoch at which this object starts earning rewards. null on protocols that do not track activation per object.
withdrawable_epochnumberEpoch from which this object can be withdrawn. null on protocols whose withdrawal is time-based or that release funds automatically.
withdrawable_atstringISO-8601 instant from which this object can be withdrawn. null on protocols whose withdrawal is epoch-based or that release funds automatically.

On Solana native the id is the stake account address that the unstake and withdraw actions take as stake_account_address.

type values:

ValueDescription
delegationThe object holds stake.
withdrawal_requestThe object represents an exit that has already been requested.

status values:

ValueDescription
activatingWarming up, not earning rewards yet. Adds up to stake_activation_amount.
activeLive and earning rewards. Adds up to staked_amount.
deactivatingUnbonding, deactivation period not finished. Adds up to stake_deactivation_amount.
withdrawableDeactivated and waiting for a withdrawal transaction. Adds up to stake_withdrawing_amount.
unknownThe lifecycle phase could not be derived from the protocol data.

Example

curl "https://staking-api.stakely.io/api/v1/solana/native/staking-balance/CgA24Ai2v3Px7vjyaDrQEf2bvT9a2SmQbhzY1dxjsfyv" \
-H "X-API-KEY: $STAKELY_API_KEY" \
-H "X-NETWORK: mainnet-beta"

Response:

{
"staked_amount": 0.010159294,
"stake_activation_amount": 0,
"stake_deactivation_amount": 0,
"stake_withdrawing_amount": 0.010019844,
"stake_rewards_amount": null,
"staking_objects": [
{
"id": "2tqRXB9fb6MvrRL433ji4XiF5fB1K3ivnbmMAhqCU23z",
"type": "delegation",
"status": "active",
"amount": 0.010159294,
"rewards_amount": null,
"validator_address": "BmMVRAVef2qmJ1tJpG3JwRUtnfEiTbvDw9ZeFEi4wE7D",
"activation_epoch": 942,
"withdrawable_epoch": null,
"withdrawable_at": null
},
{
"id": "3xBwZmodz2wavfc592J2TuyUFZ2A8HFQdqVDWtJuzLHa",
"type": "delegation",
"status": "withdrawable",
"amount": 0.010019844,
"rewards_amount": null,
"validator_address": "BmMVRAVef2qmJ1tJpG3JwRUtnfEiTbvDw9ZeFEi4wE7D",
"activation_epoch": 941,
"withdrawable_epoch": 950,
"withdrawable_at": null
}
]
}