Skip to content

Controls and rules

Everything in this page is enforced by the Ohge Guard program; the dashboard only displays it.

Who can do what

ActionOwner walletSession key
Deposityesno
Set or update the policyyesno
Register / rotate / revoke a sessionyesno
Pause / resumeyesno
Withdraw (to the owner's own token account)yes, even while paused or trippedno
Re-base the high-water markyesno
Execute an allowed swapyesyes, while active and not revoked
Transfer to an arbitrary account, change the owner, extend expiry, close accounts, change token authorities, invoke other programsno instruction existsno instruction exists

The session key is not an SPL token delegate. The vault PDA is the only token authority, and the program is the only signer for it, so the single execution path is execute_orca_swap.

Policy fields

FieldMeaning
Allowed assetsList of SPL Token mints with decimals, per-trade cap, per-window cap, Pyth feed id and the pinned price-update account. Token-2022 mints are rejected by account type.
Allowed venuesOrca Whirlpool pool addresses the swap may use.
AdaptersBitmask; only bit 1 (Orca Whirlpool direct swap) exists in this build.
Spending windowLength in seconds (1 hour to 31 days). Windows are consecutive and anchored at the moment the policy was set. The counter resets only when a new window starts; buying and selling repeatedly never resets it, because each asset's own allowance counts the actual input consumed.
Max slippage vs referenceTolerated shortfall of the intent's minimum output below the reference-implied output, in basis points.
Require reference priceWhen on, both legs must carry fresh Pyth updates from the pinned accounts and min_out must be at least reference × (1 − slippage). When off, only the atomic minimum-output check applies; the UI shows this explicitly.
Max price age / max confidenceFreshness and confidence bounds for every reference read.
Drawdown circuit breakerThreshold in basis points below the high-water mark; 0 disables it.

Per-trade limits are amounts of the input asset. They are not portfolio allocation limits. Target allocation bands belong to the agent's strategy and are not enforced onchain.

Replay and staleness

Every intent carries the vault's next nonce and the current policy version, and an expiry at most 15 minutes ahead. A replayed intent, an intent produced under an earlier policy, or an expired intent fails.

Reference price and slippage

The reference is a Pyth PriceUpdateV2 account (sponsored feed) whose address is pinned in the policy per asset; the program also checks the feed id, the full verification level, publish-time freshness and the confidence interval. Slippage tolerance (how far the minimum output may sit below the reference) is different from price impact (how much the pool moves for the trade size); the preview shows both.

Drawdown circuit breaker

  • Valuation currency: USD, in micro-USD, from the pinned reference prices for every policy asset.
  • High-water mark: set by an explicit owner re-base to current equity, and raised by any executed trade that ends above it. It never falls on its own.
  • Deposits and withdrawals mark the mark stale (the equity basis changed). Policy changes mark it stale only when the valuation basis (assets, decimals, price sources) changes or when the breaker was previously off. While stale, trading that depends on the breaker fails closed until the owner re-bases.
  • Checks run before and after every execution. A trade that would breach the floor is rejected atomically; because a rejected transaction persists nothing, the worker then calls the permissionless trip_breaker, which re-checks with fresh prices and records the trip. A tripped breaker blocks further eligible trading until the owner re-bases.
  • The breaker stops further eligible trading once the condition is detected. It does not guarantee an exact maximum market loss and cannot reverse finalized trades.
  • Owner withdrawals remain available while tripped.

Pause and revoke

A confirmed pause or revocation prevents every later execution. It cannot reverse trades that were already finalized.