Spread-aware DCA
A DCA order escrows its budget in PoincareDCA and swaps it in slices, one per interval. The Poincaré part is the protection: whether a slice may pay the trend spread.
How a slice fills
A keeper submits each slice; the contract re-checks the order's rules in the same transaction, quotes with the Lens and swaps through the canonical v4 router, and the output goes straight to the order's recipient. A keeper can only fill a slice the rules allow, and the owner can always fill their own.
Protections
| Preset | maxSpreadBps | pauseOnTrend | Behaviour |
|---|---|---|---|
| Spread guard (default) | 0 | false | Never pays the spread: a slice that would pay it waits, and later slices catch up |
| Trend pause | 0 | true | Also waits while a trend runs with the order's side, before any spread is charged |
| Always fill | 10000 | false | Fills every slot whatever the spread, like a plain exchange DCA |
Schedule and catch-up
Slot n opens at startTime + n × interval. Only slots that open strictly before the deadline count, and the default deadline (start + slices × interval) gives the last slice a full interval. With catchUp (on by default), later slices grow to spread what is left over the slots left, so an order that waited out a trend still finishes on time.
Price protection
limitPrice: the most a buy pays, the least a sell accepts (USDC per WETH). A slice below it is held.maxSlippageBps: the router's floor against the quote taken in the same transaction (default 50).