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 redeems part of the deployed position back into the reserve when idle assets run low.
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:
Redeem4626VaultHook, which calls redeem(shares), so the size is in yield-source share units, not asset units. Size off the position’s ys_<address>_shares:
size_expr that evaluates to 0 or less is dropped before it reaches OMS.
5. Deposit Strategy JSON
Replace the vault ID, yield-source address, hook address, and executor address before sending. These payloads passStrategyValidator (shape, identifier, and dry-run checks), but note the validator does not confirm that execution_name exists in the live hook registry or that size_expr units match the hook — verify both against Action Config.
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.
