📈Bonding Curves

TensorSwap lets you setup 3 types of orders:

  1. Collection-wide bids

  2. List orders

  3. Market-making orders

All 3 make use of bonding curves.

What are bonding curves?

A "bonding curve" is just a fancy way of saying "when someone executes a trade against my order, I want the price to change".

BUY example 📉

You decide you want to buy up to 5 NFTs, starting at 1 SOL, with a delta or "step" of 0.1 SOL.

This means you're setting up an order to do the following purchases:

  1. 1st purchase: 1 SOL

  2. 2nd purchase: 0.9 SOL (1 - step of 0.1)

  3. 3rd purchase: 0.8 SOL (1 - 0.1 * 2)

  4. 4th purchase: 0.7 SOL (1 - 0.1 * 3)

  5. 5th purchase: 0.6 SOL (1 - 0.1 * 4)

Thus in total, you're prepared to spend 4 SOL on 5 NFTs.

Here's what it would look like in Tensor UI:

SELL example 📈

You decide you want to sell up to 5 NFTs, starting at 1 SOL, with a delta or "step" of 10% (note previously we used a SOL value, now we're using a % value - more about this later).

This means you're setting up an order to do the following sales:

  1. 1st sale: 1 SOL

  2. 2nd sale: 1.1 SOL (1 * 1.1)

  3. 3rd sale: 1.21 SOL (1 * 1.1^2)

  4. 4th sale: 1.331 SOL (1 * 1.1^3)

  5. 5th sale: 1.4641 SOL (1 * 1.1^4)

Thus in total, you're standing to make 6.11 SOL from 5 NFTs.

Here's what it would look like in Tensor UI:

Types of curves

Currently Tensor supports 2 types of curves:

  1. Linear (step measured in SOL)

  2. Exponential (step measured in %)

Choose a linear curve if you want a more gradual/static change in price. Exponential curves will adapt better depending on the current price (smaller steps if the price is low, larger steps if the price is high).

For example, a SELL order starting at 1 SOL:

  1. using a linear curve with a 0.1 SOL difference, after 100 trades will be selling at 11 SOL (1 + 0.1 x 100)

  2. using an exponential curve with a 10% difference, after 100 trades will be selling at 13,780 SOL (1 x 1.1^100)

Similarly, a BUY order starting at 1 SOL:

  • using a linear curve with a 0.1 SOL difference, after 5 trades will be selling at 0.5 SOL (1 - 0.1 x 5)

  • using an exponential curve with a 10% difference, after 5 trades will be selling at 0.62 SOL (1 / 1.1^5)

Why are bonding curves useful?

Bonding curves let you DCA in and out of a trade.

Let's say you want to acquire up to 5 NFTs of a certain collection, but you're unsure how low the price will go. The lower it goes, the more you want to buy.

You can set up a BUY order with a linear bonding curve, saying "I'm prepared to buy 1st NFT at 1 SOL, 2nd at 0.9 SOL, etc). That way you don't need to care about what the market does - if the market stays put, well great you bought one if the market goes lower, well great you bought more than one!

Similarly for selling - maybe you want to sell your portfolio, but you don't know how high the market will go. The higher it goes, the more you want to sell.

You can set up a SELL order which increases the price by eg 10% with each sale... you get it.

In theory, there's nothing stopping you from putting in bids/listings at different prices by hand - but doing so using a bonding curve is just much faster and more flexible. If you ever change your mind it only takes 2 clicks (1 to cancel old order - 1 to set up a new order) and you're done, vs having to place/cancel multiple bids/listings by hand.

Do I HAVE to use a curve?

You don't have to. If you'd like to list 5 NFTs all at the same price or buy 5 NFTs all at the same price, just set the delta or "step" to 0.

Last updated