> 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/stake-tgusd.md). Agents can also search and read this documentation through its [MCP server](https://doc.torch.finance/telegram-usd/~gitbook/mcp).

# Stake tgUSD

This guide demonstrates how to stake tgUSD to get stgUSD

## 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: Build Stake Payload

```typescript
// Prepare Stake params
// Staker Address
const stakerAddress = Address.parse("staker-address");

// Stake 0.1 tgUSD
const stakeAmount = 100000n;

// Build Stake Payload
const stakePayload = await staking.getStakePayload(stakerAddress, {
    stakeAmount: stakeAmount,
});
```
