Rebalance Flow
This is the canonical flow for an end-to-end rebalance.Step 1. Collect inputs
The solver consumes:- strategy definitions
- live snapshots
- risk policy
- manager config
- current NAV and current allocations
Step 2. Compute target weights
The solver applies the objective:score = expected_net_apy - risk_haircut - liquidity_haircut - fee_haircut - concentration_haircut - operational_haircut
Then it assigns target weights while respecting:
- reserve minimum
- per-protocol cap
- per-strategy cap
- exotic cap
- MarginFi canary cap
Step 3. Build execution steps
For every strategy delta, the adapter creates one or moreExecutionStep objects.
Examples:
Drift depositKamino request_withdrawPerena finalize_withdrawfrom a manifest
Step 4. Hash the plan
The solver emits:planHashtargetWeightsHashtxBundleHash
Step 5. Submit the rebalance plan on-chain
Ranger uses the vault program client to call:submit_rebalance_plan
Step 6. Execute protocol bundles
Ranger sends the generated bundles:- SDK-generated bundles for
DriftandKamino - manifest bundles for
MarginFiandPerenawhen available
Step 7. Finalize rebalance on-chain
Ranger calls:execute_rebalancerecord_execution_proof
Step 8. Inspect resulting state
Operators can use:vault-status.tsdoctor.ts- protocol-specific smoke tests