Skip to content
Termbook
Use cases

Staking

Track stake, rewards and unstaking obligations through completion.

On this page

Return shape

Every account snapshot includes block, holdings and liabilities. Use actual venue data, with owners bound to the Credit Account. Optional public actions must be declared in the definition; a schema-supported capability does not mean every integration offers it.

PluginStates["staking"]
{
  block: context.block, holdings: [], liabilities: [],
  positions: [{
    position_id: "7", market_id: "MON-STAKING", owner: context.account,
    assets: [{ asset: native_mon, amount: 1_000_000_000_000_000_000n }],
    liability: 0n, recoverable_value: 900_000n,
    staked: 1_000_000_000_000_000_000n, rewards: 0n,
  }],
  requests: [],
}

Staked quantities use asset units; recoverable_value and liability use settlement valuation units. Account for slashing risk, withdrawal delays and admitted reward assets.

Capabilities

CapabilityParametersPurpose
stakemarket_id, amount_in, optional min_receipt_outStake assets with applicable receipt protection.
claim_rewardsposition_idClaim rewards.
request_unstakeposition_id, amountCreate an unstaking request.
complete_unstakerequest_idComplete a claimable request.
withdraw_to_credit_accountposition_id, amountWithdraw through an admitted account-controlled path.

Stake

stake
termbook.open({
  action: {
    "use_case": "staking",
    "capability": "stake",
    "params": {
      "market_id": "MON-STAKING",
      "amount_in": 1000000000000000000n,
      "min_receipt_out": 990000000000000000n
    }
  },
});

Exit requirements

Request unstaking once, wait for the claim time, complete the request and collect recoverable rewards. Recovery must function without the borrower and retain the request identity across retries.

Documentation
8 results

Let’s talk

Tell us what you have in mind.

Supply liquidity