Telegram USD
WebsiteMiniapp
  • 👋Welcome
  • Getting Started
    • 🗽Introduction
    • 😢Ecosystem Challenges
      • Low Yield on TON
      • Limited Real-World Integration
      • High DeFi Barriers
    • 🤙A New Path Forward
  • How tgUSD Works
    • 🏠Architecture
      • ▶️Current Version
      • 🌴Core Components
        • Engine
        • Staking
      • 🔮Next Version
    • ⚖️Peg Stability
    • 💰Protocol Revenue
    • 🙋‍♀️Use Cases
      • DeFi
        • Yield Tokenization
        • Lending
        • Dex
        • Leverage Yield Farming
        • Derivatives
        • Arbitrage
      • Cross-Chain Expansion
        • TAC
        • Tycho
  • Rewards
    • 🌟Ambassador Program
    • ✴️What is Torch XP
  • Technical
    • 📖Telegram USD SDK
      • Setup
      • Mint tgUSD
      • Stake tgUSD
      • Unstake stgUSD
      • Get stgUSD Conversion Rate
        • On-chain method
        • Off-chain method
    • 🛠️Deployments
  • Security
    • ✳️Risks
    • 🛡️Audits
  • User Guide
    • How to Mint
    • How to Stake
    • How to Unstake
    • FAQ
  • Legal
    • Terms of Service
  • Privacy Policy
  • Other
    • 🎨Brand Kit
  • Links
    • Website
  • tgUSD Miniapp
  • Telegram Channel
  • X (Twitter)
Powered by GitBook
On this page
  1. Technical
  2. Telegram USD SDK
  3. Get stgUSD Conversion Rate

On-chain method

PreviousGet stgUSD Conversion RateNextOff-chain method

Last updated 13 days ago

  • 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:

field
type
description
ref

OP_PROVIDE_CURRENT_QUOTE

uint32

0x984d8449

0

queryId

uint64

0

recipient

Address

The address who receive OP_TAKE_CURRENT_QUOTE

0

customPayload

Maybe<Cell>

Send OP_TAKE_CURRENT_QUOTE to recipient with this customPayload

0

  • OP_TAKE_CURRENT_QUOTE Message:

field
type
description
ref

OP_TAKE_CURRENT_QUOTE

uint32

0x80ed6c2e

0

queryId

uint64

0

totalActiveStake

coins

Currently active staked amount (including distributed rewards)

0

totalShares

coins

0

timestamp

uint32

The timestamp when the rate information is provided

0

customPayload

Maybe<Cell>

0

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

📖