TheDocumentation Index
Fetch the complete documentation index at: https://v2-docs.exponent.finance/llms.txt
Use this file to discover all available pages before exploring further.
getQuote function calculates a quote for a potential trade on the Exponent orderbook.
Usage
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
inAmount | number | Yes | Input amount in lamports |
direction | QuoteDirection | Yes | The direction of the trade |
unixNow | number | Yes | Current Unix timestamp from the onchain clock |
syExchangeRate | number | Yes | The SY exchange rate (e.g., 1.000009210084) |
priceApy | number | No | Price in APY percentage (e.g., 5.5 for 5.5%) |
QuoteDirection
TheQuoteDirection enum specifies the trade direction:
Getting the Unix Timestamp
Use the onchain clock for accurate timing. AvoidDate.now() as it may drift from the onchain clock:
Returns
Returns an object with:outAmount- Expected output amount in lamportsmakerFees- Total maker fees charged in lamportstakerFees- Total taker fees charged in lamports