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/quote
Preview the output of an unstake without committing. Use this to show price impact and output amount to a user before they sign anything. Quotes are non-binding: pool state drifts between quote and unstake. Treat the returned outAmount and priceImpactPct as live estimates.
There is no quote endpoint for staking into a strategy. Stake quotes are deterministic: amount in equals amount out at the current receipt rate. Use GET /api/v1/strategies/{key} to read the rate and compute locally.

Request

curl -X POST https://hubra.app/api/v1/quote \
  -H 'Content-Type: application/json' \
  -d '{
    "strategy": "sol-liquid-stake",
    "wallet":   "<your-wallet>",
    "amount":   "1.5"
  }'
FieldTypeRequiredDescription
strategy"sol-liquid-stake" | "sol-native-stake"yesWhich strategy to quote.
walletstringyesSolana wallet pubkey (base58).
amountstringyesAmount to unstake, decimal string.
stakeAccountstringconditionalRequired for sol-native-stake: the active stake account being settled. Not used for sol-liquid-stake.

Response — sol-liquid-stake

{
  "strategy":       "sol-liquid-stake",
  "inAsset":        "raSOL",
  "outAsset":       "SOL",
  "inAmount":       "1.5",
  "outAmount":      "1.7616",
  "priceImpactPct": 0.0048
}
FieldTypeDescription
inAssetstringAsset coming in (raSOL).
outAssetstringAsset going out (SOL).
inAmountstringEchoed input amount.
outAmountstringEstimated SOL out at current pool state.
priceImpactPctnumber | nullEstimated price impact as a fraction (0.0048 = 0.48%). null if the upstream router did not report one.

Response — sol-native-stake (instant)

{
  "strategy":       "sol-native-stake",
  "kind":           "instant",
  "inAsset":        "SOL",
  "outAsset":       "SOL",
  "inAmount":       "1.0",
  "outAmount":      "0.9952",
  "priceImpactPct": 0.0048
}
Same shape as liquid; the input “asset” is SOL because the active stake account is being settled to SOL via Sanctum’s depositStake. kind: "instant" indicates this is a Sanctum-routed instant unstake quote (the only kind that can be quoted; deactivate does not have liquidity-based pricing).

Errors

StatusSlugWhen
400invalid_requestMissing strategy / wallet / amount, or stakeAccount missing for sol-native-stake. Also returned for usdc-earn (no quote support).
404not_foundUnknown strategy key.
502upstream_errorSanctum’s quote router could not produce a number (no liquidity, wallet has no on-chain history, etc.).
503service_unavailableStrategy is announced but not live.

See also

POST /unstake

Build the actual unstake transaction.

GET /strategies/:key

Read the current exchange rate.