StarkFiStarkFi

DCA Tools

4 tools for Dollar-Cost Averaging — preview, create, list, and cancel recurring buy orders

Prerequisite: All DCA tools require an active authenticated session. Call get_auth_status first to verify.

1. dca_preview   →  Preview single cycle output
2. dca_create    →  Create recurring order
3. dca_list      →  Monitor active orders
4. dca_cancel    →  Cancel when done

dca_preview

Preview a single DCA cycle by estimating the swap output for one execution. Always call this before dca_create so the user can review the expected output per cycle.

ParamTypeRequiredDescription
sell_tokenstringYesToken to sell (e.g. USDC, ETH)
buy_tokenstringYesToken to buy (e.g. STRK, ETH)
amountstringYesAmount to sell per cycle (e.g. 10, 100)
providerstringNoDCA provider: avnu (default) or ekubo

This is a read-only tool — safe to call without user confirmation.


dca_create

Create a recurring DCA order that automatically swaps a fixed amount at regular intervals.

ParamTypeRequiredDescription
sell_tokenstringYesToken to sell (e.g. USDC, ETH)
buy_tokenstringYesToken to buy (e.g. STRK, ETH)
amountstringYesTotal amount to sell across all cycles
amount_per_cyclestringYesAmount sold per cycle (e.g. 10)
frequencystringNoISO 8601 duration (default: P1D). E.g. PT12H, P1W
providerstringNoDCA provider: avnu (default) or ekubo
simulatebooleanNoSet true to estimate fees without sending a transaction

Important: Always preview with dca_preview first and confirm the expected output per cycle with the user before calling this tool.

Frequency Examples

DurationMeaning
PT12HEvery 12 hours
P1DDaily (default)
P1WWeekly
P1MMonthly

dca_list

List the user's DCA orders with optional filtering by status and provider. Each order in the response includes both id (UUID) and orderAddress (on-chain contract address) — use either to cancel.

ParamTypeRequiredDescription
statusstringNoFilter by status: ACTIVE, CLOSED, or INDEXING
providerstringNoFilter by provider: avnu or ekubo
pagenumberNoPage number for pagination (default: 0)

This is a read-only tool — safe to call without user confirmation.


dca_cancel

Cancel an active DCA order. Use the order UUID or on-chain contract address from dca_list. At least one identifier is required.

ParamTypeRequiredDescription
order_idstringNo*DCA order UUID (the id field from dca_list)
order_addressstringNo*DCA order on-chain contract address (the orderAddress field from dca_list)
providerstringNoDCA provider: avnu or ekubo

*At least one of order_id or order_address is required.

Important: This is a transactional tool. Always confirm with the user before cancelling an order.


CLI equivalent: DCA Commands

Edit on GitHub

Last updated on

On this page