TBC Examples

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 Method 1: Using App token price, then converted using the Convert slope to numerator/denominator.

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

The slope was calculated by using Method 1: Using App token price, then converted using the Convert slope to numerator/denominator.

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

The slope was calculated by using Method 2: Using TVL, then converted using the Convert slope to numerator/denominator.

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

Last updated