Skip to content

fix: retry DCA on stableshare lockdown#1368

Merged
dmoka merged 8 commits intomasterfrom
fix/dca-stableshares
Feb 25, 2026
Merged

fix: retry DCA on stableshare lockdown#1368
dmoka merged 8 commits intomasterfrom
fix/dca-stableshares

Conversation

@dmoka
Copy link
Copy Markdown
Contributor

@dmoka dmoka commented Feb 17, 2026

Description

When a DCA schedule has a route where asset_out is a stableshare (pool_id), the trade goes through stableswap's add_assets_liquidity which calls Currency::deposit(pool_id, ...) to mint shares.

If the stableshare is in circuit breaker lockdown, the issuance increase fuse returns DepositLimitExceededForWhitelistedAccount (because the router account is whitelisted and deposits can't be locked for it).

This error was not in RetryOnErrorForDca, so the DCA schedule was permanently terminated instead of retried. Since lockdowns are temporary, the DCA should retry with exponential backoff until the lockdown expires.

Fix

Add pallet_circuit_breaker::Error::<Runtime>::DepositLimitExceededForWhitelistedAccount to RetryOnErrorForDca in runtime/hydradx/src/assets.rs.

DCA with asset_out=stableshare gets terminated instead of retried when
the stableshare is in circuit breaker lockdown. The lockdown is temporary
so DCA should retry until it expires.
Add DepositLimitExceededForWhitelistedAccount to RetryOnErrorForDca so
DCA retries when a stableshare is in circuit breaker lockdown instead of
permanently terminating the schedule.
@github-actions
Copy link
Copy Markdown

Crate versions that have been updated:

  • runtime-integration-tests: v1.69.0 -> v1.69.1
  • hydradx-runtime: v395.0.0 -> v396.0.0

Runtime version has been increased.

When stableshare is in circuit breaker lockdown, DCA now retries instead
of terminating. Added integration test verifying successful trade after
lockdown is lifted.
@github-actions
Copy link
Copy Markdown

Quick benchmark at commit 59d9075 has been executed successfully.
View results

@dmoka dmoka merged commit da0cea9 into master Feb 25, 2026
10 checks passed
@dmoka dmoka deleted the fix/dca-stableshares branch February 25, 2026 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants