Developer Resources
  • Overview
    • Introduction
    • TBCs on Solana
  • Get started
    • Quick Start Guide
    • TBC on Solana
      • Step 1: Create token
      • Step 2: Initialize Token Bonding Curve (TBC)
        • TBC Guides
        • TBC Examples
        • FAQs
      • Step 3: Swap Tokens
    • Grants
  • Tools
    • Swap for sRLY
  • Resources
    • FAQ
    • Solana Docs
    • Discord
    • Github
    • Anchor
    • Example React App
  • Archived
    • RLY Rewards
      • Bootstrap phase
      • Mature phase
Powered by GitBook
On this page
  • 1. Examples using App token price
  • Example 1.1
  • Example 1.2
  • 2. Examples using TVL
  • Example 2.1
  1. Get started
  2. TBC on Solana
  3. Step 2: Initialize Token Bonding Curve (TBC)

TBC Examples

PreviousTBC GuidesNextFAQs

Last updated 3 years ago

1. Examples using App token price

Example 1.1

An applications wants to supply 10,000,000 app tokens to the TBC swap with curve parameters growing the price from 0.01 sRLY to 10 sRLY over the course of swapping 10,000,000 App tokens

Slope = 9.99 x 10^-16

The slope was calculated by using , then converted using the .

token_b_liquidity = 10_000_000_000_000_000
slope_numerator = 999
slope_denominator = 1_000_000_000_000_000_000
init_price_a_numerator = 1
init_price_a_denominator = 100

Example 1.2

An applications wants to supply 10,000,000 app tokens to the TBC swap with curve parameters growing the price from 0.25 sRLY to 5 sRLY over the course of swapping the first 5,000,000 App tokens

Slope = 9.5×10^−16

token_b_liquidity = 10_000_000_000_000_000
slope_numerator = 95
slope_denominator = 100_000_000_000_000_000
init_price_a_numerator = 25
init_price_a_denominator = 100

The end point does not have to correspond to the total token_b_liquidity. Any two points can be used on the line to determine the slope and fund it with any amount of liquidity. The example below shows up to the first 5,000,000 app tokens even though the application wants to supply 10,000,000 app tokens.

2. Examples using TVL

Example 2.1

An applications wants curve parameters growing the price from 0.25 sRLY to 5 sRLY over the course of 500,000 TVL in sRLY

Slope = 2.49375×10^−14

token_b_liquidity = 540_883_000_000_000
slope_numerator = 24375
slope_denominator = 1_000_000_000_000_000_000
init_price_a_numerator = 25
init_price_a_denominator = 100

The slope was calculated by using , then converted using the .

The slope was calculated by using , then converted using the .

Method 1: Using App token price
Convert slope to numerator/denominator
Method 1: Using App token price
Convert slope to numerator/denominator
Method 2: Using TVL
Convert slope to numerator/denominator