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
  • Version 2
  • Getting the information about milkTIA
  • Getting the unbonding requests of a user
  • Getting the information about the next batch of a protocol
  • Getting a single unbonding request
  • Version 1
  • Getting the smart contract state
  • Getting the total value locked (TVL)
  • Getting the annual percentage rate (APR)
  • Getting the redemption rates
  • Getting unstake requests of a user
  • Getting the currently unstaking amount
  • Getting milkTIA price
  • Getting milkTIA fee details
  1. User Guides
  2. For Liquid Stakers
  3. For Celestia (milkTIA)
  4. Integrating with milkTIA

APIs specification

PreviousContract SpecificationsNextUsing third party apps

Last updated 3 months ago

In order to make it easier for developers to integrate with our protocol, we also provide a set of APIs endpoints that can be used to develop your applications.

All the following endpoints can be accessed at https://apis.milkyway.zone.

  • (Deprecated)


Version 2

Getting the information about milkTIA

In order to get the information of milkTIA, you can use the following endpoint:

GET /v2/protocols/osmosis.milkTIA

Getting the unbonding requests of a user

In order to get the unbonding requests of a user, you can use the following endpoint:

GET /v2/protocols/osmosis.milkTIA/unbonding-records?userAddress=<userAddress>

Query params:

  • userAddress: the address of the user

Getting the information about the next batch of a protocol

In order to get the information about the next batch of a protocol, you can use the following endpoint:

GET /v2/protocols/osmosis.milkTIA/next-batch

Getting a single unbonding request

In order to get a single unbonding request, you can use the following endpoint:

GET /v2/protocols/osmosis.milkTIA/unbonding-records/:recordID

Query params:

  • recordID: the ID of the unbonding record


Version 1

These APIs have been deprecated and should not be used.

Getting the smart contract state

In order to get the smart contract state of MilkTIA, you can use the following endpoint:

GET /milktia/contract-state

Getting the total value locked (TVL)

In order to get the total value locked in MilkTIA, you can use the following endpoint:

GET /milktia/tvl

Getting the annual percentage rate (APR)

In order to get the annual percentage rate of MilkTIA, you can use the following endpoint:

GET /milktia/apr

Getting the redemption rates

Historical redemption rates

In order to get the rates history of MilkTIA, you can use the following endpoint:

GET /milktia/rates/history?since=<timestamp>&order=<asc|desc>

Query params:

  • since: the timestamp from which the rates should be returned, in RFC3339 format (e.g. 2021-01-01T00:00:00Z) If not provided, the rates will be limited to a two weeks period.

  • order: the order in which the rates should be returned. The available options are:

    • asc, to return the rates in ascending order (default value)

    • desc, to return the rates in descending order

Current redemption rate

In order to get the current redemption rate of MilkTIA, you can use the following endpoint:

GET /milktia/rates/current

Getting unstake requests of a user

In order to get the requests of a user, you can use the following endpoint:

GET /milktia/unstake-requests/:address

Path params:

  • address: the address of the user

Getting the currently unstaking amount

In order to get the currently unstaking amount of MilkTIA, you can use the following endpoint:

GET /milktia/unstaking

Getting milkTIA price

In order to get the milkTIA price, you can use the following endpoint:

GET /milktia/price?amount=<amount>&currency=<currency>

Query params:

  • amount: the amount of milkTIA, expressed as milkTIA tokens (not umilktia)

  • currency: the currency in which the price should be expressed. The available options are:

    • tia, to express the price in TIA tokens (not utia)

    • fiat currencies

Examples:

  • /milktia/price?amount=1&currency=usd will return the price of 1 milkTIA (1000000umilktia) in USD

  • /milktia/price?amount=100&currency=tia will return the price of 100 milkTIA (100000000umilktia) in TIA tokens

Getting milkTIA fee details

Getting milkTIA generated fees in a time range

In order to get the milkTIA generated fees in a time range, you can use the following endpoint:

GET /milktia/fees/range?from=<RFC3339 timestamp>&to=<RFC3339 timestamp>&currency=<currency>

Query params:

  • from: the timestamp from which the fees should be returned, in RFC3339 format (e.g. 2021-01-01T00:00:00Z). If not provided will fall back to the current server time - 24 hours.

  • to: the timestamp until which the fees should be returned, in RFC3339 format (e.g. 2021-01-01T00:00:00Z). If not provided will fall back to the current server time.

  • currency: the currency in which the fees should be expressed. The available options are:

    • tia, to express the fees in TIA tokens (not utia)

    • fiat currencies

NOTE: The max range is 30 days.

Examples:

  • /milktia/fees/range?currency=usd will return the fees generated in usd in the last 24 hours

  • /milktia/fees/range?currency=tia will return the fees generated in TIA tokens in the last 24 hours

  • /milktia/fees/range?from=2021-01-01T00:00:00Z&to=2021-01-02T00:00:00Z&currency=usd will return the fees generated in usd between 2024-06-01T00:00:00Z and 2024-06-02T00:00:00Z

  • /milktia/fees/range?from=2021-01-01T00:00:00Z&to=2021-01-02T00:00:00Z&currency=tia will return the fees generated in TIA tokens between 2024-06-01T00:00:00Z and 2024-06-02T00:00:00Z

Getting milkTIA daily generated fees

In order to get the milkTIA daily generated fees, you can use the following endpoint:

GET /milktia/fees/daily?day=<YYYY-MM-dd>&currency=<currency>

Query params:

  • day: the day for which the fees should be returned, in YYYY-MM-dd format (e.g. 2021-01-01)

  • currency: the currency in which the fees should be expressed. The available options are:

    • tia, to express the fees in TIA tokens (not utia)

    • usd, to express the fees in USD

Getting milkTIA total generated fees

In order to get the milkTIA total generated fees, you can use the following endpoint:

GET /milktia/fees/total?currency=<currency>

Query params:

  • currency: the currency in which the fees should be expressed. The available options are:

    • tia, to express the fees in TIA tokens (not utia)

    • fiat currencies

Examples:

  • /milktia/fees/total?currency=usd will return the total generated fees of milkTIA in usd

  • /milktia/fees/total?currency=tia will return the total generated fees of milkTIA in TIA tokens

Version 2
Version 1
Getting the smart contract state
Getting the total value locked (TVL)
Getting the annual percentage rate (APR)
Getting the redemption rates
Getting unstake requests of a user
Getting the currently unstaking amount
Getting milkTIA price
Getting milkTIA fee details