Generate a Solana stake transaction payload

Builds a Solana staking transaction message for the caller to sign and submit. Building a payload does not broadcast a transaction or confirm an on-chain change.

Choose Mainnet or Devnet from the Base URL dropdown on the right before using Try It. Devnet is the Solana test environment. Use an API key and any required account addresses for your selection. Changing Base URL does not change the API key or addresses you have entered.

Supply your API credentials in the api-key header and send the request body as JSON. Instructions operating on an existing stake account must provide a top-level stakePubkey alongside feePayer and instructions.

After building, sign the transaction through your wallet or custody integration, submit it to the selected Solana network, and confirm execution.

Select an instruction from the Examples dropdown or use the complete JSON requests below. Replace every <...> placeholder with your own address on the selected network before using Try It; entering an API key does not replace them automatically. Each example contains one instruction. The fee payer must sign, along with the instruction-specific signers described below.

For operations on existing accounts, first call Get Solana Stake Accounts (GET /solana/stakes) with the same API key and copy the account's stakePubkey and relevant authority. Confirm its current balance and state through Solana RPC because the listing can be stale.

Create and delegate a new stake account

Creates a new stake account and delegates it to the validator configured for the gateway in one transaction. Omit the top-level stakePubkey so the gateway generates the new account address.

fromPubkey funds the account and must sign. stakeAuthority controls delegation and deactivation and must also sign this instruction. withdrawAuthority controls withdrawals. The example uses the funding address as feePayer.

lamports is a decimal string containing the total account funding, including its rent reserve. The example funds 2 SOL; confirm the current rent reserve and minimum delegation before choosing an amount. reference and label identify the stake within the platform.

{
  "feePayer": "<FEE_PAYER_AND_FUNDING_ADDRESS>",
  "instructions": [
    {
      "type": "createAndDelegate",
      "input": {
        "fromPubkey": "<FEE_PAYER_AND_FUNDING_ADDRESS>",
        "stakeAuthority": "<STAKE_AUTHORITY>",
        "withdrawAuthority": "<WITHDRAW_AUTHORITY>",
        "lamports": "2000000000",
        "reference": "client-create-and-delegate-1",
        "label": "Delegated stake"
      }
    }
  ]
}

The response's data.stakePubkey identifies the new account. Restore the gateway-supplied account signature before signing and submitting, as described in Signing and submitting stake transaction payloads below. The account exists on-chain only after the transaction succeeds.

Create a new stake account without delegating

Creates and funds an account with the same inputs as createAndDelegate, but leaves it undelegated. Omit the top-level stakePubkey. The funding address must sign; setting stakeAuthority and withdrawAuthority does not require those authorities to sign account creation.

The example funds 2 SOL, including the account's rent reserve, and uses the funding address as feePayer. Choose an amount that covers the current rent reserve and any later delegation requirements.

{
  "feePayer": "<FEE_PAYER_AND_FUNDING_ADDRESS>",
  "instructions": [
    {
      "type": "create",
      "input": {
        "fromPubkey": "<FEE_PAYER_AND_FUNDING_ADDRESS>",
        "stakeAuthority": "<STAKE_AUTHORITY>",
        "withdrawAuthority": "<WITHDRAW_AUTHORITY>",
        "lamports": "2000000000",
        "reference": "client-create-1",
        "label": "New stake"
      }
    }
  ]
}

The response's data.stakePubkey identifies the new account. Restore the gateway-supplied account signature before signing and submitting. To delegate later, use that address as the top-level stakePubkey in a delegate request.

Delegate an existing stake account

Delegates the top-level stakePubkey to the validator configured for the gateway. Select an account eligible for delegation and confirm that its available stake meets the network's current minimum delegation.

authorizedPubkey is the account's stake authority and must sign. The example uses the same address as feePayer.

{
  "feePayer": "<FEE_PAYER_AND_STAKE_AUTHORITY>",
  "stakePubkey": "<STAKE_ACCOUNT>",
  "instructions": [
    {
      "type": "delegate",
      "input": {
        "authorizedPubkey": "<FEE_PAYER_AND_STAKE_AUTHORITY>"
      }
    }
  ]
}

Undelegate (deactivate) an existing stake account

Starts deactivation of the top-level stakePubkey. authorizedPubkey is the account's stake authority and must sign. The example uses the same address as feePayer.

Deactivation does not immediately make all delegated stake available to withdraw. Wait until the requested amount is inactive and withdrawable on-chain before building a withdrawal.

{
  "feePayer": "<FEE_PAYER_AND_STAKE_AUTHORITY>",
  "stakePubkey": "<STAKE_ACCOUNT>",
  "instructions": [
    {
      "type": "undelegate",
      "input": {
        "authorizedPubkey": "<FEE_PAYER_AND_STAKE_AUTHORITY>"
      }
    }
  ]
}

Withdraw available inactive stake

Withdraws available inactive stake or excess SOL from the top-level stakePubkey to toPubkey. authorizedPubkey is the account's withdraw authority and must sign. The example uses that authority as feePayer.

For withdrawal, lamports is a JSON number. The example withdraws 1 SOL (1,000,000,000 lamports); confirm that the amount is currently available and that any remaining balance satisfies the account's rent and delegation requirements.

{
  "feePayer": "<FEE_PAYER_AND_WITHDRAW_AUTHORITY>",
  "stakePubkey": "<STAKE_ACCOUNT>",
  "instructions": [
    {
      "type": "withdraw",
      "input": {
        "toPubkey": "<WITHDRAWAL_RECIPIENT>",
        "authorizedPubkey": "<FEE_PAYER_AND_WITHDRAW_AUTHORITY>",
        "lamports": 1000000000
      }
    }
  ]
}

Change a stake account authority

Changes an authority of the top-level stakePubkey to newAuthorizedPubkey. Set stakeAuthorizationType to 0 for the stake authority or 1 for the withdraw authority. authorizedPubkey is the current authority for the chosen type and must sign.

The example changes the stake authority and uses the current authority as feePayer. To change the withdraw authority, use stakeAuthorizationType: 1 and the account's current withdraw authority.

{
  "feePayer": "<FEE_PAYER_AND_CURRENT_AUTHORITY>",
  "stakePubkey": "<STAKE_ACCOUNT>",
  "instructions": [
    {
      "type": "authorize",
      "input": {
        "authorizedPubkey": "<FEE_PAYER_AND_CURRENT_AUTHORITY>",
        "newAuthorizedPubkey": "<NEW_AUTHORITY>",
        "stakeAuthorizationType": 0
      }
    }
  ]
}

Split an existing stake account

Creates one or more new child stake accounts and moves each requested amount from the source account into the corresponding child. Supply one split instruction per destination account. Split instructions cannot be combined with other instruction types. The child inherits the source account's stake and withdraw authorities and, for delegated stake, its delegation history.

For production integrations, use an active source account. Requests involving undelegated or activating accounts may fail. For a partial split of active stake, both the child's delegated stake and the parent's remaining delegated stake must meet the network's current minimum delegation.

The stake authority (authorizedPubkey) funds the new account's rent-exempt reserve separately from the split amount, and feePayer pays transaction fees. The examples use the same address for both roles. If feePayer differs from authorizedPubkey, collect both signatures before broadcast. Destination accounts are derived with createWithSeed from authorizedPubkey; no ephemeral secret key is returned for split. Rent and minimum delegation are network parameters; do not hard-code them.

To try a split, first call Get Solana Stake Accounts (GET /solana/stakes) with the same API key. Choose an eligible ACTIVE account and copy its stakePubkey into the request. Set instructions[0].input.authorizedPubkey to that account's stakeAuthority; the example below also uses that authority as feePayer, which must have enough SOL for rent and fees. Confirm the current parent balance and delegation state through Solana RPC, then choose a valid split amount; the listing can be stale. Replace every <...> placeholder in the example with a real public key; entering an API key does not replace them automatically.

{
  "feePayer": "<FEE_PAYER_AND_STAKE_AUTHORITY>",
  "stakePubkey": "<PARENT_STAKE_ACCOUNT>",
  "instructions": [
    {
      "type": "split",
      "input": {
        "authorizedPubkey": "<FEE_PAYER_AND_STAKE_AUTHORITY>",
        "lamports": "1050000000",
        "reference": "client-split-1",
        "label": "Split child"
      }
    }
  ]
}
  • authorizedPubkey is the source account's stake authority and must sign.
  • lamports must be a positive base-10 integer string, without leading zeros, and must not exceed 9007199254740991. The example moves 1.05 SOL; check the remaining delegation before using that amount.
  • reference and label are optional. Omitted metadata is inherited or defaulted by the service. A supplied parent label normally gains " (split)" when inherited; a blank parent can produce "Split stake".
  • Supply an explicit child label to override inheritance. An empty string is accepted.

Example success response, HTTP 201:

{
  "data": {
    "serialized": "<HEX_ENCODED_V0_MESSAGE>",
    "stakePubkey": "<NEW_CHILD_STAKE_ACCOUNT>",
    "stakePubkeys": ["<NEW_CHILD_STAKE_ACCOUNT>"],
    "signatures": []
  }
}

The request's stakePubkey identifies the parent. The response's data.stakePubkeys contains all new child addresses in instruction order; data.stakePubkey is the first child for backwards compatibility. The empty signatures array means no additional account signature is supplied by the gateway; it does not remove the caller's signing requirement.

Each build can generate a different child address. Keep the returned address paired with the exact payload from that response. The new account exists on-chain only after the transaction is submitted and succeeds.

Decode, sign, submit and confirm the returned message as described in Signing and submitting stake transaction payloads below.

Merge compatible stake accounts

Merges the source account into a surviving destination account. The source account is closed when the transaction succeeds on-chain.

The top-level stakePubkey is the destination that survives. input.sourceStakePubkey is the source account that closes. authorizedPubkey is the stake authority and must sign.

Accounts must have compatible stake and withdraw authorities, lockup settings and delegation state. Active-stake merges also require compatible validator and vote-credit state. Matching authorities alone does not establish eligibility.

A child split from active stake inherits delegation history and can be merged back without waiting an additional epoch, provided the accounts remain compatible.

The example below uses the same address for the fee payer and stake authority. Replace every <...> placeholder with a real public key before submitting a request.

{
  "feePayer": "<FEE_PAYER_AND_STAKE_AUTHORITY>",
  "stakePubkey": "<SURVIVING_STAKE_ACCOUNT>",
  "instructions": [
    {
      "type": "merge",
      "input": {
        "authorizedPubkey": "<FEE_PAYER_AND_STAKE_AUTHORITY>",
        "sourceStakePubkey": "<STAKE_ACCOUNT_TO_CLOSE>"
      }
    }
  ]
}

The response's data.stakePubkey identifies the surviving destination. Decode, sign, submit and confirm the returned message as described in Signing and submitting stake transaction payloads below.

The stake-account listing may retain the source as DISSOLVED with its historical balance. Exclude that row when calculating current holdings.

Signing and submitting stake transaction payloads

data.serialized is a hexadecimal-encoded Solana v0 message, not a serialized transaction including its signature envelope.

For all instruction types, construct a transaction using @solana/web3.js v1.x and restore any additional signatures supplied by the gateway:

import { MessageV0, PublicKey, VersionedTransaction } from '@solana/web3.js';

const message = MessageV0.deserialize(
  Buffer.from(response.data.serialized, 'hex'),
);
const transaction = new VersionedTransaction(message);

for (const { pubKey, signature } of response.data.signatures) {
  transaction.addSignature(new PublicKey(pubKey), Buffer.from(signature, 'hex'));
}

For create and createAndDelegate, data.signatures contains the signature of the generated stake account. Keep it paired with the exact returned message and preserve it when adding your own signatures. Other examples return an empty array; the caller's required signatures must still be collected.

Use your wallet or custody integration to sign the required message signers, submit the transaction to the matching Solana network, and confirm execution. Do not pass data.serialized directly to VersionedTransaction.deserialize().

Current integration limitations

The examples each use one instruction per request. Split and merge requests involving undelegated or activating accounts may fail to build through the production gateway.

Building a transaction can create a provisional REQUESTED record, including on some failed builds. A listing row is not proof of execution.

Invalid split amounts and mixed split/non-split instruction types return HTTP 400. Other invalid inputs or unsupported account states can surface as HTTP 500. Verify the request fields and account state before rebuilding.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Body Params
Headers
string
required

mavan api key

Response

Language
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json