User flows

What happens when you create, fund, run, pause, top up, or close a DCA strategy.

The short version

A strategy is your personal on-chain account. You choose an asset, an amount, a schedule, and whether idle USDC should earn Aave yield. The account belongs to the wallet that creates it, and buys are delivered there. The settings are locked when the account is created. You then fund that account with USDC. Automation later triggers scheduled buys, but only you can withdraw your remaining USDC or claim pending output.

Before you start

You need USDC on the network the app is pointed at, and a connected wallet.

DCA Onchain is live on Base mainnet, where you can accumulate WETH and cbBTC. See Deployed contracts for the deployed addresses and canary evidence.

The protocol enforces a minimum amount per execution and a minimum first deposit. The default per-execution minimum is 5 USDC. The first deposit must fund several future executions so a new strategy is not immediately underfunded:

FrequencyMinimum executions in first depositExample with 25 USDC per execution
Daily12300 USDC
Weekly10250 USDC
Biweekly8200 USDC
Monthly6150 USDC

Create a strategy

Creating a strategy is the main onboarding flow. In the current frontend, you sign three transactions:

  1. Create strategy. The factory deploys a cheap clone of UserStrategyAccount and stores your fixed settings in it.
  2. Approve USDC. You allow the new strategy account, not the factory, to pull the first deposit amount from your wallet.
  3. Deposit USDC. The strategy account pulls your USDC and becomes active.
1. User chooses settings.
2. DCAFactory creates a UserStrategyAccount.
3. User approves USDC to that account.
4. User deposits the minimum first balance.
5. The account registers as active and waits for its next schedule window.

The factory creates the account, but the USDC deposit goes to the user's account contract. The factory does not custody user funds.

What becomes permanent

After creation, the strategy's owner, target asset, amount per execution, frequency, yield setting, and yield adapter cannot be changed. This is deliberate. It prevents an admin, executor, or later UI bug from silently changing what you signed up for.

The owner in particular is taken from the wallet that sent the creation transaction rather than from the transaction's data, so the account always belongs to the wallet that created it.

If you want different settings, withdraw and create a new strategy. Withdrawal closes the old one permanently.

Deposit more USDC

You can top up an active strategy from the dashboard. A top-up is two transactions: approve USDC to the strategy account, then deposit. Depositing more USDC does not change the schedule, asset, or per-execution amount.

If the strategy was manually paused, a deposit does not auto-resume it. You must explicitly press resume. This avoids a top-up unexpectedly reactivating a strategy you meant to keep paused.

What happens on execution day

Execution is automated off-chain and validated on-chain. The executor does not hold special custody over your account. It can only ask the BatchExecutor to run a scheduled buy.

  1. The executor asks the factory which accounts are both due for the current window and able to fund an execution.
  2. It groups those accounts by target asset. WETH buyers are batched with WETH buyers; cbBTC buyers are batched with cbBTC buyers.
  3. It reads the live swap route and gets a Uniswap V3 QuoterV2 quote for the pooled USDC amount.
  4. It submits executeBatch with the accounts, amounts, target asset, quoted minimum output, and a unique nonce. It submits no batch total: the contract derives that from what it actually collects.
  5. Each account independently checks that it is due, that the amount equals its exact per-execution amount, and that the batch target asset matches its own target.
  6. The BatchExecutor pulls USDC only from accounts that pass those checks.
  7. The execution fee is computed on the USDC collected and set aside, so only the net amount is swapped.
  8. The on-chain oracle computes an independent minimum output for that net amount. The swap must satisfy the stricter of the executor quote and the oracle floor.
  9. The pooled swap runs through the SwapRouter and configured adapter.
  10. The entire output is split pro-rata and each account forwards its share to its owner. The fee goes to the treasury in USDC.
ExampleIf 10 weekly WETH strategies are due and each contributes 25 USDC, the executor submits one 250 USDC WETH batch. The protocol takes 0.375 USDC as its fee and swaps 249.625 USDC. If your account contributed 25 USDC, you receive roughly 10% of the WETH bought, adjusted only for integer rounding. Rounding dust goes to the last account in the batch so nothing is stranded in the BatchExecutor. You never receive less WETH than your share of the swap, because the fee was already taken in USDC.

What you receive

The account tries to forward purchased assets directly to your wallet. If that transfer fails, the tokens are not lost. They remain in your strategy account under pendingWithdrawals, and the dashboard shows a claim action.

This fallback covers a token that reverts or returns false on delivery, for example a temporarily paused token or one that restricts your address. Retrying always sends to the same owner, so it cannot work around a permanent token-level restriction on that address.

Pause and resume

You can pause your own strategy. Pausing removes it from the active registry, so the executor should no longer include it in future batches. Your funds stay in the account, and you can withdraw at any time.

Resuming re-registers the strategy and anchors the next execution to the next schedule window. It does not run an immediate catch-up buy for missed windows.

Withdraw and close

Withdraw is a full exit. It pulls back any idle USDC, withdraws any Aave position if yield is enabled, pays the yield fee only on positive Aave yield, sends the remaining USDC to the strategy owner, removes the account from the registry, and marks the strategy closed.

A closed strategy cannot be reactivated or redeposited into. This avoids stale or paused strategies reappearing in automation.

Common edge cases

SituationWhat happens
Your account has too little USDC for the next buyThe account returns 0, auto-pauses, and is removed from the active registry. You can withdraw or top up and resume.
Aave withdrawal fails during a batchThe account is skipped for that window without auto-pausing. A yield-failure event is emitted so operators can monitor it.
The executor submits you too earlyYour account reverts with TooEarly, and the batch skips or fails according to the execution path.
The executor includes you in the wrong asset batchThe batch reverts. Your account checks that the batch asset equals your own target asset.
The quote failsThe off-chain executor skips that batch instead of submitting an unprotected minimum output.
The oracle is stale or unsupportedThe on-chain batch reverts. No swap happens.
The protocol is pausedNew strategy creation or batch execution may stop, depending on what was paused. User withdrawal remains available.

Related topics