A liquidation account/ token converter

One of the core features of Gnosis Protocol is that any token can be directly traded against any other token. An often-used pattern in token economics is, that a system collects fees in a wide range of tokens but uses those tokens to buy-back and burn the protocol token.

This can come with a lot of challenges. Traditional exchanges might not offer that specific trading pair. On GP this can be implemented quite elegant:

One contract account would be needed and the only thing this contract can do is to create market orders of any token into a specific protocol token. Those orders would have an unlimited sell amount and would be valid forever.

Now any token that is earned as fees can simply be deposited into the account. The GP will take care of the liquidations.

Advantages of protocols that use this system:

  • no frontrunning issue
  • does not need to be actively traded
  • no gas fees

If no withdrawal option is provided the tokens are effectively burned. Alternatively, there can be a mechanism to withdrawal the tokens into another contract.

Here is a implementation suggestion:

At the core is a Gnosis Safe. This Safe can have an owner that would be able to change the setup, or the owner can be removed.

All tokens that should be converted into the target token should be send to the Safe. Already at setup a bunch of tokens can be “activated” for burning. This would simply mean the Safe places a valid forever/unlimited amount market order to sell a token for the target token.

Modules:
Modules are ways to give specific permissions to act on behalf of the Safe even if you are not the owner.
addToken
Since likely at deployment time not all tokens are known then can be collected it should be able to add (place the proper sell order + give allowance to GP to deposit the token) any token later by anyone.
deposit
The tokens can not directly be deposited into the exchange. Instead they are sent to the Safe. From there at any time anyone can trigger the deposit function - since the sell order already exists, this will immediately set the tokens for sale.
withdrawal
If the only goal is to remove the traget token from circulation this is not needed. However, some systems might require an explicit burn of the tokens or potentially this system is used simply as an converted. In any case, it is possible to have another module to allow a withdrawal (sends the target token from GP to the Safe and forwards the tokens then to the target address)

For this whole setup ideally a factory would exists.
The only required parameters are:

  • target token
  • target address (optionally)
  • owner (optionally)