What You Are Building
A drift-trigger reserve pair:- A
DEPOSITstrategy fires whenvault_free_assetsis above 10% of vault TVL. - A
WITHDRAWALstrategy fires whenvault_free_assetsis below 5% of vault TVL. - The withdrawal half refills the reserve toward a 7.5% target.
EXPR rule each, no indicators.
1. Choose the Lane
Strategy actions group into lanes. The lane determines where the strategy appears in the canvas and how ordering works.
See Strategy Canvas for the UI model.
2. Pick the Action
Each strategy has oneaction_config.action. Use DEPOSIT for the inflow strategy and WITHDRAWAL for the outflow strategy.
The other action_config fields tell OMS how to execute:
See Action Config for the full field reference.
3. Write the Trigger
The trigger is arules tree. The simplest form is a single EXPR leaf that returns a boolean.
vault_free_assets is sourced live from chain as IERC20(asset).balanceOf(strategy) through the EVM RPC datafeed, so the trigger reflects the strategy contract’s actual idle balance. vault_tvl is derived from yield-source allocations on the subgraph cadence. Both are in the underlying asset’s base units.
See Strategy DSL for rule-tree syntax and variable notes.
4. Size the Action
action_config.size_expr is evaluated when the rule fires. It must return a positive number at runtime.
For the deposit half, deploy idle assets:
size_expr that evaluates to 0 or less is dropped before it reaches OMS.
5. Deposit Strategy JSON
These examples are adapted fromsuperman-strategy/testdata/cookbook/drift_rebalance_deposit.json and superman-strategy/testdata/cookbook/drift_rebalance_withdraw.json, which are validated against StrategyValidator in the strategy test suite. Replace the vault ID, yield-source address, hook address, and executor address before sending.
6. Withdrawal Strategy JSON
7. POST and Run
Each strategy is one create request:state: "CREATED".
Move each strategy to RUNNING when the vault has upkeep, merkle proof coverage, whitelisted yield sources, and OMS session-key readiness:
What to Watch
If creation, ticking, or execution fails, use Strategy Troubleshooting.
