Repository navigation
fix(swap): execute RFQ swaps on tx.to / order.maker, not the deployments address - #11
Merged
Merged
Conversation
…nts address
Mainnet firm quotes are signed by one of several maker contracts (legacy
MainnetRFQ 1.2.8 plus DexalotRFQ 2.x instances, each with its own swap
signer) behind DexalotRouter, and the deployments endpoint only lists the
legacy MainnetRFQ and the router. Sending a quote from another maker to
the legacy address reverts with RF-IS-01 (invalid order signature).
execute_rfq_swap now:
- targets the quote's tx.to (the router) or order.maker, never the
deployments MainnetRFQ address;
- takes the router from the deployments endpoint (DexalotRouter, loaded
best-effort during initialize_client) with MainnetRFQ.trustedForwarder()
as on-chain fallback, reads the allowed makers from
DexalotRouter.getAllowedRFQs() (static-tier cache, failures degrade to
deployment-only and are not cached), and refuses quotes whose maker or
tx.to fall outside that set;
- cross-checks tx.data / tx.value against the simpleSwap call the SDK
encodes itself from an embedded ABI fragment;
- pre-checks the ERC20 allowance on order.maker and fails with an
actionable message; new approve_rfq_maker(quote) grants it;
- appends [target=, maker=, quote_id=, nonce_and_meta=, expiry=] to swap
errors and returns target/maker on success.
Also keys MainnetRFQ/DexalotRouter deployments by the connected chain's
chain_config name ("Fuji" on testnet) instead of always "Avalanche", so
_get_rfq_contract resolves on Fuji.
Dependencies: aiohttp>=3.14.3, cryptography>=50.0.0,<51, and transitive
floors for msgpack, pip and pymdown-extensions so pip-audit passes.
Bump version to 0.6.1.
ilkerulutas
approved these changes
Sep 19, 2026
jaimi-io
approved these changes
Sep 19, 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
simpleSwapon the quote'stx.to(DexalotRouter) ororder.maker, never on the deploymentsMainnetRFQaddress; mainnet firm quotes are signed by one of nine maker contracts behind the router, each with its own swap signer, so the old target reverted withRF-IS-01whenever another maker won the quote (TradeBots failures 2026-09-18).DexalotRouter, loaded best-effort ininitialize_client) withMainnetRFQ.trustedForwarder()as on-chain fallback; read the allowed makers fromDexalotRouter.getAllowedRFQs()(static-tier cache, failures degrade to deployment-only and are not cached) and refuse quotes whose maker ortx.tofall outside that set.tx.data/tx.valueagainst thesimpleSwapcall the SDK encodes itself from an embedded ABI fragment.order.maker(the maker pulls funds viatransferFrom) and fail with an actionable message; addapprove_rfq_maker(quote, amount_wei=None, wait_for_receipt=True).[target=, maker=, quote_id=, nonce_and_meta=, expiry=]to swap errors; returntargetandmakeron success.MainnetRFQ/DexalotRouterdeployments by the connected chain'schain_configname instead of always"Avalanche", so_get_rfq_contractresolves on Fuji (it never did before).aiohttp>=3.14.3,cryptography>=50.0.0,<51, and transitive floors for msgpack, pip and pymdown-extensions sopip-auditpasses; bump version to 0.6.1.Quality Gates
Behavioural changes
execute_rfq_swapnow makes up to two extraeth_calls per swap for ERC20 sells (allowance) and once per hour for target discovery, and refuses quotes it previously would have sent to the wrong contract.order.maker; approvals granted to the legacyMainnetRFQaddress do not carry over to other makers.