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.
AirSwap (https://airswap.io/) is an RFQ DEX.
Counter-party discovery and token pricing are communicated off-chain; atomic token swaps are settled on-chain. AirSwap itself is a technology provider and runs no infrastructure of its own. More info on our wiki.
Notes
AirSwap uses a smart contract (Registry) for server URL discovery.
AirSwap calls multiple third-party server URLs for pricing and orders.
Limitation: Tests cannot pass reliably on third-party servers, so:
isLocal
flag intoinitializePricing
process.env.NODE_ENV
istest
Flow
initializePricing
is called by the enginea. Registry starts up; hydrates; listens for event updates to track active server URLs
b. Worker starts up (if not a slave process); writes pricing from active servers URLs to cache.
getPoolIdentifiers
returns unique identifiers for active server URLs for a given token pair.getPricesVolume
pulls identifiers for a pair and reads the cache for pricing.preProcessTransaction
calls get*SideOrder on winning server.getSimpleParam
encodes the function call for the SwapERC20 contract.Tests
For the initial review, simple tests are passing.
airswap-e2e.test.ts
,airswap-events.test.ts
,airswap-integration.test.ts
.