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.
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.)
import { VersionedTransaction, Keypair } from "@solana/web3.js";const tx = VersionedTransaction.deserialize( Buffer.from(buildResponse.transaction, "base64"),);tx.sign([wallet]); // wallet is a Keypair you holdconst signed = Buffer.from(tx.serialize()).toString("base64");
For native staking, tx.sign([wallet]) only fills your wallet’s slot. The stake-account slot is pre-signed by Hubra’s server.
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.
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: