The session state machine
close_session returns rent and aborts the flow.
What gets verified
Eachrecord_step* instruction takes the pre/post balances of the relevant token
accounts and asserts:
- Step 1: The user received at least the vault shares the vault promised.
- Step 2: PT and YT were minted 1:1 against the escrowed shares.
- Step 3: The AMM swap actually sold PT for underlying, and the implied annualized rate clears the user’s target.
Why a separate program?
- Client UX. The frontend can walk the user through three wallet prompts without needing to batch everything into one compute-limited tx.
- Safety. A naïve “send three txs in order” flow gives no on-chain proof that all three succeeded. The session account is that proof, any integrator can read it and know the user’s outcome.
- Auditability. Every intent emits
IntentCreated,IntentStep1Recorded,IntentStep2Recorded, andIntentFulfilledevents with the achieved rate.
Read next
intent-router reference
Accounts, instructions, rate formula.
Lock a fixed rate
End-to-end walkthrough with code.

