For the complete documentation index, see llms.txt. This page is also available as Markdown.

Open Dca Order

Core Workflow

Opening a DCA order requires two steps:

  1. Fetch a signed quote from the Cetus DCA Quote API. The response provides fee_rate, per_cycle_in_amount_limit, timestamp, and signature, which the on-chain contract validates before accepting the order.

  2. Build and submit the open-order transaction via sdk.Dca.dcaOpenOrderPayload().

User wallet ──► Quote API ──► signed quote ──► dcaOpenOrderPayload ──► Sui transaction

Quote API (Signature)

Before calling dcaOpenOrderPayload, request a quote from the Cetus backend. The server signs order constraints (input coin, cycle frequency, cycle count, and per-cycle input cap). The contract rejects orders with invalid or expired signatures.

Endpoint

GET https://api-sui.cetus.zone/dca/quote

Query parameters

Parameter
Type
Required
Description

in_coin

string

Yes

Full Move type of the input (pay) coin, e.g. 0x2::sui::SUI or normalized long-form address

freq

number

Yes

Cycle interval in seconds (must meet on-chain min_cycle_frequency; see Global Config)

count

number

Yes

Total number of execution cycles (must meet on-chain min_cycle_count)

sender

string

Yes

Sui address of the order creator (same as sdk.setSenderAddress)

Example request

https://api-sui.cetus.zone/dca/quote?in_coin=0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC&freq=3600&count=2&sender=0xc5cea39da987d8fe16bf0c6db51bfbf4897aef0edf9588e035ae175ac416fdd1

Example response

Response field mapping

Quote API field (data)

dcaOpenOrderPayload param

Description

fee_rate

fee_rate

Protocol fee rate for the order

amount_in_limit_per_cycle

per_cycle_in_amount_limit

Maximum input amount allowed per cycle (base units)

timestamp

timestamp

Quote expiry timestamp (Unix seconds); must be used before it expires

signature

signature

Backend signature authorizing the quote parameters

Fetch quote in TypeScript

Note: Quotes are time-bound. Fetch a fresh quote immediately before building the transaction. Reusing an expired timestamp or signature will cause the on-chain call to fail.

Open DCA Order

Parameter overview

Parameter
Type
Description

in_coin_type

string

Input coin Move type (coin deposited into the DCA order)

out_coin_type

string

Output coin Move type (coin received each cycle via swap)

in_coin_amount

string

Total input amount to deposit, in base units (integer string)

cycle_frequency

number

Seconds between each swap execution

cycle_count

number

Number of cycles; in_coin_amount is split evenly across cycles

per_cycle_min_out_amount

string

Minimum acceptable output per cycle (base units); swap reverts if output is below this

per_cycle_max_out_amount

string

Maximum acceptable output per cycle (base units); used as slippage upper bound

per_cycle_in_amount_limit

string

From quote API amount_in_limit_per_cycle; caps input spent per cycle

fee_rate

number

From quote API

timestamp

number

From quote API

signature

string

From quote API

Slippage bounds (per_cycle_min/max_out_amount)

These define the acceptable swap output range per cycle. A common approach:

  1. Compute human-readable input per cycle: in_coin_amount / 10^inDecimals / cycle_count

  2. Derive expected output using price bounds:

    • per_cycle_max_out_amount β‰ˆ cycleInput / minPrice Γ— 10^outDecimals (best case)

    • per_cycle_min_out_amount β‰ˆ cycleInput / maxPrice Γ— 10^outDecimals (worst case)

Full example

Last updated