Get Your Own web3 .defi Domains Today!

Daily Defi News from Across the Web

Daily Defi News from Across the Web

Introducing the Gnosis Custom Market Maker and Tutorial | by Gnosis | Dec, 2020


This tutorial provides an overview of all steps to set up Gnosis Custom Market Maker strategy on xDai, an Ethereum sidechain designed for fast and inexpensive transactions. The Gnosis Custom Market Marker (CMM) is currently only available on the xDai network.

1. Obtain xDai tokens to pay gas fees

To use any application on the xDai network, you will need to pay gas fees. The good news is that gas fees on xDai are minimal and stable. However, to pay them, you must convert DAI tokens to xDai tokens. Here’s how.

Using Metamask, navigate to the Dai bridge: https://bridge.xdaichain.com/.

Be sure your Metamask network is set to Ethereum Mainnet.

Enter the amount of DAI you would like to convert to xDai, and select Transfer.

Confirm your transfer. You’ve done it!

2. Deploy a Gnosis Safe Multisig on xDai

To use the CMM, you will need to deploy a Gnosis Safe Multisig on xDai.

Please note that it is not possible to toggle between Ethereum networks using the Gnosis Safe: your Gnosis Safe address differs from network to network! It’s also extremely important to note: do NOT send Ethereum Mainnet funds to an xDai address; the funds will be lost.

To deploy a Gnosis Safe Multisig on xDai, you must navigate to https://xdai.gnosis-safe.io/app/. Once you connect your Metamask wallet, you will be prompted to change your Metamask network. You must change your network to a Custom RPC to access the xDai network. The information you will need to enter is detailed at the beginning of this tutorial post.

Once you initiate the process, you should see a screen prompting you to Create new Safe:

Follow the steps to finish creating your Gnosis Safe Multisig. You will need to pay gas fees (in xDai) to complete the deployment.

For general questions on deploying a Gnosis Safe Multisig, see this tutorial for doing so on Ethereum Mainnet.

3. Obtaining additional tokens on xDai to set up your CMM strategy

OK, so you’re all set with the CMM open, and you have xDai in your Metamask to pay for gas fees for transactions. However, you’ll still need some additional tokens in your xDai Gnosis Safe to fund your CMM strategy. Please note that:

  1. Tokens that you would like to be part of your strategy need to have been added to the xDai Gnosis Protocol. For the closest available list, visit the Mesa DEX, change your wallet network to xDai, and look at the dropdown of available tokens.
  2. Using the CMM itself, you will only be able to select tokens from a hardcoded list as well as all your tokens in your Safe which must also be available on the Gnosis Protocol.
  3. Be sure to keep this in mind when obtaining more xDai ERC-20 tokens.

There are at least two ways of obtaining tokens to use on xDai.

  1. Bridging an ERC-20 token

For ERC-20 tokens, follow the prompts on Omnibridge, or to mint native xDai tokens, follow step two on Omnibridge.

  1. Trading an xDai token for another xDai token

If you have xDai tokens (whether xDai or another bridged ERC-20), but you’d like to include other tokens in your CMM strategy, you can also consider placing orders for them on Mesa DEX. The DXdao provides a tutorial for using Mesa on xDai here. Pro tip: if you find yourself in need of wxDai (wrapped xDai), you can use Mesa to wrap it.

Note that once you are ready to exit the xDai network, you will want to use the above mentioned options to bridge your tokens back to Ethereum Mainnet.

Once you have your tokens ready in your xDai Gnosis Safe, it should look something like this:

4. How to use the CMM App

Now that you have your xDai tokens ready, let’s move on to how to use the Gnosis Custom Market Maker itself. On the side menu, choose the APPS tab followed by Gnosis Custom Market Maker:

You will be greeted by four short onboarding prompts, which you can choose to exit at any point. After, you will see the app’s main screen to deploy CMM strategies:

There are several parameters required to create a CMM strategy. Let’s walk through them:

a) Pick your Token A and Token B: These are the two tokens that you are buying and selling against one another, and for which you are setting limit orders on Gnosis Protocol. You will always have either one of them in your strategy. For example, sell A for B and sell B for A according to “buy low, sell high.”

b) Specify the Lowest price and Highest price to determine the price range your strategy will cover. The range will define your highest sell price and the lowest buy price of the “brackets.” Below and above these prices, you will have traded all of your inventory of either Token A or Token B, such that you remain with only one of the tokens. Once prices are back in the range, you will start trading automatically again.

c) Specify a Start Price: Below the Start Price, the brackets will be funded with Token A. Above the Start Price, the brackets will be funded with Token B. You can set the start price to be outside of your lowest and highest price range. A natural starting point to pick is the current market price, which you can select automatically through clicking on the displayed market price.

d) Specify how many Total Brackets should be created. Each bracket is a separate trading account on Gnosis Protocol, and places a buy-low and a sell-high order. Every time the price goes through a bracket’s range and activates both orders, the CMM provider earns the spread.

e) Specify the total amount of Funding to provide in each token. The amount per bracket is then calculated automatically.

To learn more about the implications of each parameter, please see the documentation.

A note on token availability

You will see a few hard coded options as well as all tokens you have in your Safe (with a balance above zero) that are listed on Gnosis Protocol on xDai.

Note: Native xDai is not compatible with the Gnosis Protocol smart contract and needs to be wrapped to wxDai before it can be used as part of a strategy. You could consider doing this step on Mesa DEX (see above).

For more information on token availability, also see the above paragraph.

Within the CMM, tool tips are available for your convenience. Consider checking out the support links on the right hand side.

Deploying the CMM strategy

When you deploy a strategy, you will only need to sign once, even though you are batching a number of transactions.

After submitting the transaction on a pop-up like the above, confirm the strategy with your Metamask. This will display a transaction with the Gnosis Custom Market Maker in your Gnosis Safe transactions list.

Note: If you have set up multiple Gnosis Safe owners, every owner has to sign before the strategy becomes active. The other owners/signers can see strategies for which their signature is pending in “Pending strategies,” and review the CMM strategy before signing. The confirmation itself is done in the “Transactions” tab of the Gnosis Safe. The CMM App shows you the exact Safe Nonce, just to ensure you are signing the correct transaction.

Strategy overview and monitoring your strategies

Within the Strategies tab, you will see your active strategies.

A token balance often takes a few minutes after deployment to reload and update to show the correct balance

Click on a strategy’s row to fold out more detailed information about the CMM strategy. You will have plenty of information at your fingertips:

Current funding distribution

You will be able to see how many of your brackets contain token A or token B, and the amounts thereof per bracket. You can see from the dashed needle the current Gnosis Protocol market price.

Strategy performance

  • Total value: The current USD value of the funding of all brackets combined.
  • Hold value: The approximate value the initial funding is worth today (if it had not been part of a strategy).
  • ROI: This compares the total value of the funding today with the hold value (approximately in USD).
  • APR: This annualises the percentage difference between the initial funding (in USD) at the funding date and the total value (approximate current strategy value in USD).

Further information

  • The tab “Deployed Params” shows you the parameters with which you initialized your strategy.
  • Available soon: In the future, the tab “Trades” will show you previous trades with a CSV download (feature is currently not available).

Cancel a strategy and withdraw your funds

You can stop or cancel a strategy at any point in time. Navigate to the active STRATEGIES tab, click on the strategy you would like to stop, and press “Request Withdraw”.

The popup explains what you will need to do:

  1. You must submit and confirm a transaction requesting the withdrawal. Note that in case you have multiple Safe owners, all must sign this transaction to deactivate the strategy.
  2. Upon meeting signature requirements, the strategy will move to the Closed tab.

This will show you a Safe transaction with Gnosis Custom Market Maker.

Important: While strategies can be stopped immediately, you will have to wait five minutes before you can claim the funds. The red notification indicates that you have a pending claim.

You can proceed by claiming all balances and signing the transaction. Remember that for a Safe with multiple owners/signers, all must sign for the transaction to be final.

This will show you a Safe transaction with Gnosis Custom Market Maker.

Now that the funds will be available back in your Safe.

And now you’ve done it, you’ve officially deployed an xDai Gnosis Safe Multisig, a Gnosis Custom Market Maker strategy, and withdrawn your funds. From here, feel free to deploy a new strategy, or bridge your tokens back to Ethereum Mainnet.



Source link

Recommended For You

blank

About the Author: admin

Main Menu

Subscribe for Daily DeFi News