APIs specification
Last updated
Last updated
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)
In order to get the information of milkTIA, you can use the following endpoint:
In order to get the unbonding requests of a user, you can use the following endpoint:
Query params:
userAddress
: the address of the user
In order to get the information about the next batch of a protocol, you can use the following endpoint:
In order to get a single unbonding request, you can use the following endpoint:
Query params:
recordID
: the ID of the unbonding record
These APIs have been deprecated and should not be used.
In order to get the smart contract state of MilkTIA, you can use the following endpoint:
In order to get the total value locked in MilkTIA, you can use the following endpoint:
In order to get the annual percentage rate of MilkTIA, you can use the following endpoint:
In order to get the rates history of MilkTIA, you can use the following endpoint:
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
In order to get the current redemption rate of MilkTIA, you can use the following endpoint:
In order to get the requests of a user, you can use the following endpoint:
Path params:
address
: the address of the user
In order to get the currently unstaking amount of MilkTIA, you can use the following endpoint:
In order to get the milkTIA price, you can use the following endpoint:
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¤cy=usd
will return the price of 1 milkTIA (1000000umilktia
) in USD
/milktia/price?amount=100¤cy=tia
will return the price of 100 milkTIA (100000000umilktia
) in TIA tokens
In order to get the milkTIA generated fees in a time range, you can use the following endpoint:
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¤cy=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¤cy=tia
will return the fees generated in TIA tokens between 2024-06-01T00:00:00Z
and 2024-06-02T00:00:00Z
In order to get the milkTIA daily generated fees, you can use the following endpoint:
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
In order to get the milkTIA total generated fees, you can use the following endpoint:
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