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-NETWORK header

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

info

If you omit the header the API falls back to the default Solana network configured for your account.

List available networks

Use this helper endpoint to obtain the list of Solana JPool networks that are currently enabled for your API key.

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

Response payload: array of NetworkResponseDto items:

FieldTypeRequiredDescription
namestringInternal blockchain entry name
typestringBlockchain type string (always SOLANA)
chain_idstringCluster identifier such as mainnet-beta or devnet
is_defaultbooleantrue when this network is used as fallback

Example

curl "https://staking-api.stakely.io/api/v1/solana/jpool/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
}
]

Stake action

Craft a JPool stake transaction:

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

Description

This endpoint crafts a JPool stake transaction ready to be signed. It deposits SOL into the JPool stake pool and mints the liquid pool token (JSOL) representing the staked position.

Request body parameters

FieldTypeRequiredDescription
wallet_addressstringWallet address of the user that will perform the JPool stake action
amountnumberAmount of SOL to deposit into JPool (minimum 0.003 SOL). Direct stake to validator from network config.
  • wallet_address (required): Wallet address that will perform the JPool stake action.
  • amount (required): Amount of SOL to deposit into JPool. Minimum 0.003 SOL.

Returned

FieldTypeRequiredDescription
unsigned_tx_hexstringUnsigned craft transaction hex string

Sign the returned unsigned_tx_hex and continue with the prepare and broadcast steps. See the JPool integration example.

Example

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

Response:

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

Unstake action

Craft a JPool unstake transaction:

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

Description

This endpoint crafts a JPool unstake transaction ready to be signed. It burns pool tokens and returns SOL, net of the withdrawal fee.

Request body parameters

FieldTypeRequiredDescription
wallet_addressstringWallet address of the user that will perform the JPool unstake action
amountnumberPool token amount in UI decimal (JSOL), not SOL. Use pool_token_balance from stake-balance.
  • wallet_address (required): Wallet address that will perform the JPool unstake action.
  • amount (required): Pool token amount in UI decimal (JSOL), not SOL. Use pool_token_balance from the stake-balance endpoint.

Returned

FieldTypeRequiredDescription
unsigned_tx_hexstringUnsigned craft transaction hex string

Example

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

Response:

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

Prepare action

Gathers signature and unsigned tx:

  • Endpoint: /api/v1/solana/jpool/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/jpool/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/jpool/action/broadcast

Description

Broadcast a signed transaction. Usually you will broadcast the signed transaction returned in the 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/jpool/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"
}

Stake balance

Get the JPool stake balance for the given address:

  • Endpoint: /api/v1/solana/jpool/stake-balance/{address}

Description

Returns the wallet's JPool pool token balance, the current exchange rate, the estimated SOL value, and the current pool fees.

Request parameters

ParameterInTypeRequiredDescription
addresspathstringSolana wallet address

Returned

FieldTypeRequiredDescription
wallet_addressstringWallet address that was queried
pool_token_balancenumberJPool pool token balance (UI / JSOL)
pool_token_balance_rawstringPool token balance in raw base units
pool_token_ratenumberExchange rate in lamports per pool token
estimated_solnumberEstimated SOL value of pool tokens before withdrawal fees
feesJPoolStakeBalanceFeesDtoCurrent JPool fees (see fields below)

The fees object:

FieldTypeRequiredDescription
solDepositFeenumberSOL deposit fee as a decimal (0.03 = 3%)
solWithdrawalFeenumberSOL withdrawal fee as a decimal (0.01 = 1%)

Example

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

Response:

{
"wallet_address": "CgA24Ai2v3Px7vjyaDrQEf2bvT9a2SmQbhzY1dxjsfyv",
"pool_token_balance": 0.000739044,
"pool_token_balance_raw": "739044",
"pool_token_rate": 1.3531,
"estimated_sol": 0.001,
"fees": {
"solDepositFee": 0.03,
"solWithdrawalFee": 0.01
}
}