AirSwap works with a combination of web protocols and smart contracts. There are two kinds of liquidity providers in the system, those that run their own HTTP servers to provide liquidity and those that manage onchain delegates that make trades on their behalf.
Each swap is between at least two parties, a
signer and a
signer is the party that creates and cryptographically signs an order, and
sender is the party that sends the order to the Ethereum blockchain for settlement.
Makers run Servers or deploy Delegates and use the Registry to signal their interest in trading.
Run a Server at a public URL and use it as their
See code examples of these protocols at work in the Run a Server section.
For each side of a pair (e.g. WETH/USDT) call
getURLsForToken on the Server Registry and receives a list of URLs of servers supporting each token and intersects the lists.
get*Order on each HTTPS Server using JSON-RPC over HTTPS.
swap on the Swap Contract with the order that it wishes to execute.
getIntents on the Delegate Indexer using protocol
0x0001 and receives contract addresses.
get*Quote on each Delegate Contract.
provideOrder on the selected Delegate Contract that performs the Swap.
See code examples of these protocols at work in the Run an Aggregator section.
Authorizations are for parties that trade on behalf of others. These parties are authorized by an individual to send or sign orders for them. Parties can be wallets (people or programs) or smart contracts.
Affiliates are third-parties compensated for their part in bringing together the two parties of a trade and can be other traders or software applications that connect traders on the network.