API V2
MuesliSwap provides a small number of beta API endpoints for querying the state of the DEX. The following is an incomplete list of endpoints, subject to change. Token decimals have to be accounted for by the client, unless explicitely stated.
This API covers both trades through Orderbook contract v1 and v2.
There are a number of endpoints that align with the specification of Cryptocurrency exchange listings like CoinMarketCap or CoinGecko.
The ticker endpoint is to provide a 24-hour pricing and volume summary for each market pair available on the exchange. The quote volume is in ADA.
{
"8a1cfae21368b8bebbbed9800fec304e95cce39a2a57dc35e2e3ebaa.MILK_ADA": {
"last_price": 2.09,
"base_volume": 93662,
"quote_volume": 166684.208
},
...
}
The trades endpoint is to return data on all recently completed trades for a given market pair. The quote volume is in lovelace.
[
{
"trade_id": 49,
"base_volume": 50000000,
"quote_volume": 104500000,
"timestamp": 1642667477,
"type": "buy"
},
{
"trade_id": 50,
"base_volume": 20000000,
"quote_volume": 43000000,
"timestamp": 1642667290,
"type": "buy"
},
The current state of the orderbook can be queried directly from our endpoint. It contains information on what token is traded against which other (where "." denotes ADA), and a list of buy and sell orders. Each order consists of three data points:
lvlPerToken
The price per token in this offer, in lovelace, rounded to 11 decimal placesamount
The amount of token to be boughttotalLvl
The total amount of lovelace to be spent on all tokens to be bought
{
"bidToken": ".",
"askToken": "8a1cfae21368b8bebbbed9800fec304e95cce39a2a57dc35e2e3ebaa.MILK",
"buy": [
{
"lvlPerToken": 2100000,
"amount": 1,
"totalLvl": 2100000
},
{
"lvlPerToken": 2100000,
"amount": 1,
"totalLvl": 2100000
},
...
],
"sell": [
{
"lvlPerToken": 2000000,
"amount": 500,
"totalLvl": 1000000000
},
{
"lvlPerToken": 2090000,
"amount": 750,
"totalLvl": 1567500000
},
...
]
}
We provide endpoints for historical data on finalized trades as well as the volume on the exchange.
The price endpoint provides a detailed overview of historical trades as an
hourly
or daily
summary. Each summary starts at 0 minutes into the hour/day respectively and summarizes the following information for the interval. Prices are provided in ADA.open
The price of the first trade in the intervalclose
The price of the last trade in the intervaltimestamp
The UNIX timestamp of the beginning of the intervallow
The lowest price of any trade within the intervalhigh
The highest price of any trade within the interval
[
{
"open": "0.64",
"close": "0.65",
"timetamp": 1640075400,
"high": "0.75",
"low": "0.6",
"median": "0.655"
},
{
"open": "0.6599999999999999",
"close": "0.64",
"timetamp": 1640079000,
"high": "0.68",
"low": "0.525",
"median": "0.605"
},
The volume endpoint provides detailed data on the daily volume of a token. The volume is the sum over all tokens or ADA contained in matched orders during the specified time interval. Each datapoint is specified by three values:
time
The UNIX timestamp of the beginning of the intervalvolumeToken
The volume of the token involved in token exchanges in the intervalvolumeAda
The volume of ADA involved in token exchanges in the interval
[
{
"time": 1638273600,
"volumeToken": "32059",
"volumeADA": "7364.764999999999"
},
{
"time": 1638360000,
"volumeToken": "51490",
"volumeADA": "11166.83"
},
In this section, we simply highlight certain tools that have been built on top of our API and contract. We take no liability for the quality of these services and do encourage some caution before employing these tools.
Twitter user @cardanostra wrote a small thread on importing live price feed data into Google Sheets: https://twitter.com/cardanostra/status/1488522351985799173
Cardanians built a pretty overview on all currently available tokens on the network, including data on the prices and volume powered by the MuesliSwap API: https://cardanoassets.com/
This website shows the most recent trades for featured tokens on the MuesliSwap page: https://yummymuesli.com/
Last modified 4mo ago