Skip to main content

Accounts and Types

On-chain account types

VaultState

Primary vault state, including:
  • authority
  • deposit mint
  • share mint
  • treasury
  • total shares
  • total deposited USDC
  • total portfolio value
  • liquid USDC
  • pending withdrawals

RiskPolicy

Static guardrails:
  • reserve minimum
  • strategy and protocol caps
  • exotic cap
  • MarginFi cap
  • cooldown and min rebalance delta

ManagerConfig

Execution authority and rebalance permissions.

StrategyState

Registered strategy definition and policy envelope.

AllocationState

Target/current weights and notionals for a strategy.

WithdrawalRequest

Asynchronous withdrawal bookkeeping.

RebalancePlanProof

Submitted and executed rebalance metadata.

Shared TypeScript domain types

The central shared file is services/shared/src/domain.ts. Key types:
TypePurpose
PolicyConstraintsSolver guardrails
ManagerConfigOff-chain execution settings
StrategyDefinitionRegistry entry for a strategy
StrategySnapshotLive or historical market data
ExecutionStepAdapter output consumed by Ranger
RebalancePlanSolver output
ExecutionProofPost-execution proof
HistoricalPeriodBacktest scenario input
BacktestReportBacktest output

Important cross-layer contract

The repo works because both sides agree on:
  • strategy IDs
  • plan hashes
  • target weight hashes
  • tx bundle hashes
  • instruction semantics
That contract is what lets the off-chain runtime remain flexible while the on-chain program stays simple.