Back to Blog

Creating concentrated liquidity positions on NFTX with Uniswap V3 - Goerli Testnet

Concentrated liquidity pools can improve the price for NFT collections by reducing the spread and price impact when buying/selling/swapping NFTs.

Banner about creating concentrated liquidity pools

Concentrated liquidity pools can improve the price for NFT collections by reducing the spread and price impact when buying/selling/swapping NFTs.

These steps are specific for the current Goerli deployment and will be used as the basis for the mainnet deployment in a couple weeks.

Overview

Concentrated liquidity is great for advanced investors who want more control over their liquidity positions, and to achieve this on NFTX we have implemented a similar implementation as the DEX https://matcha.xyz.

The NFTX marketplace will be using the 0x protocol to fulfil the buying/selling of tokens that goes on when you buy/sell/swap on the platform. 0x aggregates a number of different liquidity providers (both Ethereum and Arbitrum) so that you get the best price.

SushiSwap will remain the only liquidity platform that allows you to stake your SLP on NFTX to earn yield on the NFTX fees, however in the example below you will see the price improvements by having a position on Sushi and UniV3 (or any other concentrated liquidity source supported by 0x Protocol).

Links for testing

  1. NFTX Goerli Test Branch - this branch is currently the only one with working 0x integration (https://nftx-goerli-app-v2-git-feat-enable-0x-nftx.vercel.app/).
  2. Goerli OpenSea - if you want to buy Havah Friends which the tutorial is based on (https://testnets.opensea.io/collection/havah-friends)
  3. Uniswap V3 - make sure you change your metamask to the Goerli chain.

Creating a Uniswap V3 concentrated liquidity pool on Goerli

To create a liquidity pool you need to pair the vToken (vault token) with ETH. Let's step through how you can get everything you need.

What you need

gETH — otherwise known as Goerli ETH. There are a number of ways to get some but most of them are only providing 0.2 ETH a day. If you want to create a large position then plan ahead and get some little and often, here are some links below to get you started.

In the real world you can simply buy some ETH.

vTokens — these can be obtained in a few ways.

  1. Buy from a DEX — you can buy them from the existing Sushi/Uni pools, however, this will drive the price of the token (and therefore the floor price) up and provide arbitrage opportunities.
  2. Mint into the NFTX Vault — you can mint your NFTs directly into the vault which will return your vTokens instead of ETH when you sell your NFTs. This gets you the tokens immediately, however you will be paying the mint fee (which is default to 10% but can be customised on the vaults). In this situation, if you minted 10 NFTs you would only receive back 9 vTokens.
  3. Inventory Staking — this bypasses the mint fees mentioned above and probably works the best for the Goerli testnet because the timelock on inventory staking is only 10 minutes before you can exit your position and receive all of the tokens back (make sure you exit to token and not to NFT). On mainnet the time lock is 7 days so you need to plan accordingly.
  4. Liquidity Staking — this also bypasses the mint fees and has a shorter time lock on mainnet (only 48 hours). The downside for this is that you may suffer some impermanent loss and get back more/less tokens/eth than you started with.

Once you have your vTokens and Goerli ETH, you can proceed to setting up your position on Uniswap.

Creating your position

Now that you have your vTokens and Goerli ETH we can set up the position.

Go to https://app.uniswap.org/#/pool and connect your wallet, and change to the Goerli network.

Pools page on Uniswap

Next step is to click on "New Position" on the top right.

Create new position

For the "Select Pair" section you want to pair vToken on the left, and ETH on the right. Click on the left dropdown (it likely says ETH) and copy and paste the vToken address into the search bar.

You can find the vToken address by visiting the vault on NFTX and going to the Info tab and copy the vToken contract address (make sure you grab the vault contract NOT the NFT contract).

Copy vToken Address

Paste vToken Address

Select ETH as the second part of the pair.

Set the fee tier you want to choose for your pair (this is the fee you will take on each trade that uses your pool, it has nothing to do with the fees on NFTX).

If you are setting up the first position for this pair on Uniswap then you'll also need to include the starting price (which you'll want to match with the current SushiSwap price)

Set Starting Price on the pair

If a pair is already set up you will see the current price.

Set the range for your position but adding a Min Price and a Max Price. While the price of the token remains between these numbers your liquidity pool can be aggregated through the 0x protocol. You also have the option of choosing Full Range which will give you an infinite range in the same way that SushiSwap does. This nullifies the benefits of a concentrated liquidity position and you're much better off just staking your liquidity directly through NFTX (which uses SushiSwap).

Finally, add the amount of vTokens you want in your pool (HAVAH in this case) and the amount of ETH will automatically be calculated based upon your range.

The screen should look similar to below.

  • Fee Tier: 1%
  • Min Price: 0.01ETH
  • Max Price: 0.15 ETH (which automatically changed to 0.14958)
  • Pairing 9 HAVAH Tokens with 0.637504 ETH

Set concentrated price ranges

Approve the use of your HAVAH, and then create the pool (in the Goerli interface the create pool button was actually called Preview, but it creates the pool when you click on it).

Once the pool has been created, it will automatically be available when buying/selling/swapping on NFTX.

Buying two HAVAH NFTs will use 77% liquidity from Uniswap, and 23% from SushiSwap

Price impact statistics

To give you an idea about the improvements made by creating concentrated liquidity positions on Uniswap we tooks some before and after examples of Buys and Sells on NFTX.

The first example is using liquidity added through NFTX (i.e. SushiSwap liquidity pool infinite range). It was 40 tokens paired with 2 ETH.

The second example is where we removed 50% of the liquidity from Sushi, and added it to Uniswap V3 at a range of 0.02 -> 0.1 ETH which paired 20 NFTs with 1.25908 ETH.

The following tables look at the price of buying/selling 1, 3, 5, 10, or 20 NFTs at a time using the default Sushi liquidity only and also Sushi + Uniswap V3 via the new 0x protocol.

Sushi Liquidity Only (default NFTX experience)

Sushi + Uniswap V3 Concentrated Liquidity (new 0x protocol)

Graphing the per item cost buys/sells

As you can see from the graphs, the spread for buying multiple items is reduced due to the use of the concentrated liquidity aggregation from Uniswap.

Final thoughts

Go ahead and play around with the Goerli version of the implementation which is available on https://nftx-goerli-app-v2-git-feat-enable-0x-nftx.vercel.app

The 0xMarketplaceZap is going to be deployed to mainnet in the coming weeks where another post will be created with updated links and examples of how we've moved our PUNK positions across to a variety of liquidity provision solutions.

  • By providing liquidity on both Sushi and Uniswap you enjoy the yield generation from NFTX fees, plus you are able to earn 1% fees on the trades through Uniswap. This will lower the spread and tighten the floor prices which will lead to more activity on the vaults, and therefore generating more fees.
  • At the moment, aggregators like Gem/Genie are not routing through 0x Protocol so the best price for NFT collections with concentrated liquidity will be on NFTX. We are working with the aggregators to ensure that improved price can be implemented soon.
  • There will be situations where only Uniswap liquidity is used for the buys/sells, and the yield generated through NFTX will still go to the staked liquidity providers (even though their liquidity wasn't used).
  • With multiple liquidity pools across a variety of DEX there is now additioanal arbitrage opportunities between the pools in addition to the traditional arbitrage of NFTs.
  • MEV/Arbitrage bots can take advantage of the new approach to get better returns.

Remember that it's not just UniSwap that is available in addition to SushiSwap, but that 0x supports 28 different liquidity sources on mainnet alone

Loading...