Airswap trading protocols, expiring orders, and staking
UpdatedAirswap is a peer-to-peer trading network that combines off-chain quotes with non-custodial atomic token settlement. Traders keep their tokens in their wallets until settlement. An atomic swap completes both sides of an exchange together or reverses the transaction. Its trading paths include request-for-quote (RFQ) orders, streamed LastLook pricing, and manually arranged over-the-counter trades. Signed orders define the exchange terms and their expiry. Separate staking and reward contracts support community participation, while developer tools connect applications and market makers to the trading network.
The roles behind a peer-to-peer quote
Market makers provide prices, clients request or receive them, and smart contracts settle valid orders on a compatible blockchain. The protocol distinguishes the signer, who authorizes an order, from the sender, who submits it for settlement. Those roles change between trading methods. A market maker signs an RFQ order, while a client signs a LastLook order. Signing authorizes the terms; token transfers occur only when the settlement transaction executes successfully.
The Registry helps applications discover servers and their supported tokens and protocols. It publishes availability information without supplying prices. A server listing therefore identifies a potential trading connection; the maker must still provide a quote for the requested trade. The selected token pair, network, and protocol determine whether that connection can serve the request.
RFQ and LastLook pricing
Maker-signed RFQ orders
RFQ trading starts with a client asking a maker for a signed token order. The client can assess that order and decide whether to submit it on-chain. ERC-20 requests can specify the amount being sold or the amount being bought. They also identify the token contracts, wallet, network, and settlement contract.
A signed order establishes executable terms subject to its validity conditions. Indicative pricing alone does not carry the same authorization as a signed order.
Client-signed LastLook orders
LastLook streams pricing through a WebSocket connection, allowing clients to receive updates without repeatedly requesting individual quotes. The client signs an order based on that pricing and sends it to the maker. The maker then decides whether to submit the order for settlement. This reverses the signing and submission roles used in RFQ. Streaming prices do not commit the maker to settle every order that a client sends.
OTC agreements and on-chain trading rules
Manually negotiated OTC terms
Over-the-counter, or OTC, trading lets known counterparties agree on prices through direct communication and use the protocol for settlement. Negotiation can happen through messaging or email, outside an automated quoting connection. The settlement contract still enforces the signed exchange terms. An OTC agreement needs compatible tokens and an executable order to settle.
Rules handled by Delegate
Delegate supports on-chain trading rules for wallets that want orders to execute against stated price criteria. A rule specifies the token pair, amounts, and expiry. The rule-setting wallet must authorize Delegate to spend the relevant token. Qualifying counterparties provide signed orders, and Delegate uses the SwapERC20 settlement path called
swapLight
. That method expects known token contracts. The rule-setting wallet can update or remove its rules. Execution remains subject to the rule, its expiry, and the required spending permission.
When does a signed order stop working?
Expiry at execution
SwapERC20 rejects an order when the executing block's timestamp reaches or exceeds the order's expiry. The expiry is an absolute timestamp, not a promise that submission will finish within a particular duration. An order can expire between signing and execution.
The ERC-20 RFQ methods accept an optional minimum-expiry requirement when a client requests an order. The returned signed order still contains the timestamp that governs execution. Network inclusion affects whether settlement occurs before that deadline.
Used and cancelled nonces
A successful SwapERC20 swap consumes its nonce for the signing address. Nonces can execute out of numerical order.
Cancellation also marks selected nonces as used. The contract tracks that state for the signing address in that contract on that network. If a wallet authorizes another address to sign, that authorized address's nonce state applies to its orders. Expiry and cancellation are separate ways that a signed order becomes unusable.
Balances and permissions at settlement
Remaining time does not establish that a trade can execute. The required token balances and spending permissions must support the transfers. An invalid signature also prevents settlement. These conditions can change independently of the expiry, so a quote that remains within its time window can still fail.
Does an atomic swap protect every part of a trade?
An atomic swap protects the exchange of tokens by requiring both sides to succeed within the same transaction. A required transfer failure reverses the transaction's token transfers. Atomicity does not establish a token's value or make unfavorable signed terms acceptable. For ERC-20 trading, token approval separately permits the selected contract to spend tokens; signing an order does not replace that permission. The contract address and approved amount therefore affect the authority that a wallet grants before settlement.
Network gas and contract-specific fees
Transaction gas pays for blockchain execution, while a protocol fee belongs to the swap's settlement rules. In RFQ, the client normally submits the transaction. LastLook lets the maker submit it, making that settlement effectively gasless for the client. A separate token approval can still require a transaction. On Ethereum, a failed transaction also charges for the gas that it consumes.
For the standard SwapERC20 path, any protocol fee is an additional payment from the signer in the signer's token. The fee uses the signer's trade amount as its base, with a configurable rate expressed in basis points. The signature incorporates that rate. When LastLook uses this path, the client is the fee-paying signer.
The general Swap contract takes any protocol fee as an additional payment from the sender in the sender's token, based on the sender's trade amount. That path can also include an affiliate payment or a supported royalty for a non-fungible token (NFT). Gasless submission does not remove those separate payment conditions.
AST staking and community decisions
Staking the Airswap Token (AST) supports governance and other community benefits through the project's decentralized autonomous organization, or DAO. Airswap Improvement Proposals provide a process for discussing and voting on changes. Contributors decide whether to prioritize and implement an approved proposal based on requirements and feasibility. Staking also has its own withdrawal conditions, separate from a trade's expiry. The Staking contract tracks a stake's balance and withdrawal availability, while reward claims depend on the applicable distribution and pool state.
Token formats and contract components
Fungible-token trading, NFT settlement, and community participation use contracts with different responsibilities. SwapERC20 handles ERC-20 exchanges. The general Swap contract uses adapters for token formats, including ERC-721 and ERC-1155 where configured. Its installed adapters and required sender-token type limit the exchanges that a deployment accepts.
| Contract component | Asset or operating scope |
|---|---|
| SwapERC20 | Atomic exchange of ERC-20 tokens. |
| Swap | Token formats supported by its installed adapters and sender-token requirements. |
| Wrapper | Native-token wrapping for compatible swap integrations. |
| Registry | Maker-server discovery by supported tokens and protocols. |
| Staking | Configured staking token, stake balances, and withdrawal availability. |
| Pool | ERC-20 rewards subject to valid distribution claims. |
| Deployment choice | Match the network and deployed contract version to the application. |
An NFT order also identifies the individual token through its token identifier. A shared collection name or ticker cannot substitute for the contract and identifier. The Wrapper covers native-token handling where an application integrates that path; ERC-20 support alone does not establish native-asset handling.
Applications, developer tools, and deployment scope
The application layer includes Airswap DEX for trading, Airswap DAO for members, and Airswap CLI for command-line access. Libraries and utility packages help developers build around the contracts and network protocols. The command-line tools cover tasks such as requesting orders, receiving pricing streams, and managing maker-server registrations.
At the integration boundary, peers advertise their protocols together with the chain, swap-contract address, and wallet configuration. Token discovery returns contract addresses. A compatible blockchain alone does not establish that a particular maker supports the desired pair or settlement method. Applications need agreement on those details before treating a quote as suitable for execution.
RFQ can use HTTP or WebSocket; LastLook uses WebSocket. A server can support both protocols, so applications read its advertised capabilities.
Helpful answers about Airswap
-
Do I need AST to make a standard token swap?
- AST is not a mandatory third token for a standard SwapERC20 exchange. That contract moves the quoted tokens and takes any protocol fee in the signer's token. AST supports community participation, including governance staking. A maker's registry staking requirements are separate from an ordinary trader's settlement requirements.
-
Can a signed SwapERC20 order be filled in smaller portions?
- The standard SwapERC20 swap settles the signed token amounts in full. Its function has no separate partial-fill amount, and successful settlement consumes the order's nonce for its signing address. Because the signature covers both token amounts, a smaller exchange needs a newly signed order for those amounts.
-
Does an RFQ quote reserve the maker's tokens on-chain?
- Receiving an RFQ quote does not create an on-chain reservation of the maker's tokens. The signature authorizes specific terms while the assets remain in the maker's wallet. Settlement still requires sufficient tokens and allowance when the contract executes. A maker can manage its own inventory, so the signed quote alone does not establish that those tokens will remain available.
-
Is a registered account required to trade at the protocol level?
- The trading protocol does not require a separate registered user account. Orders identify wallets and token contracts, and settlement uses the necessary signatures and transfer permissions. This differs from the Registry, where makers publish their server information. A particular interface can apply its own access conditions, so the protocol's account model does not establish every application's sign-in or data-handling practices.
-
How does the rewards pool determine a claim's withdrawal amount?
- The Pool contract calculates a withdrawal from the claim value, configured parameters, and balance of the selected reward token. The claim must match an enabled distribution and remain unused for that account and distribution tree. Withdrawal also requires a valid proof and must satisfy the submitted minimum amount. A stake balance alone does not specify the reward that a wallet can withdraw.
-
What prevents an NFT royalty from exceeding a settlement limit?
- The Swap contract accepts a maximum royalty amount denominated in the sender's token. For a signer-side token that supports EIP-2981, a reported positive royalty above that maximum causes the swap to revert. When a permitted royalty applies, the sender pays it in addition to the trade amount. The royalty calculation receives the sender's trade amount as its sale-value input.