Configure the policy
Use a loaded Strategy Vaultvault, connection, and manager Keypair. Select orderbookAddress from Exponent markets and load its SY mint:
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 allowinginitializeYieldPosition 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 iswrapper. 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.
- Transaction builder
- Sync helpers
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:book and inspect book.getOffers() for the vault’s offer index. Pass that live index to cancellation:
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.