GET /api/dca/quote
Fetches a DCA swap quote from AVNU. Returns the expected BTC amount for a given token input.Query Parameters
Sell token address (e.g., ETH, USDC, USDT, STRK)
Buy token address (always WBTC for DCA)
Human-readable amount of sell token (e.g., “100” for 100 USDC)
Response
Expected BTC amount (human-readable, 8 decimals)
USD value of BTC received
USD value of tokens sold
Price impact percentage (e.g., 0.5 for 0.5%)
Estimated gas fee in USD
Swap route taken (e.g., “Ekubo → AVNU”)
Example Request
Example Response
Token Addresses
Source:/home/daytona/workspace/source/src/app/api/dca/quote/route.ts:20
Supported tokens with decimals:
Implementation Details
The DCA quote endpoint:- Converts human-readable amount to raw smallest units based on token decimals
- Calls AVNU’s quote API with
getAvnuQuote() - Parses response and formats BTC amount to 8 decimals
- Returns formatted quote with price impact and route info
This is a read-only endpoint for display purposes. Actual DCA order creation happens on-chain via the DCA contract using the
useDcaOrders() hook.Smart DCA
The DCA contract supports Smart DCA using the Mayer Multiple indicator:- When BTC is below 0.8× its 200-day moving average → buy 1.5× normal amount
- When 0.8-1.0× → buy 1.25× normal amount
- When 1.0-1.5× → buy 1.0× normal amount (baseline)
- When 1.5-2.0× → buy 0.75× normal amount
- When above 2.0× → buy 0.5× normal amount