Adding to the Indexer

Indexer will be deprecated in favor of Registry in the near future.

Ensure the AirSwap CLI is installed.

$ yarn global add airswap

Once your Server is up and running at a public URL, you're ready to add it to the Indexer. First, ensure an account is set with the airswap account:import command. You can but are not required to use the same Ethereum account that your Server is using.

Let's take a look at the available Indexer commands.

$ airswap indexer
AirSwap CLI 1.3.8 —
get, set, and unset intents on the indexer
$ airswap indexer:COMMAND
indexer:enable enable staking on the indexer
indexer:get get intents from the indexer
indexer:new create an index for a new token pair
indexer:set set an intent
indexer:unset unset an intent

First run the following command to enable staking for your account.

$ airswap indexer:enable

Now run the following command to set your intent to trade.

$ airswap indexer:set




buy or sell

buy or sell

Whether you intend to buy or sell a token.



Token you intend to buy or sell.



Base token to buy or sell for.



URL of your Server where https:// is implied.



Number of AirSwap Tokens to stake.

To ensure your intent was correctly set, you can query the opposite side of your intent on the indexer. For example, if you set an intent to sell DAI for WETH, you would query to buy DAI for WETH with the indexer:get command.

$ airswap indexer:get
AirSwap CLI 1.3.8 —
get intents from the indexer RINKEBY
Indexer 0x10F6702447414cE1250Af5f7000D7c9A0f04E824
buy or sell: buy
token: dai
for: weth
Top peers selling DAI for WETH (HTTPS)
Staked Locator
------ ------------------------------

Now that your Server is running and has been added to the Indexer, your quotes will be returned among results of the airswap quote:best command and aggregators like MetaMask Swaps.

$ airswap quote:best
AirSwap CLI 1.3.8 —
get the best available quote RINKEBY
buy or sell: buy
amount: 0.1
of: weth
for: dai
Requesting from 3 peers... done
Quote from
✨ Buy 0.1 WETH for 40 DAI
Price 0.0025 WETH/DAI (400 DAI/WETH)