> 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/off-chain-method.md).

# Off-chain method

## Step 1: Import modules & Initialize Staking Contract

```typescript
import { Address, TonClient4 } from "@ton/ton";
import { tgUSDStaking } from "@torch-finance/tgusd-sdk";

const tonClient = new TonClient4({
  endpoint: 'https://mainnet-v4.tonhubapi.com',
});

// Staking Contract
const stakingAddress = Address.parse("EQDsRxOvYyhOAi-zHBSN2NkHcjwFB1aaMSnqJG7Chm14x02P")
const tgUSDJettonMaster = Address.parse("EQCJ7ASxOkI6Ws5Bh8J74XZbRX8861jFgTZT42DXv71-UISf")
const stgUSDJettonMaster = Address.parse("EQC2OdSIRyDofBjKYtR-ZN-Xk3eHN9gEujY7deoHNRBdZ5QG")
const staking = tonClient.open(tgUSDStaking.createFromAddress(stakingAddress, tgUSDJettonMaster, stgUSDJettonMaster));
```

## Step2: Get stgUSD conversion rate

```typescript
const { totalActiveStake, totalShares } = await staking.getConversionRatio();
```

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