Skip to content

Support custom timeouts for txn confirmation#3

Draft
dizpers wants to merge 5 commits intodecibeltrade:mainfrom
dizpers:feat/custom-timeout-support
Draft

Support custom timeouts for txn confirmation#3
dizpers wants to merge 5 commits intodecibeltrade:mainfrom
dizpers:feat/custom-timeout-support

Conversation

@dizpers
Copy link
Copy Markdown
Contributor

@dizpers dizpers commented Apr 1, 2026

Summary

This PR is based on the changes made in #2. The whole idea is to add configurable timeout for both transaction submission and confirmation.

Changes

  • Separate configurable timeout for txn submission and txn confirmation
  • A way to specify timeout in order placement (and other functions)
  • Default values for txn submission timeout and txn confirmation timeouts
  • Custom exception for txn submission failure and txn confirmation failure

Context

Some of the operations (e.g. orders cancellation) is taking more than default 30 seconds to confirm the transaction. So the custom software (e.g. Hummingbot connector) needs a way to explicitly set the timeout for those operations, set a bigger value.

E.g. order cancellation on testnet is taking up to 90 seconds, while default timeout was just 30 seconds. So it's possible that we (1) send a txn and it succeeds in 90 seconds (2) but timeout is 30 seconds (3) a trading bot see timeout error and retry cancellation for an order which is already cancelled.

Custom exceptions are needed for the client software can understand if a txn was submitted or not. To perform re-try logic.

Usage Example

    # Use default timeouts (10s submit, 30s confirm)
    await dex.place_order(...)
    await dex.cancel_order(...)

    # Use custom confirmation timeout for slow networks
    await dex.place_order(..., txn_confirm_timeout=60.0)
    await dex.cancel_order(..., txn_confirm_timeout=90.0)

    # Sync usage
    dex_sync.place_order(..., txn_confirm_timeout=45.0)

Testing

Tested on testnet and mainnet

@dizpers dizpers force-pushed the feat/custom-timeout-support branch from 4de3842 to 6f016b9 Compare April 1, 2026 16:19
@dizpers dizpers force-pushed the feat/custom-timeout-support branch from 6f016b9 to 02cf0b0 Compare April 1, 2026 16:43
@dizpers dizpers marked this pull request as draft April 3, 2026 12:20
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.

1 participant