Promote SDK to beta status (0.5.14): swap RFQ defects fixed, error info surfaced#7
Merged
Conversation
- Introduced normalization of API quote responses to ensure consistent snake_case keys. - Added handling for envelope-layer failures in the quote API response. - Updated tests to cover new transformation logic and ensure existing keys are preserved. - Removed deprecated secure_quote handling and streamlined order data transformation.
…yment) The RFQ pairs fetch walks every connected chain on initialize_client. Chains without an RFQ deployment (e.g. Ethereum) returned 4xx and the catch-all warning logged 'rfq_pairs_fetch_failed' on every init, polluting logs. Distinguish HTTP status codes: 200 stores pairs, 4xx logs at debug (expected absence), 5xx and network errors keep the warning.
The previous fix only quieted 4xx; Dexalot's RFQ endpoint returns 500
('Couldn't fetch resources!') for chains without an RFQ deployment
(e.g. Ethereum/chainid=1), so the catch-all warning kept firing on
every initialize_client.
_fetch_rfq_pairs is best-effort at init time. Chains that fail just
stay out of self.rfq_pairs; any real trade attempt against an empty
pair surfaces a meaningful error from get_swap_pairs or
get_swap_firm_quote. The warning at init was pure noise.
Demote both the non-200 status branch and the catch-all exception
branch to debug. Avalanche-specific recovery at the end of
_fetch_rfq_pairs is unchanged.
execute_rfq_swap previously returned just 'Transaction reverted' on status=0 receipts, dropping the tx hash and block number — leaving callers no way to inspect the failure on-chain. The receipt-status check now includes the tx hash and block number in the failure message, and a new _extract_revert_reason helper replays the original transaction as eth_call against the failing block to surface the solidity revert string (e.g. RF-EXP-01 for an expired quote).
Update PyPI trove classifier from 'Development Status :: 3 - Alpha' to
'Development Status :: 4 - Beta', and reword the README disclaimer
('first public release ... in alpha testing' -> 'public release ... in
beta testing') to match.
Maturity evidence:
- CLOB surface: long-running Fuji testnet exposure across orders,
deposits/withdrawals, market data, and websocket subscriptions.
- Swap (RFQ) surface: end-to-end mainnet trades on this branch
(six successful AVAX/USDC swaps via execute_rfq_swap), seven defects
fixed at root (envelope unwrap, contract checksum, hex nonceAndMeta
coercion, native msg.value, RFQ chain routing, RFQ pairs noise,
reverted-tx info).
- 872 unit tests, 100% line coverage, mypy clean, no '# type: ignore'
or '# noqa'.
- Active production consumer (trade_bots) routes every Dexalot call
through this SDK, exercising swap, CLOB, balances, deposit/withdraw,
pairs, and candle data on real users.
The 'public interface may undergo breaking changes' caveat stays - we
remain pre-1.0 per SemVer.
Format-only follow-up for swap.py / test_swap.py touched in b1f6b51 (surface tx_hash, block, revert reason on failed swap). Local make format wasn't run after that change; CI's ruff format --check caught it on the PR. No semantic change.
oytunsan
approved these changes
May 9, 2026
cdincoglu
approved these changes
May 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This branch carries the 0.5.14 release: it hardens the swap (RFQ) path end-to-end after extensive mainnet testing through a bot consumer, quiets known-noisy init logs, surfaces meaningful error information on failed swaps, and promotes the SDK from alpha to beta maturity.
Beta Justification
core/swap.pyandcore/base.py, mypy clean, ruff clean, no# type: ignore/# noqa.The pre-1.0 SemVer caveat stays — `Please Note: The public interface may undergo breaking changes` remains in the README.
Changes (chronological)
Test plan
Upgrade notes