Dollar-Cost Averaging (DCA)
DCA lets depositors set up recurring deposits into a vault on a fixed schedule. Instead of depositing a lump sum, the depositor spreads their investment over time.
How It Works
-
Depositor creates a DCA schedule specifying:
amount_per_period: how much to deposit each timeinterval: time between deposits (minimum 1 day / 86,400 seconds)max_executions: total number of deposits to make
-
Depositor funds their escrow with enough USDC to cover the full schedule (or top up over time). This is the same escrow account used for regular deposits.
-
Keeper executes on schedule. When
next_executiontimestamp is reached and the escrow has sufficient funds, the keeper callsexecute_dca. This performs the same deposit flow asprocess_deposit_vault— oracle-priced share minting, reserve tracking, points accrual — but only pullsamount_per_periodinstead of the full escrow balance. -
Schedule completes or is cancelled. After
max_executionsis reached, the schedule deactivates automatically. The depositor can also cancel at any time, which closes the schedule account and returns rent. Remaining escrow funds stay in the escrow for the depositor to withdraw or use for other deposits.
DCA vs Regular Deposit
| Aspect | Regular Deposit | DCA |
|---|---|---|
| Trigger | Keeper processes full escrow | Keeper processes amount_per_period |
| Timing | One-shot | Recurring on schedule |
| Share pricing | NAV at time of processing | NAV at each execution (dollar-cost averaged) |
| Points | Accrued once | Accrued on each execution |
| Escrow | Same account | Same account |
Managing DCA Schedules
- Update: change
amount_per_periodorintervalon an active schedule - Cancel: deactivate and close the schedule account (rent returned to owner)
- Multiple DCA schedules can exist per depositor per vault (distinguished by
schedule_id)
Future: Yield-Bearing Escrow
Currently, DCA funds sit idle in the escrow. A planned enhancement will deposit escrow funds into a yield-bearing reserve (e.g., USDC-Kamino) so they earn yield while waiting for execution. On each DCA tick, the keeper would withdraw amount_per_period from the yield reserve instead. The vault-side deposit logic stays identical.