ixWrapperMarketOffer instruction executes a market order on the Exponent orderbook.
Usage
Required Parameters
| Parameter | Type | Description |
|---|---|---|
trader | PublicKey | The trader’s wallet public key |
maxPriceApy | number | Maximum price in APY terms |
amount | bigint | The amount to trade |
offerType | OfferType | The type of offer (OfferType.BuyYt / OfferType.SellYt) |
minAmountOut | bigint | Minimum amount to receive (slippage protection) |
virtualOffer | boolean | Whether this is a virtual offer |
mintSy | PublicKey | The SY token mint address |
Optional Parameters
| Parameter | Type | Description |
|---|---|---|
ptSrc | PublicKey | PT token source account |
ytSrc | PublicKey | YT token source account |
sySrc | PublicKey | SY token source account |
tokenBaseTrader | PublicKey | Base token account for the trader |
Returns
Returns an object with:ix- TheTransactionInstructionthat executes the market ordersetupIxs- An array of setup instructions to run beforeix:setupIxs[0]- Creates the PT associated token account for the trader (if it doesn’t exist)setupIxs[1]- Creates the YT associated token account for the trader (if it doesn’t exist)setupIxs[2]- Creates the SY associated token account for the trader (if it doesn’t exist)