> For the complete documentation index, see [llms.txt](https://wiki.rly.network/rly-protocol/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wiki.rly.network/rly-protocol/get-started/tbc-on-solana/step-2-initialize-token-bonding-curve-tbc/tbc-guides.md).

# TBC Guides

## Understanding display vs base values

Display units are common units that is used outside of chain units such as:&#x20;

`5 sRLY Tokens`&#x20;

Base values are representative of the display in the form of chain units.  sRLY has 9 decimals on chain but the blockchain and TBC program only operates on base units. &#x20;

Because all numbers on the blockchain must be whole numbers, the decimals in the display value are represented by base units instead by multiplying by 10^decimals

Therefore the equivalent base unit of 5 sRLY would be

`5,000,000,000 sRLY Tokens`

**Another example:**&#x20;

Where sRLY has 9 decimals on chain:

`0.01 sRLY` in display value is equivalent to&#x20;

`10,000,000 sRLY` in base value

{% hint style="info" %}
Number of decimals on chain can be configured when creating a token but the default and standard on Solana is 9.
{% endhint %}

## Determining the slope of your TBC

### Method 1: Using App token price

This method can be interpreted as: the curve growing the application token price from price point 1 to price point 2 over the course of b2-b1 app token supply.&#x20;

Plug in the following parameters to the calculator above to receive your slope. [https://www.desmos.com/calculator/h5n2oijxn](<https://www.desmos.com/calculator/h5n2oijxnj &#xA;>)

* App token price at point 1 (*p1*)
* App token price at point 2 (*p2*)
* Amount of app token swapped out point 1 (*b1*)
* Amount of app token swapped out point 2 (*b2*)

{% hint style="success" %}
Plug in your slope and initial token price to this graph to double check that the slope is accurate: <https://www.desmos.com/calculator/u8xdqvv2vg>
{% endhint %}

### Method 2: Using TVL

This method can be interpreted as: the curve growing the application token price from price point 1 to price point 2 over the course of TVL in sRLY.&#x20;

Plug in the following parameters to the calculator above to receive your slope.\
[https://www.desmos.com/calculator/haskcbnlch](<https://www.desmos.com/calculator/haskcbnlch&#xA;>)

* App token price at point 1 (*p1*)
* App token price at point 2 (*p2*)
* TVL in sRLY between TVL=0 and point 2 (*t2*)

{% hint style="success" %}
Plug in your slope and initial token price to this graph to double check that the slope is accurate: <https://www.desmos.com/calculator/u8xdqvv2vg>
{% endhint %}

## Converting slope and token price to numerators and denominators&#x20;

### Converting slope to slope\_numerator and slope\_denominator&#x20;

During `rly-cli tbc-init` you will have to enter the slope numerator and denominator.&#x20;

Example:&#x20;

`The slope m=5x10^-15`

would be equivalent to:&#x20;

`slope_numerator = 5`

`slope_denominator`` `*`=`*` ``1_000_000_000_000_000`

{% hint style="danger" %}
Values cannot have decimals so the numerator/denominator must be adjusted if required.
{% endhint %}

### Converting initial token A price to initial\_token\_a\_price\_numerator and initial\_token\_a\_price\_denominator&#x20;

During `rly-cli tbc-init` you will have to enter the initial token A (sRLY) price as a price numerator and denominator.&#x20;

A initial token A starting price of 0.01 sRLY would be equivalent to&#x20;

`initial_token_a_price_numerator = 1` \
`initial_token_a_price_denominator = 100`

{% hint style="info" %}
Because price always represents how much base token A (sRLY) it costs to buy 1 base token B (app token), there's no need to scale by 9 decimals.&#x20;
{% endhint %}
