Skip to main content
This walks through staking 1 SOL into raSOL using only curl and a Solana keypair. The same shape applies to native staking and USDC Earn.
You need a funded Solana wallet (at least the amount you want to stake plus a few thousand lamports for safety; Hubra covers gas, but you need the asset to stake itself). And a way to sign transactions locally.

1. Discover the strategies

Response:
Pick sol-liquid-stake. (All four keys are live and agent-callable — including sol-leveraged-stake, which deposits SOL into raSOL Max. See Strategies → sol-leveraged-stake.)

2. Build the unsigned transaction

Response:
Save transaction, hubra_token, sanctumKind, and sanctum_order. You will pass all four back to /broadcast.

3. Sign the transaction

Using @solana/web3.js:
For native staking, tx.sign([wallet]) only fills your wallet’s slot. The stake-account slot is pre-signed by Hubra’s server.

4. Broadcast

For Sanctum-routed flows (any liquid stake or instant native unstake), forward the Sanctum-specific fields:
For non-Sanctum flows (native delegation, native withdraw, USDC Earn), plain RPC is fine:
Response:
You now hold raSOL.

Adapting to other strategies

The shape is identical for all four agent-callable strategies. What changes:
  • Native stake (sol-native-stake): the response includes a fresh stakeAccount pubkey. Save it; you need it to deactivate or instant-unstake later. Broadcast via route: "rpc" for stake, route: "sanctum" for instant unstake.
  • Liquid stake (sol-liquid-stake): Sanctum-routed always.
  • USDC Earn (usdc-earn): broadcast via route: "rpc". No sanctum_order to forward.
  • Leveraged raSOL Max (sol-leveraged-stake): deposit amount in SOL — one tx does SOL → raSOL → raSOL Max LP. Unstake burns raSOL Max LP → raSOL (outputAsset: "SOL" adds a chained step to finish to SOL). Broadcast via route: "rpc".
See the per-endpoint references for the response shapes:

Stake

POST /api/v1/stake

Unstake

POST /api/v1/unstake

Withdraw

POST /api/v1/withdraw

Broadcast

POST /api/v1/broadcast