bitflow-zest-sbtc-leverage-cycle
Bitflow + Zest sBTC Leverage Cycle
What it does
bitflow-zest-sbtc-leverage-cycle coordinates one forward sBTC leverage cycle by composing three primitive skills:
- borrow STX against existing Zest sBTC collateral with
zest-borrow-asset-primitive, - swap borrowed STX to sBTC with
bitflow-swap-aggregator, - deposit the received sBTC back into Zest collateral with
zest-asset-deposit-primitive.
This is a controller, not a primitive. It must not rebuild the borrow, swap, or deposit transactions internally. It calls the primitive skill CLIs, parses their JSON results, saves progress after each confirmed leg, and refuses to continue when a required primitive is missing or returns a blocked/error result.
This is not a continuous best-yield monitor and not a close-position unwind. Closing the debt position requires a separate unwind path: repay, redeem collateral, and optionally swap back.
Why agents need it
Leveraged sBTC is a multi-leg operation. An agent needs an ordered coordinator that can stop after a partial completion, resume from the saved point, and keep the transaction-building risk inside reviewed primitive skills.