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
  • Staking tgUSD and Minting stgUSD
  • Unstaking stgUSD
  • Reward Distribution and Vesting
  • Purpose of the Cooldown Period
  1. How tgUSD Works
  2. Architecture
  3. Core Components

Staking

PreviousEngineNextNext Version

Last updated 12 days ago

The Staking contract handles user staking, unstaking, and reward distribution. Its workflow is as follows:

Staking tgUSD and Minting stgUSD

  • Users stake tgUSD into the Staking contract.

  • Based on the current conversion rate between tgUSD and stgUSD, the contract mints the corresponding amount of stgUSD to the user.

  • stgUSD represents the userโ€™s share in the pool and appreciates in value over time as rewards are distributed.

Unstaking stgUSD

  • Users burn their stgUSD to receive the corresponding amount of tgUSD, which includes both principal and accumulated rewards.

  • Upon receiving the burn notification, the staking contract deploys a dedicated Unstake Account to track the request.

  • A 7-day cooldown period is required before the tgUSD can be claimed.

  • If the user initiates another unstake during the cooldown period, the amount is aggregated and the cooldown timer resets.

Reward Distribution and Vesting

  • Yield is distributed to the Staking contract every 7 days.

  • If rewards are earned on external chains, USDT is bridged back to TON via Stargate or USDT0. If rewards are already on TON, no bridging is required.

  • The accumulated rewards (USDT) are then sent to the Engine contract, which mints tgUSD and transfers it to the Staking contract as staking rewards.

  • Upon receiving the rewards, the Staking contract initiates a 7-day linear vesting period, during which the value of stgUSD gradually increases as the rewards accrue.

Purpose of the Cooldown Period

  • The cooldown provides the protocol with sufficient time to return tgUSD to the Staking contract.

  • In the event of a price deviation in the tgUSD/USDT pool, the protocol may temporarily use tgUSD from the Staking contract to perform arbitrage. Once arbitrage is complete, the USDT profit is converted into tgUSD and used to repay what was borrowed from the Staking contract.

๐Ÿ 
๐ŸŒด
Staking contact's workflow