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 isservices/shared/src/domain.ts.
Key types:
| Type | Purpose |
|---|---|
PolicyConstraints | Solver guardrails |
ManagerConfig | Off-chain execution settings |
StrategyDefinition | Registry entry for a strategy |
StrategySnapshot | Live or historical market data |
ExecutionStep | Adapter output consumed by Ranger |
RebalancePlan | Solver output |
ExecutionProof | Post-execution proof |
HistoricalPeriod | Backtest scenario input |
BacktestReport | Backtest 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