Solana

šŸ“˜

In this article

This article explains how to use the PROTECT APIs to implement Solana staking. It covers

  • A brief recap of Solana staking concepts.
  • How to stake and unstake SOL programmatically.

There are several important prerequisite steps and knowledge areas to understand prior to starting:

  • Understand Solana staking concepts including delegation, deactivation, stake accounts, rewards, epochs, rent and rent exceptions.
  • Create all relevant governance rules to allow staking and approve Solana transactions. Without these rules, approval requests may not appear.
  • Knowledge of how to authenticate and sign for approval via API.

Solana Staking Workflow

Solana uses delegated Proof of Stake with validators. You do not stake directly with a validator from your wallet. Instead:

  1. You create a stake account.
  2. You fund it with SOL.
  3. You delegate that stake account to a validator.
  4. The validator earns rewards for you.
  5. Rewards are added to the stake account balance automatically.
  6. Every Solana account must maintain a rent-exempt minimum balance. This balance acts as a storage deposit to secure blockchain storage and is returned when the account is closed, provided the rent-exempt threshold has been maintained.
  7. Deactivate the stake account to stop staking (must wait till next epoch).

🚧

Key differences between SOL and ETH staking

Unlike ETH staking, with Solana Staking:

  • Your SOL does not get transferred to the validator, it stays on a stake account that you control. This means you can transfer as much or as little as you want to the stake account.
  • There is no minimum amount you are required to stake however, you must consider rent exempt minimums. Read about partial staking below.
  • When you delegate SOL, the stake becomes Active at the start of the next epoch (~2–3 days), and rewards start in the following epoch. Expect to wait up to 2 epochs before earning rewards. Deactivated stakes become Inactive at the next epoch and can then be withdrawn immediately.

Protect SOL Staking workflow

PROTECT simplifies the staking workflow by abstracting the on-chain staking workflow in our APIs.

Protect ActionOn Chain
1. Create Staking Request endpoint (Create a SOL delegate request)Nothing prior to approval.
2. Approve Staking Request (see Signing for approval)- Create Stake Account - Delegate Stake Account to validator - Earn rewards per epoch
3. Create Unstake Request (Deactivate) (Create a SOL deactivate stake request- Deactivate stake (on next epoch)
4. Withdraw the amount from the stake account.- Funds transferred out of stake account.

Create Staking Request via API

🚧

Important

You must ensure you have a SOL validator whitelisted prior to creating a staking request.

  1. Identify the ID of the address that will fund the stake account. This is the address from which the staked SOL will be transferred. See the List Addresses endpoint.
  2. Determine the validator ID to which your stake account will be delegated. This will also be available via the List Addresses endpoint you used above.
  3. Enter the amount you want to stake. In PROTECT amounts are always in the smallest units for the respective currency, in this case, Lamports.
  4. Call the Create a SOL Delegate Request endpoint (see example body below).
{"fromAddressId":"1234","amount":"100000000","toValidatorAddressId":"1010","autoMerging":true}
šŸ“˜

Merging Stake Account

Auto-merge automatically consolidates eligible active stake accounts that are delegated to the same validator, helping keep wallet stake accounts organized while preserving rewards.

A stake account is considered compatible for merging if it meets all of the following requirements:

  • autoMergingis set to true in the request.
  • Both accounts are delegated to the same validator.
  • Both stake accounts are active.

Note that if a valid merge is found, a request will be automatically created and must be approved per the standard request approval workflow. The comment on the request will be generated by PROTECT and will read: Automatically created. The stake accounts are ready to be merged.

If you do not enable autoMerging, you will have multiple stake accounts created. You can manually merge stake accounts at any time using the Create a SOL Merge Request endpoint. Note this requires knowing the stakeAccountDerivationIndex (see Deactivating a Stake Request below).


Approving a Staking Request

After a stake request is created, it must be approved per the standard request signing protocol. As always, please see the Signing for Approval instructions..

Deactivating a Stake Request

In Solana, Unstaking is referred to as Deactivating a stake.

  1. Determine the addressID for the address corresponding to the stake account.
  2. Look up the fromStakeAccountDerivationIndexby querying the Get Stake Account endpoint.. Note this value can be found under StakeAccounts[0].solanaStakeAccount.derivationIndex (see example response below).
{
    "stakeAccounts": [
        {
            "id": "40e9918f...",
            "addressId": "1234",
            "accountAddress": "D3Bjs39...",
            "solanaStakeAccount": {
=============> "derivationIndex": "1", ===================== // fromStakeAccountDerivationIndex
                "state": "active",
                "validatorAddress": "6D2jq...",
                "activeBalance": "1000000",
                "inactiveBalance": "2000",
                "allowMerge": true
            }
        }
    ],
    "cursor": {
        "currentPage": "gaRjdXJypUZJUlNU"
    }
}
  1. Create a deactivation request by querying the Create a SOL Delegate Request endpoint and providing the parameters you retrieved in steps 1 and 2.
  2. {"fromAddressId":"12345","fromStakeAccountDerivationIndex":"1","amount":10000}
  3. PROTECT creates a request to be signed. See signing for approval.
  4. Once you approve the deactivate request, the system broadcasts the transaction to the blockchain. After deactivation is complete, the system automatically creates a withdraw request, which you can approve to broadcast a withdrawal transaction
šŸ“˜

Partial Staking / Unstaking

PROTECT supports Solana partial staking and partial unstaking. Because staking uses a separate stake account (independent of your primary SOL address), you can transfer and stake only a portion of your SOL.

When you call deactivate with an amount smaller than the stake account balance, PROTECT creates a new stake account and submits a Solana split transaction. It moves the specified amount into the new account, then deactivates that account, allowing the remaining balance to stay staked..



  Ā© 2025 Taurus SA. All rights reserved.