NFT Marketplace

The Sun Protocol also supports NFT trading. Unlike NFT trading markets such as OpenSea and Blur, Sun Protocol introduces the concept of a brand-new decentralized peer-to-peer NFT trading market.

The Sun marketplace is a minimal, efficient automated market maker (AMM) protocol that facilitates the exchange of NFTs to tokens (and vice versa) using customizable bonding curves. Sun marketplace supports both ERC721 and ERC1155 NFTs, as well as all ETH and ERC20 tokens.

Liquidity Providers (LPs) can deposit assets into single-sided buy or sell pools, or two-way trading pools, to optionally buy or sell NFTs with a spread and earn trading fees.

Similar to other underlying NFT protocols, Sun marketplace does not distinguish between different ERC721 IDs. Mining pools willing to buy or sell NFTs will return the same price regardless of which NFTs are deposited into or withdrawn from the collection.

Sun marketplace is an AMM protocol for NFTs, meaning users buy or sell from liquidity pools rather than directly trading with each other. If you're familiar with Uniswap, it's a similar concept but for NFTs.

Here's how it works

Liquidity Providers deposit NFTs and/or ETH (or ERC20 tokens) into liquidity pools. They choose whether to buy or sell NFTs (or both) and specify starting prices and bonding curve parameters.

Users can then buy NFTs from or sell NFTs to these pools. Each purchase or sale of an item changes the price of buying or selling another item based on its bonding curve. Liquidity Providers can adjust their pool parameters or withdraw assets at any time.

The pool or liquidity pool is a smart contract that allows instant swapping between two assets. On Sun marketplace, the most common pool type is the NFT<>ETH pool, meaning anyone holding an NFT in the collection can immediately swap it for ETH, and vice versa.

The pool uses a bonding curve to determine the relative price of one asset to another. The more of an asset bought from the pool, the more expensive it becomes. Conversely, the more of an asset sold to the pool, the cheaper it becomes.

Ideally, a pool contains a certain amount of both assets, enabling users to swap between them. However, pools containing only one asset can also be created, meaning users can only buy that asset from the pool.

Bonding Curves

Bonding curves are mathematical formulas that define the relationship between asset price and its supply. They are a key feature of automated market makers as they're used to algorithmically adjust asset prices.

Sun marketplace supports three types of bonding curves: Linear, Exponential, and XYK (Constant Product).

Linear

With a linear bonding curve, the price of an NFT increases by a fixed amount each time an item is bought from the pool. Conversely, the price decreases by the same fixed amount each time an item is sold to the pool.

For example, a Liquidity Provider can create an NFT<>ETH pool with a starting price of 1 ETH and a delta of 0.1 ETH. Assuming they provide enough liquidity, the price of the NFT will increase to 1.1 ETH after one item is bought from the pool. After buying the second item, the price will increase to 1.2 ETH, and so on. At any point, if an NFT is sold to the pool, the price will decrease by 0.1 ETH.

Exponential

With an exponential bonding curve, the price of an NFT increases by a certain percentage (also known as delta) each time an item is bought from the pool. Conversely, the price decreases by an equivalent amount each time an item is sold to the pool.

To calculate the equivalent decrease amount, convert the percentage to a decimal exponent (e.g., for 50%, the exponent would be 1.5) and divide the price by that number.

For example, a Liquidity Provider can create an NFT<>ETH pool with a starting price of 2 ETH and a delta of 50%. Assuming they provide enough liquidity, the price of the NFT will increase to 2 + 50% = 3 ETH after one item is bought from the pool. After buying the second item, the price will increase to 3 + 50% = 4.5 ETH, and so on. At any point, if an NFT is sold to the pool, the price will be divided by 1.5.

XYK (Constant Product)

With the XYK curve, the price of an NFT adjusts each time an item is bought or sold from the pool to keep the product of two virtual reserves constant. These virtual reserves correspond to the quantity and value of NFTs being bought or sold to the pool.

Additional tuning parameters allow Liquidity Providers to adjust (tighten or loosen) the XYK curve.

In addition to ETH and NFT trading on Ethereum, Sun marketplace supports all types of NFTs in the entire chain ecosystem, including NFTs on Ethereum Layer 2 networks such as Arbitrum, Linea, StarkNet, other EVM-compatible chains like BNB Chain, opBNB Chain, Avalanche, Solana, Sei Network, heterogeneous chains like Aptos, Sui, move public chains, and Bitcoin ecosystem-related NFT series.

Last updated