Creating a DCA Schedule
A DCA schedule defines how stablecoins are spent over time to buy rBTC.
Inputs
When creating a schedule, you provide:
tokendepositAmountpurchaseAmountpurchasePeriod(seconds)lendingProtocolIndex
Contract Validations
createDcaSchedule enforces:
depositAmount > 0purchaseAmount >= token minimum(custom token minimum if set, otherwise default minimum)purchaseAmount <= depositAmount / 2purchasePeriod >= minPurchasePeriod- per-user per-token schedule count below
maxSchedulesPerToken
Practical Defaults (from repo deployment constants)
These are project defaults used in deployment scripts and may change by owner actions:
- Default min purchase amount:
25tokens (18 decimals) - Default min purchase period:
1 day - Max schedules per token:
10
The frontend currently presents 1/2/4 week presets for UX.
What Happens On-Chain
- DcaManager validates params.
- The selected handler is resolved from
(token, lendingProtocolIndex)inOperationsAdmin. - Handler
depositTokenpulls stablecoin from your wallet. - Schedule is created with a generated
scheduleId.
Schedule ID
scheduleId is derived on creation from:
- user address
- token address
- block timestamp
- current per-token schedule count