Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.hubra.app/llms.txt

Use this file to discover all available pages before exploring further.

POST https://hubra.app/api/v1/unstake
Build an unsigned unstake transaction. The route depends on strategy and kind:
Strategydeactivateinstantslow
sol-native-stakeStakeProgram.deactivate (epoch-bounded ~2.5d)Sanctum depositStake (active stake → SOL immediately)
sol-liquid-stakeSanctum swap raSOL → SOL via routed liquiditySanctum withdrawStake (raSOL → native stake account, then standard epoch deactivation)
usdc-earnVoltr direct-withdraw (no cooldown, no fee)
The returned transaction is base64 unsigned bytes. Sign and broadcast via POST /api/v1/broadcast.

Request

curl -X POST https://hubra.app/api/v1/unstake \
  -H 'Content-Type: application/json' \
  -d '{
    "strategy":      "sol-native-stake",
    "wallet":        "<your-wallet>",
    "stakeAccount":  "<your-stake-account>",
    "kind":          "deactivate"
  }'
FieldTypeRequiredDescription
strategystringyesOne of sol-native-stake, sol-liquid-stake, usdc-earn.
walletstringyesSolana wallet pubkey.
kind"deactivate" | "instant" | "slow"yesThe unstake mode. See the matrix above for valid combinations.
amountstringconditionalRequired except for usdc-earn with isWithdrawAll: true.
stakeAccountstringconditionalRequired for all sol-native-stake calls. The active stake account returned by your earlier /stake call.
isWithdrawAllbooleanoptionalValid only for usdc-earn. When true, withdraws the full vault position regardless of amount.

Response shapes

The response shape mirrors /stake: transaction (base64 unsigned), hubra_token (required at /broadcast), plus route metadata.

Sanctum-routed kinds

For sol-native-stake instant, sol-liquid-stake instant, and sol-liquid-stake slow:
{
  "strategy":      "sol-liquid-stake",
  "kind":          "instant",
  "transaction":   "<base64 unsigned tx>",
  "hubra_token":   "<token>",
  "route":         "sanctum",
  "sanctumKind":   "token",
  "sanctum_order": { "...": "..." },
  "signers":       ["<your-wallet>"]
}
sanctumKind varies by route:
Strategy + kindsanctumKind
sol-liquid-stake instanttoken
sol-liquid-stake slowwithdrawStake
sol-native-stake instantdepositStake
Forward hubra_token, sanctumKind, and sanctum_order to /broadcast.

Voltr-routed (usdc-earn instant)

{
  "strategy":    "usdc-earn",
  "kind":        "instant",
  "transaction": "<base64 unsigned tx>",
  "hubra_token": "<token>",
  "route":       "voltr",
  "signers":     ["<your-wallet>"]
}
Broadcast via route: "rpc".

Plain native deactivate (sol-native-stake deactivate)

{
  "strategy":    "sol-native-stake",
  "kind":        "deactivate",
  "transaction": "<base64 unsigned tx>",
  "hubra_token": "<token>",
  "signers":     ["<your-wallet>"],
  "notes":       "Stake becomes withdrawable after the deactivation epoch (~2.5 days). Then call /api/v1/withdraw."
}
No Sanctum or Voltr involvement. Broadcast via route: "rpc". After the deactivation epoch passes, call POST /api/v1/withdraw to close the stake account and pull SOL back.

Examples

# Native: epoch-bounded standard unstake
curl -X POST https://hubra.app/api/v1/unstake \
  -H 'Content-Type: application/json' \
  -d '{"strategy":"sol-native-stake","wallet":"<your-wallet>","stakeAccount":"<your-stake-account>","kind":"deactivate"}'

# Native: instant settlement to SOL via Sanctum
curl -X POST https://hubra.app/api/v1/unstake \
  -H 'Content-Type: application/json' \
  -d '{"strategy":"sol-native-stake","wallet":"<your-wallet>","stakeAccount":"<your-stake-account>","amount":"1.0","kind":"instant"}'

# Liquid: raSOL → SOL via Sanctum routing (instant)
curl -X POST https://hubra.app/api/v1/unstake \
  -H 'Content-Type: application/json' \
  -d '{"strategy":"sol-liquid-stake","wallet":"<your-wallet>","amount":"1.0","kind":"instant"}'

# Liquid: raSOL → stake account, then epoch deactivation (slow)
curl -X POST https://hubra.app/api/v1/unstake \
  -H 'Content-Type: application/json' \
  -d '{"strategy":"sol-liquid-stake","wallet":"<your-wallet>","amount":"1.0","kind":"slow"}'

# USDC: full withdraw
curl -X POST https://hubra.app/api/v1/unstake \
  -H 'Content-Type: application/json' \
  -d '{"strategy":"usdc-earn","wallet":"<your-wallet>","kind":"instant","isWithdrawAll":true}'

Errors

StatusSlugWhen
400invalid_requestMissing fields, invalid kind for the strategy, or stakeAccount missing for sol-native-stake.
404not_foundUnknown strategy key.
502upstream_errorSanctum / Voltr could not build the transaction.
503service_unavailableStrategy is announced but not live.

See also

POST /quote

Preview the output before unstaking.

POST /withdraw

Complete a native deactivate.

POST /broadcast

Submit the signed transaction.