> For the complete documentation index, see [llms.txt](https://doc.torch.finance/telegram-usd/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.torch.finance/telegram-usd/technical/telegram-usd-sdk/get-stgusd-conversion-rate/on-chain-method.md).

# On-chain method

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

* tgUSD staking contract address: `EQDsRxOvYyhOAi-zHBSN2NkHcjwFB1aaMSnqJG7Chm14x02P`
* Send an `OP_PROVIDE_CURRENT_QUOTE` message to the tgUSD Staking contract, which will respond with an `OP_TAKE_CURRENT_QUOTE` message containing the rate information.
* `OP_PROVIDE_CURRENT_QUOTE` Message:

<table><thead><tr><th width="245.16796875">field</th><th>type</th><th>description</th><th>ref</th></tr></thead><tbody><tr><td><code>OP_PROVIDE_CURRENT_QUOTE</code></td><td>uint32</td><td><code>0x984d8449</code></td><td>0</td></tr><tr><td>queryId</td><td>uint64</td><td></td><td>0</td></tr><tr><td>recipient</td><td>Address</td><td>The address who receive <code>OP_TAKE_CURRENT_QUOTE</code></td><td>0</td></tr><tr><td>customPayload</td><td>Maybe&#x3C;Cell></td><td>Send <code>OP_TAKE_CURRENT_QUOTE</code> to recipient with this <code>customPayload</code></td><td>0</td></tr></tbody></table>

* `OP_TAKE_CURRENT_QUOTE` Message:

<table><thead><tr><th width="225.07421875">field</th><th>type</th><th>description</th><th>ref</th></tr></thead><tbody><tr><td><code>OP_TAKE_CURRENT_QUOTE</code></td><td>uint32</td><td><code>0x80ed6c2e</code></td><td>0</td></tr><tr><td>queryId</td><td>uint64</td><td></td><td>0</td></tr><tr><td>totalActiveStake</td><td>coins</td><td>Currently active staked amount (including distributed rewards)</td><td>0</td></tr><tr><td>totalShares</td><td>coins</td><td></td><td>0</td></tr><tr><td>timestamp</td><td>uint32</td><td>The timestamp when the rate information is provided</td><td>0</td></tr><tr><td>customPayload</td><td>Maybe&#x3C;Cell></td><td></td><td>0</td></tr></tbody></table>

* `totalActiveStake` / `totalShares` represents the current conversion rate of 1 stgUSD in tgUSD (You can control the rounding precision as needed)
