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 sender
. The 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 Indexer to signal their interest in trading.
Makers...
​Run a Server at a public URL and use it as their locator
value.
See code examples of these protocols at work in the Run a Server section.
Takers use the Indexer to find Servers and Delegates to interact with.
Servers implement the Quote and Order protocols.
Takers...
Call getIntents
on the Server Indexer using protocol 0x0000
and receives locators (URLs).
Call get*Order
on each HTTPS Server using JSON-RPC over HTTPS.
Call swap
on the Swap Contract with the order that it wishes to execute.
Delegates implement the Quote and Last Look protocols.
Takers...
Call getIntents
on the Delegate Indexer using protocol 0x0001
and receives contract addresses.
Call get*Quote
on each Delegate Contract.
Call 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.