Rakurai API (1.0.0)

API for managing deposits, withdrawals, and retrieving information related to Solana stake pools.

Download OpenAPI description
Languages
Servers
https://api.rakurai.io/

/api/deposit

Request

Accepts a public key and amount in lamports to deposit into the stake pool.

Bodyapplication/jsonrequired

JSON object with the user's public key and the amount to deposit.

pubkeystring

Public key of the client.

Example: "Fg5kC6tJ9N5M5MS83M842ms23sNN2732N108dD2"
amountinteger

Amount in lamports to deposit.

Example: 54
curl -i -X POST \
  https://api.rakurai.io/api/deposit \
  -H 'Content-Type: application/json' \
  -d '{
    "pubkey": "Fg5kC6tJ9N5M5MS83M842ms23sNN2732N108dD2",
    "amount": 54
  }'

Responses

Transaction message ready for client signing.

Bodyapplication/json
txnstring

Serialized transaction message for client signing.

Example: "BASE64_ENCODED_TRANSACTION_DATA"
Response
application/json
{ "txn": "BASE64_ENCODED_TRANSACTION_DATA" }

/api/withdraw

Request

Processes a withdrawal request from the stake pool based on the user's public key and amount.

Bodyapplication/jsonrequired
pubkeystring

Public key of the client.

Example: "Fg5kC6tJ9N5M5MS83M842ms23sNN2732N108dD2"
amountinteger

Amount in lamports to withdraw.

Example: 3000000
curl -i -X POST \
  https://api.rakurai.io/api/withdraw \
  -H 'Content-Type: application/json' \
  -d '{
    "pubkey": "Fg5kC6tJ9N5M5MS83M842ms23sNN2732N108dD2",
    "amount": 3000000
  }'

Responses

Transaction message ready for client signing.

Bodyapplication/json
txnstring

Serialized transaction message for client signing.

Example: "BASE64_ENCODED_TRANSACTION_DATA"
pub_keystring

Public key of the destination stake account.

Example: "Fg5kC6tJ9N5M5MS83M842ms23sNN2732N108dD2"
sec_keystring

Secret key of the destination stake account.

Example: "SECRET_KEY_BASE64_ENCODED"
sigstring

Signature of the transaction.

Example: "TRANSACTION_SIGNATURE_BASE64_ENCODED"
Response
application/json
{ "txn": "BASE64_ENCODED_TRANSACTION_DATA", "pub_key": "Fg5kC6tJ9N5M5MS83M842ms23sNN2732N108dD2", "sec_key": "SECRET_KEY_BASE64_ENCODED", "sig": "TRANSACTION_SIGNATURE_BASE64_ENCODED" }

/api/tokenvalue

Request

Returns the current value of tokens in the stake pool by calculating the ratio of total lamports to pool token supply.

curl -i -X GET \
  https://api.rakurai.io/api/tokenvalue

Responses

Successfully retrieves the token value.

Bodyapplication/json
tokenValuenumber(float)

Current value of each pool token.

Example: 1.25
Response
application/json
{ "tokenValue": 1.25 }

/api/solvalue

Request

Retrieves the current USD value of SOL from an external API.

curl -i -X GET \
  https://api.rakurai.io/api/solvalue

Responses

Successfully retrieved SOL USD value.

Bodyapplication/json
solValuenumber

The current USD value of SOL.

Example: 163.479
Response
application/json
{ "solValue": 163.479 }

/api/epochinfo

Request

Retrieves the current epoch details including the number of remaining slots and the estimated time left in seconds.

curl -i -X GET \
  https://api.rakurai.io/api/epochinfo

Responses

Successfully retrieved epoch information.

Bodyapplication/json
epochSecondsinteger

Estimated remaining time in the current epoch, in seconds.

Example: 12000
epochinteger

The current epoch number.

Example: 234
Response
application/json
{ "epochSeconds": 12000, "epoch": 234 }

/api/send

Request

Sends a serialized and signed transaction to the blockchain.

Bodyapplication/jsonrequired
txnstringrequired

The serialized signed transaction in hex format to be sent.

Example: "0xabcdef1234567890..."
curl -i -X POST \
  https://api.rakurai.io/api/send \
  -H 'Content-Type: application/json' \
  -d '{
    "txn": "0xabcdef1234567890..."
  }'

Responses

Successful transaction submission.

Bodyapplication/json
txn_signaturestring

The signature of the submitted transaction.

Example: "TransactionSignature"
Response
application/json
{ "txn_signature": "TransactionSignature" }

/api/staking/account-status

Request

Retrieves the status of a staking account based on the provided stake account address.

Bodyapplication/jsonrequired
stake_accountstringrequired

The public key of the stake account to check the status of.

Example: "StakeAccountPublicKey"
curl -i -X POST \
  https://api.rakurai.io/api/staking/account-status \
  -H 'Content-Type: application/json' \
  -d '{
    "stake_account": "StakeAccountPublicKey"
  }'

Responses

Successful retrieval of staking account status.

Bodyapplication/json
stake_accountobject
Response
application/json
{ "stake_account": { "address": "StakeAccountPublicKey", "status": "Inactive", "stake_authority": "StakeAuthorityPublicKey", "withdraw_authority": "WithdrawAuthorityPublicKey", "vote_account": "VoteAccountPublicKey", "amount": 1000000 } }

/api/apy

Request

Retrieves the APY values for specified epochs or the latest APY if no parameters are provided.

Query
epochstring

Specific epoch to fetch the APY for.

Example: epoch=5
start_epochstring

Start of the epoch range for fetching APY values.

Example: start_epoch=1
end_epochstring

End of the epoch range for fetching APY values.

Example: end_epoch=10
curl -i -X GET \
  'https://api.rakurai.io/api/apy?end_epoch=10&epoch=5&start_epoch=1'

Responses

Successful retrieval of APY values.

Bodyapplication/json
apy_valuesArray of objects
Response
application/json
{ "apy_values": [ {} ] }

/api/tps

Request

Retrieves the TPS values for specified epochs or time ranges.

Query
epochstring

Specific epoch to fetch the TPS for.

Example: epoch=5
timestring

Specific timestamp to fetch the TPS value.

Example: time=1680345600
start_timestring

Start of the time range for fetching TPS values.

Example: start_time=1680345600
end_timestring

End of the time range for fetching TPS values.

Example: end_time=1680349200
start_epochstring

Start of the epoch range for fetching TPS values.

Example: start_epoch=1
end_epochstring

End of the epoch range for fetching TPS values.

Example: end_epoch=10
curl -i -X GET \
  'https://api.rakurai.io/api/tps?end_epoch=10&end_time=1680349200&epoch=5&start_epoch=1&start_time=1680345600&time=1680345600'

Responses

Successful retrieval of TPS values.

Bodyapplication/json
tps_valuesArray of objects
Response
application/json
{ "tps_values": [ {} ] }

/api/tvl

Request

Retrieves the TVL values for specified epochs.

Query
epochstring

Specific epoch to fetch the TVL for.

Example: epoch=5
start_epochstring

Start of the epoch range for fetching TVL values.

Example: start_epoch=1
end_epochstring

End of the epoch range for fetching TVL values.

Example: end_epoch=10
curl -i -X GET \
  'https://api.rakurai.io/api/tvl?end_epoch=10&epoch=5&start_epoch=1'

Responses

Successful retrieval of TVL values.

Bodyapplication/json
tvl_valuesArray of objects
Response
application/json
{ "tvl_values": [ {} ] }