# How to get TON-bmTON rate

The fundamental TON-bmTON rate is calculated using the formula:

**`bmTON rate = ton_total_supply / jetton_total_supply`**&#x20;

**On-chain:**

To fetch `ton_total_supply` and `jetton_total_supply` on-chain, send a message to the **Financial** contract with the following TL-B layout:

```
// TL-B:
provide_current_quote#ad83913f 
query_id:uint64 
custom_payload:(Maybe ^Cell) 
= InternalMsgBody;
```

The **Financial** contract will respond with:

```
// TL-B
take_current_quote#0a420458 
query_id:uint64 
ton_total_supply:uint128 
jetton_total_supply:uint128 
custom_payload:(Maybe ^Cell) 
= InternalMsgBody;
```

**Off-chain:**

To retrieve `ton_total_supply`  and `jetton_total_supply` you need to invoke '**get\_full\_data**' method in **Financial** contract:

```
// TL-B:
get_full_data#_ = (
    jetton_total_supply:Coins 
    ton_total_supply:Coins 
    commission_total_supply:Coins
    commission_factor:uint16
    commission_address:MsgAddressInt
    admin_address:MsgAddressInt
    transaction_address:MsgAddressInt
    content:^Cell
    jetton_wallet_code:^Cell
    unstake_request_code:^Cell
    last_lockup_epoch:uint32
    lockup_supply:Coins
    next_lockup_supply:Coins
    later_lockup_supply:Coins
    next_unstake_request_index:uint64
)
```

<https://tonviewer.com/EQCSxGZPHqa3TtnODgMan8CEM0jf6HpY-uon_NMeFgjKqkEY?section=method>

See the screenshot:

<figure><img src="/files/O5IljafUMF7LATBhWnQB" alt=""><figcaption></figcaption></figure>

These two values `0x2524443fb29fa1` and `0x275f0f797cee6d` are hexadecimal representations of `jetton_total_supply` and `ton_total_supply` . To convert them to decimal and compute the bmTON price, you can use the following code in Python:

```
jetton_total_supply = int("0x2524443fb29fa1", 16)
ton_total_supply = int("0x275f0f797cee6d", 16)
```

**Here is an example in Python:**

```
from pytoniq import LiteClient

async with LiteClient.from_mainnet_config(trust_level=2) as client:
   result = await client.run_get_method(
       address="EQCSxGZPHqa3TtnODgMan8CEM0jf6HpY-uon_NMeFgjKqkEY",
       method="get_full_data",
       stack=[],
   )
bmton_price_in_ton = result[1]/result[0]                                     
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.bemo.fi/developers/bemo-v2/how-to-get-ton-bmton-rate.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
