MilkyWay Docs
  • INTRODUCTION
    • Welcome to MilkyWay
    • Mission and Vision
    • MILK
      • Tokenomics
    • Whitepaper (PDF)
  • User Guides
    • For Liquid Stakers
      • Quick Start
      • For Celestia (milkTIA)
        • Technical Architecture
          • Liquid Staking Process
          • Withdrawal Process
          • Exchange Rate
          • Compound Staking Rewards
          • Claim Process
          • Limits and Restrictions
        • Integrating with milkTIA
          • Contract Specifications
          • APIs specification
        • Using third party apps
          • Camelot
          • Demex
          • Dymension
          • Levana
          • Margined
          • Mars
          • Osmosis
          • UX
      • For Initia (milkINIT)
        • Technical Architecture
          • Liquid Staking Process
          • Withdrawal Process
          • Exchange Rate
          • Compound Staking Rewards
          • Claim Process
          • Limits and Restrictions
        • Integrating with milkINIT
          • Liquid staking module specifications
          • Chains specifications
      • For Bablyon (milkBABY)
        • Technical Architecture
          • Liquid Staking Process
          • Withdrawal Process
          • Exchange Rate
          • Compound Staking Rewards
          • Claim Process
          • Limits and Restrictions
        • User Flow
        • One-Click Stake
        • Integrating with milkBABY
          • Liquid staking module specifications
          • Chains specifications
    • For Restakers
      • Quick Start
      • For Restakers
        • Creating a wallet
        • Restaking your assets
    • Bridging
      • Hyperlane
      • IBC Eureka
  • Infrastructure Operators
    • For MilkyWay Validators
      • Quick Start
      • For Validators
        • Consesus node
        • Validator node
    • For Service Operators
      • Quick Start
      • For Operators
        • Operator Management
        • Opt-in and Opt-out Services
  • For Service Developers
    • Quick Start
    • For Services Admins
      • Service Management
      • Inviting Operators to Join Your Service
      • Creating Rewards Distribution Plan
  • Architecture
    • Modular Liquid Staking
      • Overview
      • Liquid Staking 101
    • Modular Restaking
      • Overview
        • Technical Architecture
        • Design Philosophy
        • Programmable Rules
        • Economic Model
        • Use Cases
      • Restaking 101
  • Modules
    • x/assets
    • x/ibc-hooks
    • x/liquidvesting
    • x/operators
    • x/pools
    • x/restaking
    • x/rewards
    • x/services
    • x/tokenfactory
  • SECURITY
    • Audits
    • Bug Bounty Program
  • APPENDIX
    • Official Links
    • Frequently Asked Questions
    • Glossary
    • Branding Resources
Powered by GitBook
On this page
  • How to liquid stake $TIA
  • How to liquid unstake milkTIA
  • Claiming unstaked tokens
  1. User Guides
  2. For Liquid Stakers
  3. For Celestia (milkTIA)
  4. Integrating with milkTIA

Contract Specifications

PreviousIntegrating with milkTIANextAPIs specification

Last updated 4 months ago

The codebase of our Liquid Staking Protocol can be found on , inside the repository. Particularly, you will find two smart contracts:

  1. The : it contains the logic that allows to stake TIA tokens in exchange for our milkTIA Liquid Staking Token, as well as unstaking such token to receive back TIA.

  2. The : this is where all the fees collected by MilkyWay are stored and managed.

Both contracts are deployed on the mainnet at the following addresses:

Smart contract
Address
Explorer link

Staking Contract

osmo1f5vfcph2dvfeqcqkhetwv75fda69z7e5c2dldm3kvgj23crkv6wqcn47a0

Treasury Contract

osmo1r88fszmnpn8ez5wc42pssd2597mhtrdzex7tzzulj98fmqee2fksg7z5yh

How to liquid stake $TIA

In order to liquid stake some TIA and receive milkTIA, you will need to broadcast a transaction containing a /cosmwasm.wasm.v1.MsgExecuteContract message having the following structure:

{
  "@type": "/cosmwasm.wasm.v1.MsgExecuteContract",
  "sender": "<Address of the user wanting to liquid stake their TIA>",
  "contract": "osmo1f5vfcph2dvfeqcqkhetwv75fda69z7e5c2dldm3kvgj23crkv6wqcn47a0",
  "funds": [
    {
      "denom": "ibc/D79E7D83AB399BFFF93433E54FAA480C191248FC556924A2A8351AE2638B3877",
      "amount": "<Amount of uTIA to be liquid staked (1 TIA = 1.000.000 uTIA)>"
    }
  ],
  "msg": {
    "liquid_stake": {}
  }
}

When creating this message, please note the following:

  1. Make sure the contract address is the one of our liquid staking contract: (osmo1f5vfcph2dvfeqcqkhetwv75fda69z7e5c2dldm3kvgj23crkv6wqcn47a0)

  2. Make sure the user has bridged the amount of TIA they want to liquid stake to the Osmosis mainnet using IBC. This because we only support IBC TIA to be liquid staked (denom: ibc/D79E7D83AB399BFFF93433E54FAA480C191248FC556924A2A8351AE2638B3877)

  3. Make sure the amount of tokens to be liquid staked is multiplied by 1.000.000 when creating the message. This means that if the users wants to liquid stake 10.5 TIA, you should set 10500000 as the amount.

How to liquid unstake milkTIA

In order to liquid unstake some milkTIA and receive back TIA, you will need to broadcast a transaction containing a /cosmwasm.wasm.v1.MsgExecuteContract message having the following structure:

{
  "@type": "/cosmwasm.wasm.v1.MsgExecuteContract",
  "sender": "<Address of the user that wants to liquid unstake their milkTIA>",
  "contract": "osmo1f5vfcph2dvfeqcqkhetwv75fda69z7e5c2dldm3kvgj23crkv6wqcn47a0",
  "funds": [
    {
      "denom": "factory/osmo1f5vfcph2dvfeqcqkhetwv75fda69z7e5c2dldm3kvgj23crkv6wqcn47a0/umilkTIA",
      "amount": "<Amount of umilkTIA to be unstaked (1 milkTIA = 1.000.000 umilkTIA)"
    }
  ],
  "msg": {
    "liquid_unstake": {}
  }
}

When creating this message, please note the following:

  1. Make sure the contract address is the one of our liquid staking contract: (osmo1f5vfcph2dvfeqcqkhetwv75fda69z7e5c2dldm3kvgj23crkv6wqcn47a0)

  2. Make sure the amount of tokens to be liquid unstaked is multiplied by 1.000.000 when creating the message. This means that if the users wants to liquid unstake 10.5 milkTIA, you should set 10500000 as the amount.

Please note that, differently from what happens when liquid staking their TIA tokens, users will not immediately receive back their TIA tokens when liquid unstaking milkTIA. This because, as per our architecture, we first need to process the batch requesting the staked TIA to be unlocked. This usually takes around 14 days, after which the TIA tokens will be ready to be claimed by the user. Claiming your tokens will require you to provide the batch_id that is returned to you when executing the liquid_unstake operation.

Claiming unstaked tokens

After you request your milkTIA to be unstaked, it will need around 14 days for them to be available again. Once that time has passed, you can use the following message in order to claim your tokens:

{
  "@type": "/cosmwasm.wasm.v1.MsgExecuteContract",
  "sender": "<Address of the user that wants to claim their tokens>",
  "contract": "osmo1f5vfcph2dvfeqcqkhetwv75fda69z7e5c2dldm3kvgj23crkv6wqcn47a0",
  "funds": [],
  "msg": {
    "withdraw": {
      "batch_id": <ID of the batch inside which your request was added>
    }
  }
}

When creating this message, please note the following:

  1. Make sure the contract address is the one of our liquid staking contract: (osmo1f5vfcph2dvfeqcqkhetwv75fda69z7e5c2dldm3kvgj23crkv6wqcn47a0)

  2. The batch_id provided matches the value returned by the liquid_unstake operation execution.

our GitHub
milkyway-labs/milkyway-contracts
staking contract
treasury contract
Osmosis
View
View