airswap / airswap-aips

AirSwap Improvement Proposals
22 stars 3 forks source link

AIP 53: Upgrade Trader and OTC board functions #53

Open agriimony opened 2 years ago

agriimony commented 2 years ago

Collaborating here: https://docs.google.com/document/d/1pE-Vz4LwKAvozpMhs7WP7q-HXUiXH25xC7DNVrTIuE0/edit?usp=sharing

Summary

Specification

The current AirSwap Trader should be implemented into our new web app together with an OTC board and upgraded with the following functions:

Batch swap creation

The new trader app should take in a list of parameters (token address 1, amount 1, token address 2, amount 2, counterparty address, expiration time) and generate a list of urls for the swaps. These swaps should also be listed on the OTC board.

Custom url endpoints for filtered OTC board

The OTC board should allow for url endpoints which would return a list of filtered OTC board listings. e.g. /trader/weth/ could return all listings on the OTC board where the signerToken = WETH, while /trader/weth/usdc should return all listings where the signerToken = WETH and senderToken = USDC.

These endpoints would allow for other projects to build on AirSwap by implementing their own front ends which would then be powered by the AirSwap backend.

Fees on OTC swaps

The upgraded app will also implement the new version of the swap contract, which means that there will now be a fee assessed on each swap. The creator of the swap should be able to define which party should pay the fees and the fees assessed should be clearly shown in the UI. As per AIP #37, the fee payer will also qualify for a fee discount depending on the amount of AST they have staked.

The legacy trader.airswap.io should be left up for those who may wish to continue using the old contract without fees (but also without the upgraded features).

Rationale

We have had interest from another DAO which requested us to implement batch swap creation as well as a way to filter the OTC board for their tokens. In the long term, we should enable other projects/DAOs to easily use AirSwap as a way to power their own internal token marketplaces.

Batch swap creation could also be a way for UMA token sales to be carried out if projects can easily upload a whitelisted list of addresses and amount of tokens to be purchased.

Copyright

Copyright and related rights waived via CC0.