Skip to main content
Deposits are one call, but they queue while settleable bets exist so new capital cannot skip a loss it did not underwrite. Exits are deliberately two steps, so capital that underwrote live bets stays exposed until those bets resolve.

Deposit

Flow
stake pulls USDG. If no settleable bets block the cutoff, shares mint immediately (Staked). Otherwise the USD sits in a per-staker queue (StakeQueued) and mints later:
  • the next settle that clears the cutoff force-mints ready queues, or
  • anyone can call activateStake(staker) once pendingStakeReady(staker) is true.
Queued USD never underwrites bets and does not raise availableBankroll. cancelPendingStake() returns it while the queue is still blocked. If public staking is disabled on the deployment, stake reverts StakingDisabled (deposits are operator-only); exits below still work for everyone. Deposits are also gated by maxBankrollUsd (underwriting capital + queued deposits).

Withdraw - two steps

1

Request a tranche

Call requestUnstake(principalAssets, earningsAssets) for a principal and/or earnings slice (at least one > 0), or requestUnstakeAll() for everything currently free. Each call opens a new tranche with its own requestId, timer, and epoch stamps - earlier tranches are untouched. For a single product “withdraw amount”, allocate earnings-first then principal so free earnings do not need a second request. Requested shares immediately stop underwriting new bets, but stay staked and loss-exposed until claim.
2

Wait for unlock

A tranche unlocks on the earliest of:
  • Settled watermark - settledThroughCommitId reaches the request epoch.
  • Clear scan - no settleable pre-request pending bets remain (refund-only leftovers do not block). This can unlock before the timer.
  • Cooldown timer - unstakeDelay elapses (default 1 hour) and the same clear-scan passes. Anyone can accelerate the watermark by draining leftover bets with settleBets. A truncated scan stays blocked until those epochs are drained.
3

Claim

Call claimStakerPrincipal(requestId, assets) for the principal leg (USDG) and/or claimStakerEarnings(requestId, assets, asChance, minChanceOut, affiliate) for the earnings leg. assets = 0 claims the whole remaining leg; partial claims leave the tranche active. cancelUnstakeRequest(requestId) aborts one tranche before claim.

Sizing and readiness

requestUnstakeAll() only covers what is free now. Earnings that accrue after the request need a new tranche - a request never expands mid-cooldown.