Skip to main content
Place offers, trade PT and YT, and withdraw the vault’s settled order book balances.

Configure the policy

Use a loaded Strategy Vault vault, connection, and manager Keypair. Select orderbookAddress from Exponent markets and load its SY mint:
Install it using Configure policies. This allows posting offers, taking a wrapper buy-PT order, cancellation, and withdrawal for that SY mint. The SY filter can cover multiple books and maturities; it is not an order book address restriction. An empty allowedSyMints list leaves that scope unrestricted. The policy’s direction permissions do not choose the order’s APY or amount.

Prepare the order book accounts

Configure price references for SY, PT, and the yield position used by YT operations. The builder prepares supported token accounts, order book tracking, and yield-position setup for posting/taking offers. Any generated Core initialization also needs an installed Core policy allowing initializeYieldPosition for the book’s Core vault. For manual preparation, register the book with AddOrderbookEntry, its PT/SY prices, and the associated yield position through vault settings. Track the vault-owned SY/PT/YT accounts, refresh AUM, and reload before the sync example. Cancellation and settled withdrawals assume the book and accounts already exist.

Place offers and manage balances

The default action mode is wrapper. This example takes a buy-PT order; 0.10 is 10% APY. Choose the APY boundary and output floor from the order book quote for the trade direction.
build() returns an execution plan: ordered transactionSets containing instructions, additional signers, and lookup table addresses. The builder schedules supported setup and refreshes; send() simulates and submits the sequence.

Post and cancel offers

Posting a limit order uses the same execution paths:
After posting confirms, reload book and inspect book.getOffers() for the vault’s offer index. Pass that live index to cancellation:
Cancel an unfilled offer before withdrawing its locked funds. A null withdrawal amount selects the maximum available balance for that token. Read balances after earlier transactions confirm. Directions are BUY_PT, SELL_PT, BUY_YT, and SELL_YT. Amounts use the relevant input/output token’s smallest units. Add the matching directional permission before changing the market-order example. To use mode: "raw" for posting or taking, also grant the corresponding raw permission and prepare its underlying accounts explicitly.