Marketdata deprecation + Migration guide


#1

Adieu to Marketdata

Waves Platform is company fueled by innovation, which to us means trying lots of new things all the time – and sometimes it means reconsidering our goals for old products.

We’ve recently determined that some users have a lot of problems with Marketdata due to a large amount of legacy code and the lack of maintainers.

With the discovery of bugs, the inability to further support and availability of modern, more powerful and scalable alternative as Data Service we decided to deprecate Marketdata API. It is deprecated and is no longer maintained.

We have decided to shut-down of all Marketdata APIs within June 2019.

Next steps for Marketdata users

If you use Marketdata API we highly recommend you to migrate to alternative APIs till 1 April 2019. The guide below describes alternative ways to get data provided by Marketdada, mostly by using Data-service API.


#2

Migration from Marketdata to Data-service guide


Asset Symbols

Get list of asset symbols

Summary

Marketdata request

Request Description
GET /symbols Get a list of asset symbols and IDs

Note: symbol is now called ticker.

Data-service alternative

Request Description
GET /assets?ticker=* Get a list of all assets having a non-empty ticker

Schemas and examples

Marketdata

Request

GET /symbols

Response schema
[
    {
      "symbol" : string,
      "assetID" : string
    },
    ...
]
Example

GET /symbols

[
    {
        "symbol" : "ETH",
        "assetID" : "474jTeYx2r2Va35794tCScAXWJG9hU2HcgxzMowaZUnu"
    },
    ...
]

Data-service alternative

Request

Data-service Docs for the request

GET /assets?ticker=*

Response schema
{
    "__type": "list",
    "data": [
        {
            "__type": "asset",
            "data": {
                "ticker": string,
                "id": string,
                "name": string,
                "precision": number,
                "description": string,
                "height": number,
                "timestamp": string (Date in ISO format),
                "sender": string,
                "quantity": number,
                "reissuable": boolean
            }
        }
    ]
}
Example

GET /assets?ticker=*

{
    "__type": "list",
    "data": [
        {
            "__type": "asset",
            "data": {
                "ticker": "ETH",
                "id": "474jTeYx2r2Va35794tCScAXWJG9hU2HcgxzMowaZUnu",
                "name": "WETH",
                "precision": 8,
                "description": "Ethereum Token",
                "height": 585888,
                "timestamp": "2017-07-18T10:39:08.683Z",
                "sender": "3PAfgHQPgodM6MxUzqRkepiKofGnECNoxt5",
                "quantity": 9999999999374092,
                "reissuable": true
            }
        },
        ...
    ]
}
Response mapping
Marketdata Data-service
symbol ticker
assetID id

Markets

Get a list of all traded markets with 24h stats

Summary

Marketdata request

Request Description
GET /markets Get an unlimited list of tickers with 24h stats of all traded markets

Note: This request does not scale, since it returns whole history, which is constatnly growing. Data-service does not provide a complete alternative as a single request, its response is limited. But it is possible to get the necessary data by composing several requests.

Data-service alternative

# Request Description
1 GET /assets?ticker=* Get a list of all assets having a non-empty ticker
2 GET /pairs?pairs={AMOUNT_ASSET_ID}/{PRICE_ASSET_ID}&pairs=... Get a list of pairs info with 24h stats by serialized pairs list
3 GET {NODES_URL}/assets/balance/${ISSUER_ADDRESS}/${ASSET_ID} Get the asset issuer balance (need for circulating supply value)
4 GET /transactions/exchange?amountAsset={AMOUNT_ASSET_ID}&priceAsset={PRICE_ASSET_ID}&sort=asc&limit=1 Get the first trade day
5 GET /transactions/exchange?amountAsset={AMOUNT_ASSET_ID}&priceAsset={PRICE_ASSET_ID}&sort=desc&limit=1 Get the last trade day

Schemas and examples

Marketdata

Request

GET /markets

Response schema
[
    {
        "symbol" : string,
        "amountAssetID" : string,
        "amountAssetName" : string,
        "amountAssetDecimals" : number,
        "amountAssetTotalSupply" : string,
        "amountAssetMaxSupply" : string,
        "amountAssetCirculatingSupply" : string,
        "priceAssetID" : string,
        "priceAssetName" : string,
        "priceAssetDecimals" : number,
        "priceAssetTotalSupply" : string,
        "priceAssetMaxSupply" : string,
        "priceAssetCirculatingSupply" : string,
        "24h_open" : string,
        "24h_high" : string,
        "24h_low" : string,
        "24h_close" : string,
        "24h_vwap" : string,
        "24h_volume" : string,
        "24h_priceVolume" : string,
        "totalTrades" : number,
        "firstTradeDay" : number (js timestamp),
        "lastTradeDay" : number (js timestamp)
    },
    ...
]
Example

GET /markets

[
    {
        "symbol" : "[email protected]/BTC",
        "amountAssetID" : "APz41KyoKuBBh8t3oZjqvhbbsg6f63tpZM5Ck5LYx6h",
        "amountAssetName" : "[email protected]",
        "amountAssetDecimals" : 8,
        "amountAssetTotalSupply" : "25000000.00000000",
        "amountAssetMaxSupply" : "infinite",
        "amountAssetCirculatingSupply" : "11411669.00000000",
        "priceAssetID" : "8LQW8f7P5d5PZM7GtZEBgaqRPGSzS3DfPuiXrURJ4AJS",
        "priceAssetName" : "WBTC",
        "priceAssetDecimals" : 8,
        "priceAssetTotalSupply" : "21000000.00000000",
        "priceAssetMaxSupply" : "21000000.00000000",
        "priceAssetCirculatingSupply" : "1769.00000000",
        "24h_open" : "0.00040000",
        "24h_high" : "0.00040000",
        "24h_low" : "0.00040000",
        "24h_close" : "0.00040000",
        "24h_vwap" : "0.00040000",
        "24h_volume" : "40.00000000",
        "24h_priceVolume" : "0.01600000",
        "totalTrades" : 110,
        "firstTradeDay" : 1493251200000,
        "lastTradeDay" : 1493251308864
    },
    ...
]

Data-service alternative

Request #1

Data-service Docs for the request

GET /assets?ticker=*

Response schema
{
    "__type": "list",
    "data": [
        {
            "__type": "asset",
            "data": {
                "ticker": string,
                "id": string,
                "name": string,
                "precision": number,
                "description": string,
                "height": number,
                "timestamp": string (Date in ISO format),
                "sender": string,
                "quantity": number,
                "reissuable": boolean
            }
        }
    ]
}
Request #2

GET /pairs?pairs={AMOUNT_ASSET_ID}/{PRICE_ASSET_ID}&pairs=...

Param Type Description
AMOUNT_ASSET_ID string Amount asset ID
PRICE_ASSET_ID string Price asset ID
Response schema
{
  "__type": "list",
  "data": [
    {
      "__type": "pair",
      "data": {
        "firstPrice": number,
        "lastPrice": number,
        "low": number,
        "high": number,
        "weightedAveragePrice": number,
        "volume": number,
        "quoteVolume": number,
        "volumeWaves": number,
        "txsCount": number
      }
    }
  ]
}
Example

GET /pairs?pairs=WAVES/8LQW8f7P5d5PZM7GtZEBgaqRPGSzS3DfPuiXrURJ4AJS

{
  "__type": "list",
  "data": [
    {
      "__type": "pair",
      "data": {
        "firstPrice": 0.00073098,
        "lastPrice": 0.00073235,
        "low": 0.0007002,
        "high": 0.00074959,
        "weightedAveragePrice": 0.000723188893549432,
        "volume": 81722.12995089,
        "quoteVolume": 59.1005367376871,
        "volumeWaves": 81722.12995089,
        "txsCount": 4579
      }
    }
  ]
}
Request #3

GET {NODES_URL}/assets/balance/{ISSUER_ADDRESS}/{ASSET_ID}

Param Type Description
NODES_URL string Nodes API url (e.g. https://nodes.wavesnodes.com/)
ISSUER_ADDRES string Address of an {ASSET_ID} issuer
ASSET_ID string Asset ID
Response schema
{
    "address": string,
    "assetId": string,
    "balance": number
}
Example

GET https://nodes.wavesnodes.com/assets/balance/3PC4roN512iugc6xGVTTM2XkoWKEdSiiscd/8LQW8f7P5d5PZM7GtZEBgaqRPGSzS3DfPuiXrURJ4AJS

{
    "address": "3PC4roN512iugc6xGVTTM2XkoWKEdSiiscd",
    "assetId": "8LQW8f7P5d5PZM7GtZEBgaqRPGSzS3DfPuiXrURJ4AJS",
    "balance": 2099723208288513
}
Request #4

Data-service Docs for Request

GET /transactions/exchange?amountAsset={AMOUNT_ASSET_ID}&priceAsset={PRICE_ASSET_ID}&sort=asc&limit=1

Param Type Description
AMOUNT_ASSET_ID string Amount asset ID
PRICE_ASSET_ID string Price asset ID
Response Schema
{
    "__type": "list",
    "lastCursor": string,
    "data": [
        {
            "__type": "transaction",
            "data": {
                "id": string,
                "timestamp": Date,
                "height": number,
                "type": number,
                "version": number | null,
                "proofs": string[],
                "fee": number,
                "sender": string,
                "senderPublicKey": string,
                "buyMatcherFee": number,
                "sellMatcherFee": number,
                "price": number,
                "amount": number,
                "order1": {
                "id": string,
                    "senderPublicKey": string,
                    "matcherPublicKey": string,
                    "assetPair": {
                        "amountAsset": string,
                        "priceAsset": string
                    },
                    "orderType": string,
                    "price": number,
                    "sender": string,
                    "amount": number,
                    "timestamp": string (Date in ISO format),
                    "expiration": string (Date in ISO format),
                    "matcherFee": number,
                    "signature"?: string,
                    "proofs"?: string[]
                },
                "order2": {
                    "id": string,
                    "senderPublicKey": string,
                    "matcherPublicKey": string,
                    "assetPair": {
                        "amountAsset": string,
                        "priceAsset": string
                    },
                    "orderType": string,
                    "price": number,
                    "sender": string,
                    "amount": number,
                    "timestamp": string (Date in ISO format),
                    "expiration": string (Date in ISO format),
                    "matcherFee": number,
                    "signature"?: string,
                    "proofs"?: string[]
                }
            }
        },
        ...
    ]
}
Example

GET /transactions/exchange?amountAsset=WAVES&priceAsset=8LQW8f7P5d5PZM7GtZEBgaqRPGSzS3DfPuiXrURJ4AJS&sort=asc&limit=1

{
    "__type": "list",
    "lastCursor": "MjAxOS0wMS0wOVQxMTozNjozNi42MTZaOjozMjkzQUZDV2tRcEFuZ2V0TXByQWdLOGlGdWM5Z1RGTXdkQVFGcHBRY2s4Zzo6ZGVzYw==",
    "data": [
        {
            "__type": "transaction",
            "data": {
                "id": "2FRvfTdDN98fzEF8HYQcgsiRp5PaXsHuCaY2Vkayp1Kw",
                "timestamp": "2019-01-09T12:07:29.219Z",
                "height": 1343569,
                "type": 7,
                "version": 2,
                "proofs": [
                "47eNFeQrjDtLLWsxKSmWjCJAK2d8epZgjFpRQ3T3yNrVE6efR3G9UNQeu3icyuh4eLdRoR8BtM3AHi95yy6QrYeN"
                ],
                "fee": 0.003,
                "sender": "3PJaDyprvekvPXPuAtxrapacuDJopgJRaU3",
                "senderPublicKey": "7kPFrHDiGw1rCm7LPszuECwWYL3dMf6iMifLRDJQZMzy",
                "buyMatcherFee": 0.00017801,
                "sellMatcherFee": 0.003,
                "price": 0.00071797,
                "amount": 15,
                "order1": {
                    "id": "9vFwkcK6dECwRJ6sLScAmPVj9Y1UoK5ZQH3LjCK79gdc",
                    "senderPublicKey": "6V6Cki1AP2u2zRDT3CYubkSKP8ikZEytJ4T99BjieDo",
                    "matcherPublicKey": "7kPFrHDiGw1rCm7LPszuECwWYL3dMf6iMifLRDJQZMzy",
                    "assetPair": {
                        "amountAsset": "WAVES",
                        "priceAsset": "8LQW8f7P5d5PZM7GtZEBgaqRPGSzS3DfPuiXrURJ4AJS"
                    },
                    "orderType": "buy",
                    "price": 0.00071797,
                    "sender": "3PAB7s5JGr6ggGkpTcM2cEhq1buDX3CkaQh",
                    "amount": 252.78062166,
                    "timestamp": "2019-01-09T12:07:23.065Z",
                    "expiration": "2019-01-09T14:07:23.065Z",
                    "matcherFee": 0.003,
                    "signature": "3JdJ7WKe5s2M4rNbzrmxAvTCycUsrXvHYH4ayWS7gheJaT9HrSJpgiFYXdCwUQJRaaDNXC3AY5yoDepR129pCUZG"
                },
                "order2": {
                    "id": "EVKVqmWyy3doUU53Cqi8BZ2sn6PCLdhHoLShC8hmCpMJ",
                    "senderPublicKey": "4gmFnncST7SjHjTpys78uCmUsMCZ8kudAmvjvqpVuYKt",
                    "matcherPublicKey": "7kPFrHDiGw1rCm7LPszuECwWYL3dMf6iMifLRDJQZMzy",
                    "assetPair": {
                        "amountAsset": "WAVES",
                        "priceAsset": "8LQW8f7P5d5PZM7GtZEBgaqRPGSzS3DfPuiXrURJ4AJS"
                    },
                    "orderType": "sell",
                    "price": 0.00071797,
                    "sender": "3P72phQTwwiwc7QcNGoKA4wpUsqCuT5eMJ3",
                    "amount": 15,
                    "timestamp": "2019-01-09T12:07:29.213Z",
                    "expiration": "2019-02-08T12:07:29.213Z",
                    "matcherFee": 0.003,
                    "signature": "4sVC1o81bhbjhXZ1HYBgFq2UUHh5UhRLa9HHHmAwPooNnoEvJkqJcP4JBXeNjTYvJMm48duRxyuXNKRktRG2nbwA"
                }
            }
        },
        ...
    ]
}
Request #5

GET /transactions/exchange?amountAsset={AMOUNT_ASSET_ID}&priceAsset={PRICE_ASSET_ID}&sort=desc&limit=1

Param Type Description
AMOUNT_ASSET_ID string Amount asset ID
PRICE_ASSET_ID string Price asset ID
Response Schema
{
    "__type": "list",
    "lastCursor": string,
    "data": [
        {
            "__type": "transaction",
            "data": {
                "id": string,
                "timestamp": Date,
                "height": number,
                "type": number,
                "version": number | null,
                "proofs": string[],
                "fee": number,
                "sender": string,
                "senderPublicKey": string,
                "buyMatcherFee": number,
                "sellMatcherFee": number,
                "price": number,
                "amount": number,
                "order1": {
                "id": string,
                    "senderPublicKey": string,
                    "matcherPublicKey": string,
                    "assetPair": {
                        "amountAsset": string,
                        "priceAsset": string
                    },
                    "orderType": string,
                    "price": number,
                    "sender": string,
                    "amount": number,
                    "timestamp": string (Date in ISO format),
                    "expiration": string (Date in ISO format),
                    "matcherFee": number,
                    "signature"?: string,
                    "proofs"?: string[]
                },
                "order2": {
                    "id": string,
                    "senderPublicKey": string,
                    "matcherPublicKey": string,
                    "assetPair": {
                        "amountAsset": string,
                        "priceAsset": string
                    },
                    "orderType": string,
                    "price": number,
                    "sender": string,
                    "amount": number,
                    "timestamp": string (Date in ISO format),
                    "expiration": string (Date in ISO format),
                    "matcherFee": number,
                    "signature"?: string,
                    "proofs"?: string[]
                }
            }
        },
        ...
    ]
}
Response mapping

Marketdata returns data including information about each of assets and 24h stats for assets pair, but Data-service can return this data on different requests.

Table legend:

  • Request #1 - #1
  • Request #2 - #2
  • amount asset - (1)
  • price asset - (2)
Marketdata Data-service Description
symbol #1.ticker(1)/#1.ticker(2) Take the field ticker from the Request #1; (1) - amount asset, (2) - price asset
amountAssetID #1.id(1) id from the Request #1; (1) - amount asset
amountAssetName #1.name(1) name from the Request #1; (1) - amount asset
amountAssetDecimals #1.precision(1) precision from the Request #1
amountAssetTotalSupply #1.quantity(1)/10^#1.precision(1) Take fields quantity and precision from the Request #1 and calculate amountAssetTotalSupply; (1) - amount asset
amountAssetMaxSupply ‘infinity’ or #1.quantity(1)/10^#1.precision(1) If the field reissuble (from the Request #1) of an amount asset is equal to true, then amountAssetMaxSupply='infinity', else take fields quantity and precision from the Request #1 and calculate amountAssetMaxSupply; (1) - amount asset
amountAssetCirculatingSupply #1.quantity(1) - #3.balance(1) Take the field quantity from the Request #1 and balance from Request #3, calculate amountAssetCirculatingSupply; (1) - amount asset
priceAssetID #1.id(2) id from the Request #1; (2) - price asset
priceAssetName #1.name(2) name from the Request #1; (2) - price asset
priceAssetDecimals #1.precision(2) precision from the Request #1; (2) - price asset
priceAssetTotalSupply #1.quantity(2)/10^#1.precision(2) Take fields quantity and precision from the Request #1 and calculate priceAssetTotalSupply; (2) - price asset
priceAssetMaxSupply ‘infinity’ or #1.quantity(2)/10^#1.precision(2) If the field reissuble (from the Request #1) of a price asset is equal to true, then priceAssetMaxSupply='infinity', else take fields quantity and precision from the Request #1 and calculate priceAssetMaxSupply; (2) - price asset
priceAssetCirculatingSupply #1.quantity(2) - #3.balance(2) Take the field quantity from the Request #1 and and balance from the Request #3, calculate amountAssetCirculatingSupply
24h_open #2.firstPrice firstPrice from the Request #2
24h_high #2.high high from the Request #2
24h_low #2.low low from the Request #2
24h_close #2.lastPrice THe field lastPrice from the Request #2
24h_vwap #2.weightedAveragePrice weightedAveragePrice from the Request #2
24h_volume #2.volume volume from the Request #2
24h_priceVolume #2.quoteVolume quoteVolume from the Request #2
totalTrades #2.txsCount txsCount from the Request #2
firstTradeDay #4.timestamp timestamp from the Request #4
lastTradeDay #5.timestamp timestamp from the Request #5

#3

Tickers

Get tickers for all traded markets

Summary

Marketdata request

Request Description
GET /tickers Get an unlimited list of tickers with 24h stats of all traded markets

Data-service alternative

# Request Description
1 GET /assets?ticker=* Get a list of all assets having a non-empty ticker
2 GET /pairs?pairs={AMOUNT_ASSET_ID}/{PRICE_ASSET_ID}&pairs=... Get a list of pairs info with 24h stats by serialized pairs list
3 GET {NODES_URL}/assets/balance/${ISSUER_ADDRESS}/${ASSET_ID} Get the asset issuer balance (need for circulating supply value)
4 GET /transactions/exchange?amountAsset={AMOUNT_ASSET_ID}&priceAsset={PRICE_ASSET_ID}&sort=asc&limit=1 Get the first trade day
5 GET /transactions/exchange?amountAsset={AMOUNT_ASSET_ID}&priceAsset={PRICE_ASSET_ID}&sort=desc&limit=1 Get the last trade day

Schemas and examples

Marketdata

Request

GET /tickers

Response schema
[
    {
        "symbol" : string,
        "amountAssetID" : string,
        "amountAssetName" : string,
        "amountAssetDecimals" : number,
        "amountAssetTotalSupply" : string,
        "amountAssetMaxSupply" : string,
        "amountAssetCirculatingSupply" : string,
        "priceAssetID" : string,
        "priceAssetName" : string,
        "priceAssetDecimals" : number,
        "priceAssetTotalSupply" : string,
        "priceAssetMaxSupply" : string,
        "priceAssetCirculatingSupply" : string,
        "24h_open" : string,
        "24h_high" : string,
        "24h_low" : string,
        "24h_close" : string,
        "24h_vwap" : string,
        "24h_volume" : string,
        "24h_priceVolume" : string,
        "timestamp" : number
    },
    ...
]
Example

GET /tickers

[
    {
        "symbol" : "[email protected]/BTC",
        "amountAssetID" : "APz41KyoKuBBh8t3oZjqvhbbsg6f63tpZM5Ck5LYx6h",
        "amountAssetName" : "[email protected]",
        "amountAssetDecimals" : 8,
        "amountAssetTotalSupply" : "25000000.00000000",
        "amountAssetMaxSupply" : "infinite",
        "amountAssetCirculatingSupply" : "11411669.00000000",
        "priceAssetID" : "8LQW8f7P5d5PZM7GtZEBgaqRPGSzS3DfPuiXrURJ4AJS",
        "priceAssetName" : "WBTC",
        "priceAssetDecimals" : 8,
        "priceAssetTotalSupply" : "21000000.00000000",
        "priceAssetMaxSupply" : "21000000.00000000",
        "priceAssetCirculatingSupply" : "1769.00000000",
        "24h_open" : "0.00040000",
        "24h_high" : "0.00040000",
        "24h_low" : "0.00040000",
        "24h_close" : "0.00040000",
        "24h_vwap" : "0.00040000",
        "24h_volume" : "40.00000000",
        "24h_priceVolume" : "0.01600000",
        "timestamp" : 1498798060195
    },
    ...
]

Data-service alternative

Request #1

Data-service Docs for the request

GET /assets?ticker=*

Response schema
{
    "__type": "list",
    "data": [
        {
            "__type": "asset",
            "data": {
                "ticker": string,
                "id": string,
                "name": string,
                "precision": number,
                "description": string,
                "height": number,
                "timestamp": string (Date in ISO format),
                "sender": string,
                "quantity": number,
                "reissuable": boolean
            }
        }
    ]
}
Request #2

GET /pairs?pairs={AMOUNT_ASSET_ID}/{PRICE_ASSET_ID}&pairs=...

Param Type Description
AMOUNT_ASSET_ID string Amount asset ID
PRICE_ASSET_ID string Price asset ID
Response schema
{
  "__type": "list",
  "data": [
    {
      "__type": "pair",
      "data": {
        "firstPrice": number,
        "lastPrice": number,
        "low": number,
        "high": number,
        "weightedAveragePrice": number,
        "volume": number,
        "quoteVolume": number,
        "volumeWaves": number,
        "txsCount": number
      }
    }
  ]
}
Request #3

GET {NODES_URL}/assets/balance/{ISSUER_ADDRESS}/{ASSET_ID}

Param Type Description
NODES_URL string Nodes API url (e.g. http://nodes.wavesnodes.com/)
ISSUER_ADDRES string Address of an {ASSET_ID} issuer
ASSET_ID string Asset ID
Response schema
{
    "address": string,
    "assetId": string,
    "balance": number
}
Request #4

Data-service Docs for Request

GET /transactions/exchange?amountAsset={AMOUNT_ASSET_ID}&priceAsset={PRICE_ASSET_ID}&sort=asc&limit=1

Param Type Description
AMOUNT_ASSET_ID string Amount asset ID
PRICE_ASSET_ID string Price asset ID
Response Schema
{
    "__type": "list",
    "lastCursor": string,
    "data": [
        {
            "__type": "transaction",
            "data": {
                "id": string,
                "timestamp": Date,
                "height": number,
                "type": number,
                "version": number | null,
                "proofs": string[],
                "fee": number,
                "sender": string,
                "senderPublicKey": string,
                "buyMatcherFee": number,
                "sellMatcherFee": number,
                "price": number,
                "amount": number,
                "order1": {
                "id": string,
                    "senderPublicKey": string,
                    "matcherPublicKey": string,
                    "assetPair": {
                        "amountAsset": string,
                        "priceAsset": string
                    },
                    "orderType": string,
                    "price": number,
                    "sender": string,
                    "amount": number,
                    "timestamp": string (Date in ISO format),
                    "expiration": string (Date in ISO format),
                    "matcherFee": number,
                    "signature"?: string,
                    "proofs"?: string[]
                },
                "order2": {
                    "id": string,
                    "senderPublicKey": string,
                    "matcherPublicKey": string,
                    "assetPair": {
                        "amountAsset": string,
                        "priceAsset": string
                    },
                    "orderType": string,
                    "price": number,
                    "sender": string,
                    "amount": number,
                    "timestamp": string (Date in ISO format),
                    "expiration": string (Date in ISO format),
                    "matcherFee": number,
                    "signature"?: string,
                    "proofs"?: string[]
                }
            }
        },
        ...
    ]
}
Request #5

GET /transactions/exchange?amountAsset={AMOUNT_ASSET_ID}&priceAsset={PRICE_ASSET_ID}&sort=desc&limit=1

Param Type Description
AMOUNT_ASSET_ID string Amount asset ID
PRICE_ASSET_ID string Price asset ID
Response Schema
{
    "__type": "list",
    "lastCursor": string,
    "data": [
        {
            "__type": "transaction",
            "data": {
                "id": string,
                "timestamp": Date,
                "height": number,
                "type": number,
                "version": number | null,
                "proofs": string[],
                "fee": number,
                "sender": string,
                "senderPublicKey": string,
                "buyMatcherFee": number,
                "sellMatcherFee": number,
                "price": number,
                "amount": number,
                "order1": {
                "id": string,
                    "senderPublicKey": string,
                    "matcherPublicKey": string,
                    "assetPair": {
                        "amountAsset": string,
                        "priceAsset": string
                    },
                    "orderType": string,
                    "price": number,
                    "sender": string,
                    "amount": number,
                    "timestamp": string (Date in ISO format),
                    "expiration": string (Date in ISO format),
                    "matcherFee": number,
                    "signature"?: string,
                    "proofs"?: string[]
                },
                "order2": {
                    "id": string,
                    "senderPublicKey": string,
                    "matcherPublicKey": string,
                    "assetPair": {
                        "amountAsset": string,
                        "priceAsset": string
                    },
                    "orderType": string,
                    "price": number,
                    "sender": string,
                    "amount": number,
                    "timestamp": string (Date in ISO format),
                    "expiration": string (Date in ISO format),
                    "matcherFee": number,
                    "signature"?: string,
                    "proofs"?: string[]
                }
            }
        },
        ...
    ]
}
Response mapping

Marketdata returns data including information about each of the assets and 24h stats for assets pair, but Data-service can return this data on different requests.

Table legend:

  • Request #1 - #1
  • Request #2 - #2
  • amount asset - (1)
  • price asset - (2)
Marketdata Data-service Description
symbol #1.ticker(1)/#1.ticker(2) Take the field ticker from the Request #1; (1) - amount asset, (2) - price asset
amountAssetID #1.id(1) id from the Request #1; (1) - amount asset
amountAssetName #1.name(1) name from the Request #1; (1) - amount asset
amountAssetDecimals #1.precision(1) precision from the Request #1
amountAssetTotalSupply #1.quantity(1)/10^#1.precision(1) Take fields quantity and precision from the Request #1 and calculate amountAssetTotalSupply; (1) - amount asset
amountAssetMaxSupply ‘infinity’ or #1.quantity(1)/10^#1.precision(1) If the field reissuble (from the Request #1) of an amount asset is equal to true, then amountAssetMaxSupply='infinity', else take fields quantity and precision from the Request #1 and calculate amountAssetMaxSupply; (1) - amount asset
amountAssetCirculatingSupply #1.quantity(1) - #3.balance(1) Take the field quantity from the Request #1 and balance from Request #3, calculate amountAssetCirculatingSupply; (1) - amount asset
priceAssetID #1.id(2) id from the Request #1; (2) - price asset
priceAssetName #1.name(2) name from the Request #1; (2) - price asset
priceAssetDecimals #1.precision(2) precision from the Request #1; (2) - price asset
priceAssetTotalSupply #1.quantity(2)/10^#1.precision(2) Take fields quantity and precision from the Request #1 and calculate priceAssetTotalSupply; (2) - price asset
priceAssetMaxSupply ‘infinity’ or #1.quantity(2)/10^#1.precision(2) If the field reissuble (from the Request #1) of a price asset is equal to true, then priceAssetMaxSupply='infinity', else take fields quantity and precision from the Request #1 and calculate priceAssetMaxSupply; (2) - price asset
priceAssetCirculatingSupply #1.quantity(2) - #3.balance(2) Take the field quantity from the Request #1 and and balance from the Request #3, calculate amountAssetCirculatingSupply
24h_open #2.firstPrice firstPrice from the Request #2
24h_high #2.high high from the Request #2
24h_low #2.low low from the Request #2
24h_close #2.lastPrice lastPrice from the Request #2
24h_vwap #2.weightedAveragePrice weightedAveragePrice from the Request #2
24h_volume #2.volume volume from the Request #2
24h_priceVolume #2.quoteVolume quoteVolume from the Request #2
timestamp Not available Just now

Ticker

Get a ticker for the specified asset pair

Summary

Marketdata request

Request Description
GET /ticker/{AMOUNT_ASSET}/{PRICE_ASSET} Get the last {LIMIT} trades

Data-service alternative

# Request Description
1 GET /assets?ticker={AMOUNT_ASSET} (Optional) Get amount asset info by the ticker
2 GET /assets?ticker={PRICE_ASSET} (Optional) Get price asset info by the ticker
3 GET /pairs/{AMOUNT_ASSET_ID}/{PRICE_ASSET_ID} Get pair info with 24h stats
4 GET {NODES_URL}/assets/balance/${ISSUER_ADDRESS}/${ASSET_ID} Get the asset issuer balance (need for circulating supply value

Schemas and examples

Marketdata

Request

GET /ticker/{AMOUNT_ASSET}/{PRICE_ASSET}

Param Type Description
AMOUNT_ASSET string Amount asset ticker or ID
PRICE_ASSET string Price asset ticker or ID
Response schema
{
    "symbol" : string,
    "amountAssetID" : string,
    "amountAssetName" : string,
    "amountAssetDecimals" : number,
    "amountAssetTotalSupply" : string,
    "amountAssetMaxSupply" : string,
    "amountAssetCirculatingSupply" : string,
    "priceAssetID" : string,
    "priceAssetName" : string,
    "priceAssetDecimals" : number,
    "priceAssetTotalSupply" : string,
    "priceAssetMaxSupply" : string,
    "priceAssetCirculatingSupply" : string,
    "24h_open" : string,
    "24h_high" : string,
    "24h_low" : string,
    "24h_close" : string,
    "24h_vwap" : string,
    "24h_volume" : string,
    "24h_priceVolume" : string,
    "timestamp" : number (js timestamp)
}
Example

GET /ticker/WAVES/BTC

{
    "symbol" : "WAVES/BTC",
    "amountAssetID" : "WAVES",
    "amountAssetName" : "WAVES",
    "amountAssetDecimals" : 8,
    "amountAssetTotalSupply" : "100000000.00000000",
    "amountAssetMaxSupply" : "100000000.00000000",
    "amountAssetCirculatingSupply" : "100000000.00000000",
    "priceAssetID" : "8LQW8f7P5d5PZM7GtZEBgaqRPGSzS3DfPuiXrURJ4AJS",
    "priceAssetName" : "WBTC",
    "priceAssetDecimals" : 8,
    "priceAssetTotalSupply" : "21000000.00000000",
    "priceAssetMaxSupply" : "21000000.00000000",
    "priceAssetCirculatingSupply" : "1769.00000000",
    "24h_open" : "0.00167870",
    "24h_high" : "0.00177000",
    "24h_low" : "0.00150001",
    "24h_close" : "0.00154037",
    "24h_vwap" : "0.00159388",
    "24h_volume" : "38772.93226749",
    "24h_priceVolume" : "61.79940128",
    "timestamp" : 1498798083804
}

Data-service alternative

Request #1

Data-service Docs for Request

GET /assets?ticker={AMOUNT_ASSET}

Param Type Description
AMOUNT_ASSET string Amount asset ticker
Response schema
{
    "__type": "list",
    "data": [
        {
            "__type": "asset",
            "data": {
                "ticker": string,
                "id": string,
                "name": string,
                "precision": number,
                "description": string,
                "height": number,
                "timestamp": string (Date in ISO format),
                "sender": string,
                "quantity": number,
                "reissuable": boolean
            }
        }
    ]
}
Example
{
    "__type": "list",
    "data": [
        {
            "__type": "asset",
            "data": {
                "ticker": "WAVES",
                "id": "WAVES",
                "name": "Waves",
                "precision": 8,
                "description": "",
                "height": 0,
                "timestamp": "2016-04-11T21:00:00.000Z",
                "sender": "",
                "quantity": 10000000000000000,
                "reissuable": false
            }
        }
    ]
}
Request #2

Data-service Docs for Request

GET /assets?ticker={PRICE_ASSET}

Param Type Description
PRICE_ASSET string Price asset ticker
Response schema
{
    "__type": "list",
    "data": [
        {
            "__type": "asset",
            "data": {
                "ticker": string,
                "id": string,
                "name": string,
                "precision": number,
                "description": string,
                "height": number,
                "timestamp": string (Date in ISO format),
                "sender": string,
                "quantity": number,
                "reissuable": boolean
            }
        }
    ]
}
Request #3

Data-service Docs for Request

GET /pairs/{AMOUNT_ASSET_ID}/PRICE_ASSET_ID}

Param Type Description
AMOUNT_ASSET_ID string Amount asset ID
PRICE_ASSET_ID string Price asset ID
Response schema
{
    "__type": "pair",
    "data": {
        "firstPrice": number,
        "lastPrice": number,
        "low": number,
        "high": number,
        "weightedAveragePrice": number,
        "volume": number,
        "quoteVolume": number,
        "volumeWaves": number,
        "txsCount": number
    }
}
Example

GET /pairs/WAVES/8LQW8f7P5d5PZM7GtZEBgaqRPGSzS3DfPuiXrURJ4AJS

{
    "__type": "pair",
    "data": {
        "firstPrice": 0.0007149,
        "lastPrice": 0.00071694,
        "low": 0.00070315,
        "high": 0.00074959,
        "weightedAveragePrice": 0.000720884786947976,
        "volume": 73589.23928945,
        "quoteVolume": 53.0493630868388,
        "volumeWaves": 73589.23928945,
        "txsCount": 4629
    }
}
Request #4

GET {NODES_URL}/assets/balance/{AMOUNT_ASSET_ISSUER_ADDRESS}/{AMOUNT_ASSET_ID}

Param Type Description
NODES_URL string Nodes url
AMOUNT_ASSET_ISSUER_ADDRESS string Address of {AMOUNT_ASSET_ID} issuer
AMOUNT_ASSET_ID string Amount asset ID
Response schema
{
    "address": string,
    "assetId": string,
    "balance": number
}
Request #5

GET {NODES_URL}/assets/balance/{PRICE_ASSET_ISSUER_ADDRESS}/{PRICE_ASSET_ID}

Param Type Description
NODES_URL string Nodes url
PRICE_ASSET_ISSUER_ADDRESS string Address of {PRICE_ASSET_ID} issuer
PRICE_ASSET_ID string Price asset ID
Response schema
{
    "address": string,
    "assetId": string,
    "balance": number
}
Response mapping

Table legend:

  • Request #1 - #1
  • Request #2 - #2
  • amount asset - (1)
  • price asset - (2)
Marketdata Data-service Description
symbol #1.ticker/#2.ticker Take the field ticker from Request #1 and #2
amountAssetID #1.id id from the Request #1
amountAssetName #1.name name from the Request #1
amountAssetDecimals #1.precision precision from the Request #1
amountAssetTotalSupply #1.quantity/10^#1.precision Take fields quantity and precision from the Request #1 and calculate amountAssetTotalSupply
amountAssetMaxSupply ‘infinity’ or #1.quantity/10^#1.precision If the field reissuble (from the Request #1) of an amount asset is equal to true, then amountAssetMaxSupply='infinity', else take fields quantity and precision from the Request #1 and calculate amountAssetMaxSupply
amountAssetCirculatingSupply #1.quantity - #4.balance Take the field quantity from the Request #1 and balance from Request #3, calculate amountAssetCirculatingSupply
priceAssetID #2.id id from the Request #2
priceAssetName #2.name name from the Request #2
priceAssetDecimals #2.precision precision from the Request #2
priceAssetTotalSupply #2.quantity/10^#2.precision Take fields quantity and precision from the Request #2 and calculate priceAssetTotalSupply
priceAssetMaxSupply ‘infinity’ or #2.quantity/10^#2.precision If the field reissuble (from the Request #2) of a price asset is equal to true, then priceAssetMaxSupply='infinity', else take fields quantity and precision from the Request #2 and calculate priceAssetMaxSupply
priceAssetCirculatingSupply #2.quantity - #5.balance Take the field quantity from the Request #2 and and balance from the Request #5, calculate amountAssetCirculatingSupply
24h_open #3.firstPrice firstPrice from the Request #3
24h_high #3.high high from the Request #3
24h_low #3.low low from the Request #3
24h_close #3.lastPrice lastPrice from the Request #3
24h_vwap #3.weightedAveragePrice weightedAveragePrice from the Request #3
24h_volume #3.volume volume from the Request #3
24h_priceVolume #3.quoteVolume quoteVolume from the Request #3
timestamp Not available Just now

Trades

Get unconfirmed and confirmed trades for the specified asset pair

Summary

Marketdata request

Request Description
GET /ticker/{AMOUNT_ASSET}/{PRICE_ASSET}/{LIMIT} Get the last {LIMIT} trades
GET /ticker/{AMOUNT_ASSET}/{PRICE_ASSET}/{FROM}/{TO} Get trades within the {FROM} / {TO} time range

Data-service alternative

# Request Description
1 GET /assets?ticker={AMOUNT_ASSET} (Optional) Get amount asset info by the ticker
2 GET /assets?ticker={PRICE_ASSET} (Optional) Get price asset info by the ticker
3 GET /transactions/exchange?amountAsset={AMOUNT_ASSET_ID}&priceAsset={PRICE_ASSET_ID}&sender={SENDER}&timeStart={TIME_START}&timeEnd={TIME_END}&after={AFTER}&sort={SORT}&limit={LIMIT} Get exchange transactions for specified parameters

Schemas and examples

Marketdata

Request #1

GET /trades/{AMOUNT_ASSET}/{PRICE_ASSET}/{LIMIT}

Param Type Description
AMOUNT_ASSET string Amount asset ticker or ID
PRICE_ASSET string Price asset ticker or ID
LIMIT number Requested amount of trades
Request #2

GET /trades/{AMOUNT_ASSET}/{PRICE_ASSET}/{FROM}/{TO}

Param Type Description
AMOUNT_ASSET string Amount asset ticker or ID
PRICE_ASSET string Price asset ticker or ID
FROM number Start Unix epoch timestamp in milliseconds
TO number End Unix epoch timestamp in milliseconds
Response schema
[
    {
        "timestamp" : number,
        "id": string,
        "confirmed" : boolean,
        "type": string,
        "price": string,
        "amount": string,
        "buyer": string,
        "seller": string,
        "matcher": string
    },
    ...
]
Example #1

GET /trades/WAVES/BTC/5

[
    {
        "timestamp": 1547029062854,
        "id": "ARx5iPkY3EjwKnqdEZ4WYa9tTqJj2qoYr3dYg33Wz6kg",
        "confirmed": true,
        "type": "buy",
        "price": "0.00071920",
        "amount": "3.05702170",
        "buyer": "3PRAYvxeEJB45uChi2shUZixc4keR3eH2Cq",
        "seller": "3PPHnqzZU1aHdju1oUFoh8ws9x4S8Mqv2Zj",
        "matcher": "7kPFrHDiGw1rCm7LPszuECwWYL3dMf6iMifLRDJQZMzy"
    },
    ...
]
Example #2

GET /trades/WAVES/BTC/1546290000000/1546462799999

[
    {
        "timestamp": 1546302909071,
        "id": "89kzVA7wHbF8mGxLgX3PXSYDzkPiudgX7AiyraC5FKw7",
        "confirmed": true,
        "type": "sell",
        "price": "0.00085351",
        "amount": "4.00000000",
        "buyer": "3PRAYvxeEJB45uChi2shUZixc4keR3eH2Cq",
        "seller": "3PPHnqzZU1aHdju1oUFoh8ws9x4S8Mqv2Zj",
        "matcher": "7kPFrHDiGw1rCm7LPszuECwWYL3dMf6iMifLRDJQZMzy"
    },
    ...
]

Data-service alternative

Request #1

Data-service Docs for Request

GET /assets?ticker={AMOUNT_ASSET}

Param Type Description
AMOUNT_ASSET string Amount asset ticker
Response schema
{
    "__type": "list",
    "data": [
        {
            "__type": "asset",
            "data": {
                "ticker": string,
                "id": string,
                "name": string,
                "precision": number,
                "description": string,
                "height": number,
                "timestamp": string (Date in ISO format),
                "sender": string,
                "quantity": number,
                "reissuable": boolean
            }
        }
    ]
}
Request #2

Data-service Docs for Request

GET /assets?ticker={PRICE_ASSET}

Param Type Description
PRICE_ASSET string Price asset ticker
Response schema
{
    "__type": "list",
    "data": [
        {
            "__type": "asset",
            "data": {
                "ticker": string,
                "id": string,
                "name": string,
                "precision": number,
                "description": string,
                "height": number,
                "timestamp": string (Date in ISO format),
                "sender": string,
                "quantity": number,
                "reissuable": boolean
            }
        }
    ]
}
Request #3

Data-service Docs for Request

GET /transactions/exchange?amountAsset={AMOUNT_ASSET_ID}&priceAsset={PRICE_ASSET_ID}&sender={SENDER}&timeStart={TIME_START}&timeEnd={TIME_END}&after={AFTER}&sort={SORT}&limit={LIMIT}

Param Type Description
AMOUNT_ASSET_ID string Amount asset ID
PRICE_ASSET_ID string Price asset ID
SENDER string Transaction orders buyer or seller
TIME_START string or number Start time in Unix epoch timestamp in milliseconds or in Date ISO format
TIME_END string or number (Optional) End time in Unix epoch timestamp in milliseconds or in Date ISO format. Default: now
AFTER string The cursor
SORT string Sorting direction. One of: asc, desc
LIMIT number Requested amount of trades
Response Schema
{
    "__type": "list",
    "lastCursor": string,
    "data": [
        {
            "__type": "transaction",
            "data": {
                "id": string,
                "timestamp": Date,
                "height": number,
                "type": number,
                "version": number | null,
                "proofs": string[],
                "fee": number,
                "sender": string,
                "senderPublicKey": string,
                "buyMatcherFee": number,
                "sellMatcherFee": number,
                "price": number,
                "amount": number,
                "order1": {
                "id": string,
                    "senderPublicKey": string,
                    "matcherPublicKey": string,
                    "assetPair": {
                        "amountAsset": string,
                        "priceAsset": string
                    },
                    "orderType": string,
                    "price": number,
                    "sender": string,
                    "amount": number,
                    "timestamp": string (Date in ISO format),
                    "expiration": string (Date in ISO format),
                    "matcherFee": number,
                    "signature"?: string,
                    "proofs"?: string[]
                },
                "order2": {
                    "id": string,
                    "senderPublicKey": string,
                    "matcherPublicKey": string,
                    "assetPair": {
                        "amountAsset": string,
                        "priceAsset": string
                    },
                    "orderType": string,
                    "price": number,
                    "sender": string,
                    "amount": number,
                    "timestamp": string (Date in ISO format),
                    "expiration": string (Date in ISO format),
                    "matcherFee": number,
                    "signature"?: string,
                    "proofs"?: string[]
                }
            }
        },
        ...
    ]
}
Response mapping

Marketdata preprocess exchange transactions, but Data-service has exchange transactions as is. So set up fields type, buyer and seller manually.

Note: Marketdata’s response can have wrong value for type field - it’s bug!

The transaction type is determined by the orderType of second transaction order, buyer and seller is determined by its order (e.g. a sender of the order with buy type is the buyer).

All of Data-service transactions are confirmed (confirmed is equal to true).

Marketdata Data-service
timestamp timestamp
id id
confirmed Not available
type Not available
price price
amount amount
buyer Not available
seller Not available
matcher sender

Trades (by address)

Get trades for the specified asset pair and the address

Summary

Marketdata request

Request Description
GET /trades/{AMOUNT_ASSET}/{PRICE_ASSET}/{ADDRESS}/{LIMIT} Get the limited amount of trades for the specified asset pair filtered by the address (buyer or seller)

Data-service alternative

# Request Description
1 GET /assets?ticker={AMOUNT_ASSET} (Optional) Get amount asset info by the ticker
2 GET /assets?ticker={PRICE_ASSET} (Optional) Get price asset info by the ticker
3 GET /transactions/exchange?amountAsset={AMOUNT_ASSET_ID}&priceAsset={PRICE_ASSET_ID}&sender={SENDER}&timeStart={TIME_START}&timeEnd={TIME_END}&after={AFTER}&sort={SORT}&limit={LIMIT} Get exchange transactions for specified parameters

Schemas and examples

Marketdata

Request

GET /trades/{AMOUNT_ASSET}/{PRICE_ASSET}/{ADDRESS}/{LIMIT}

Param Type Description
AMOUNT_ASSET string Amount asset ticker or ID
PRICE_ASSET string Price asset ticker or ID
ADDRESS string Trades buyer or seller
LIMIT number Requested amount of trades
Response schema
[
    {
        "timestamp" : number,
        "id": string,
        "confirmed" : boolean,
        "type": string,
        "price": string,
        "amount": string,
        "buyer": string,
        "seller": string,
        "matcher": string
    },
    ...
]
Example

GET /trades/WAVES/BTC/3PCfUovRHpCoGL54UakGBTSDEXTbmYMU3ib/10

[
    {
        "timestamp": 1499025225254,
        "id": "9p2PEao1ZZFkDoxqotaewKKNHfzYMypQ67vnZTANQtVy",
        "confirmed": true,
        "type": "sell",
        "price": "0.00145919",
        "amount": "64.19860931",
        "buyer": "3PCfUovRHpCoGL54UakGBTSDEXTbmYMU3ib",
        "seller": "3PEDkinFRUmGuBQdtAu88FUb5irLcppcxvR",
        "matcher": "7kPFrHDiGw1rCm7LPszuECwWYL3dMf6iMifLRDJQZMzy"
    },
    ...
]

Data-service alternative

Request #1

Data-service Docs for Request

GET /assets?ticker={AMOUNT_ASSET}

Param Type Description
AMOUNT_ASSET string Amount asset ticker
Response schema
{
    "__type": "list",
    "data": [
        {
            "__type": "asset",
            "data": {
                "ticker": string,
                "id": string,
                "name": string,
                "precision": number,
                "description": string,
                "height": number,
                "timestamp": string (Date in ISO format),
                "sender": string,
                "quantity": number,
                "reissuable": boolean
            }
        }
    ]
}
Request #2

Data-service Docs for Request

GET /assets?ticker={PRICE_ASSET}

Param Type Description
PRICE_ASSET string Price asset ticker
Response schema
{
    "__type": "list",
    "data": [
        {
            "__type": "asset",
            "data": {
                "ticker": string,
                "id": string,
                "name": string,
                "precision": number,
                "description": string,
                "height": number,
                "timestamp": string (Date in ISO format),
                "sender": string,
                "quantity": number,
                "reissuable": boolean
            }
        }
    ]
}
Request #3

Data-service Docs for Request

GET /transactions/exchange?amountAsset={AMOUNT_ASSET_ID}&priceAsset={PRICE_ASSET_ID}&sender={SENDER}&timeStart={TIME_START}&timeEnd={TIME_END}&after={AFTER}&sort={SORT}&limit={LIMIT}

Param Type Description
AMOUNT_ASSET_ID string Amount asset ID
PRICE_ASSET_ID string Price asset ID
SENDER string Transaction orders buyer or seller
TIME_START string or number Start time in Unix epoch timestamp in milliseconds or in Date ISO format
TIME_END string or number (Optional) End time in Unix epoch timestamp in milliseconds or in Date ISO format. Default: now
AFTER string The cursor
SORT string Sorting direction. One of: asc, desc
LIMIT number Requested amount of trades
Response Schema
{
    "__type": "list",
    "lastCursor": string,
    "data": [
        {
            "__type": "transaction",
            "data": {
                "id": string,
                "timestamp": Date,
                "height": number,
                "type": number,
                "version": number | null,
                "proofs": string[],
                "fee": number,
                "sender": string,
                "senderPublicKey": string,
                "buyMatcherFee": number,
                "sellMatcherFee": number,
                "price": number,
                "amount": number,
                "order1": {
                "id": string,
                    "senderPublicKey": string,
                    "matcherPublicKey": string,
                    "assetPair": {
                        "amountAsset": string,
                        "priceAsset": string
                    },
                    "orderType": string,
                    "price": number,
                    "sender": string,
                    "amount": number,
                    "timestamp": string (Date in ISO format),
                    "expiration": string (Date in ISO format),
                    "matcherFee": number,
                    "signature"?: string,
                    "proofs"?: string[]
                },
                "order2": {
                    "id": string,
                    "senderPublicKey": string,
                    "matcherPublicKey": string,
                    "assetPair": {
                        "amountAsset": string,
                        "priceAsset": string
                    },
                    "orderType": string,
                    "price": number,
                    "sender": string,
                    "amount": number,
                    "timestamp": string (Date in ISO format),
                    "expiration": string (Date in ISO format),
                    "matcherFee": number,
                    "signature"?: string,
                    "proofs"?: string[]
                }
            }
        },
        ...
    ]
}
Response mapping

Marketdata preprocess exchange transactions, but Data-service has exchange transactions as is. So set up fields type, buyer and seller manually.

Note: Marketdata’s response can have wrong value for type field - it’s bug!

The transaction type is determined by the orderType of second transaction order, buyer and seller is determined by its order (e.g. a sender of the order with buy type is the buyer).

All of Data-service transactions are confirmed (confirmed is equal to true).

Marketdata Data-service
timestamp timestamp
id id
confirmed Not available
type Not available
price price
amount amount
buyer Not available
seller Not available
matcher sender

Candles

Get the OHLCV candlestick data for the specified asset pair

Summary

Marketdata request

Request Description
GET /candles/{AMOUNT_ASSET}/{PRICE_ASSET}/{TIMEFRAME}/{LIMIT} Get the limited amount of timeframed OHLCV candlestick data for the specified asset pair
GET /candles/{AMOUNT_ASSET}/{PRICE_ASSET}/{TIMEFRAME}/{FROM}/{TO} Get the timeframed OHLCV candlestick data for the specified asset pair between from and to timestamps

Data-service alternative

# Request Description
1 GET /assets?ticker={AMOUNT_ASSET} (Optional) Get the amount asset info by the ticker
2 GET /assets?ticker={PRICE_ASSET} (Optional) Get the price asset info by the ticker
3 GET /candles/{AMOUNT_ASSET_ID}/{PRICE_ASSET_ID}?timeStart={TIME_START}&timeEnd={TIME_END}&interval={INTERVAL} Get candles from previously got asset IDs

How to get candles from Data-service:

  1. If asset IDs are known, go to step 3, else go to step 2.
  2. Using requests #1 and #2 and known asset tickers get asset IDs.
  3. Using request #3 and asset IDs get candles. Attention: {TIMEFRAME} and {INTERVAL} parameters have different format.

Note: Maximum amount of candles in response – 1440.

Schemas and examples

Marketdata

Request

GET /candles/{AMOUNT_ASSET}/{PRICE_ASSET}/{TIMEFRAME}/{LIMIT}

GET /candles/{AMOUNT_ASSET}/{PRICE_ASSET}/{TIMEFRAME}/{FROM}/{TO}

Param Type Description
AMOUNT_ASSET string Amount asset ticker or ID
PRICE_ASSET string Price asset ticker or ID
TIMEFRAME number Candle timeframe in minutes. Valid timeframes are valid timeframes are 5, 15, 30, 60, 240, 1440 minutes
LIMIT number Requested amount of candles
FROM number Start Unix epoch timestamp in milliseconds
TO number End Unix epoch timestamp in milliseconds
Response schema
[
    {
        "timestamp" : number,
        "open" : string,
        "high" : string,
        "low" : string,
        "close" : string,
        "vwap" : string,
        "volume" : string,
        "priceVolume" : string,
        "confirmed" : boolean
    },
    ...
]
Example

GET /candles/WAVES/BTC/30/5

[
    {
        "timestamp" : 1498536000000,
        "open" : "0.00170430",
        "high" : "0.00170430",
        "low" : "0.00165618",
        "close" : "0.00165618",
        "vwap" : "0.00168210",
        "volume" : "264.43216559",
        "priceVolume" : "0.44480134",
        "confirmed" : true
    },
    ...
]

Data-service alternative

Request #1

Data-service Docs for Request

GET /assets?ticker={AMOUNT_ASSET}

Param Type Description
AMOUNT_ASSET string Amount asset ticker
Response schema
{
    "__type": "list",
    "data": [
        {
            "__type": "asset",
            "data": {
                "ticker": string,
                "id": string,
                "name": string,
                "precision": number,
                "description": string,
                "height": number,
                "timestamp": string (Date in ISO format),
                "sender": string,
                "quantity": number,
                "reissuable": boolean
            }
        }
    ]
}
Example
{
    "__type": "list",
    "data": [
        {
            "__type": "asset",
            "data": {
                "ticker": "WAVES",
                "id": "WAVES",
                "name": "Waves",
                "precision": 8,
                "description": "",
                "height": 0,
                "timestamp": "2016-04-11T21:00:00.000Z",
                "sender": "",
                "quantity": 10000000000000000,
                "reissuable": false
            }
        }
    ]
}
Request #2

Data-service Docs for Request

GET /assets?ticker={PRICE_ASSET}

Param Type Description
PRICE_ASSET string Price asset ticker
Response schema
{
    "__type": "list",
    "data": [
        {
            "__type": "asset",
            "data": {
                "ticker": string,
                "id": string,
                "name": string,
                "precision": number,
                "description": string,
                "height": number,
                "timestamp": string (Date in ISO format),
                "sender": string,
                "quantity": number,
                "reissuable": boolean
            }
        }
    ]
}
Request #3

Data-service Docs for Request

GET /candles/{AMOUNT_ASSET_ID}/{PRICE_ASSET_ID}?timeStart={TIME_START}&timeEnd={TIME_END}&interval={INTERVAL}

Param Type Description
AMOUNT_ASSET_ID string Amount asset ID
PRICE_ASSET_ID string Price asset ID
TIME_START string or number Start time in Unix epoch timestamp in milliseconds or in Date ISO format
TIME_END string or number (Optional) End time in Unix epoch timestamp in milliseconds or in Date ISO format. Default: now
INTERVAL number Candles interval. Valid intervals are 1m, 5m, 15m, 30m, 1h, 3h, 6h, 12h, 1d
Response schema
{
    "__type": "list",
    "data": [
    {
        "__type": "candle",
        "data": {
            "time": string (Date in ISO format),
            "open": number,
            "close": number,
            "high": number,
            "low": number,
            "volume": number,
            "quoteVolume": number,
            "weightedAveragePrice": number,
            "maxHeight": number,
            "txsCount": number
        }
    },
]
Example
{
    "__type": "list",
    "data": [
        {
            "__type": "candle",
            "data": {
                "time": "2018-12-25T21:50:00.000Z",
                "open": 0.00087545,
                "close": 0.00087542,
                "high": 0.00087545,
                "low": 0.00087542,
                "volume": 52,
                "quoteVolume": 0.0455224,
                "weightedAveragePrice": 0.00087543,
                "maxHeight": 1322206,
                "txsCount": 3
            }
        },
        ...
    ]
}
Response mapping
Marketdata Data-service
timestamp time
open open
high high
low low
close close
vwap weightedAveragePrice
volume volume
priceVolume quoteVolume
confirmed Not available

Contacts

For all feature-requests and questions contact us at:


#7

Feel the diff:

Can you provide an alternative query for all pairs in 24h stats?

Currently much less information is available.


#8

There is an endpoint for top 1000 pairs
https://api.wavesplatform.com/v0/pairs


#9

Top 1000 or top 100?


#10

Have you tried the new Waves Market Data? It resembles the Waves Data Feed’s API, but lack the UTX handling for now. It will be supported by Waves Go team.


#11

No, it is a different thing.

Currently i can get everything i need about markets in a single HTTP GET, there is no such or alternative way of doing it (without 20k queries) in the new API.

Please, provide a way to get ALL active markets in last 24h in a single response.


#12

Looks like I failed to deliver the message that the new Waves Market Data aka WMD has the same API as the old one. It has the same methods to get the information about all known pairs and tickers at once. And it was written to give the community the complete replacement for the abandoned product. This new service could be installed easily, it doesn’t require JVM, works on Linux, MacOS X and Windows. We will support it. We accept issues and pull requests and resolve issues ASAP.


#13

There are no ways to get ALL in one request, and that is one of the reasons why marketdata is deprecated - it is not scalable at all.


#14

Yes, smaller queries are better for server.

But you changing root things. Now instead of making one call (+some pagination calls maybe) i need to host my own database, or make hundreds of calls to get everything i need on the fly.

And the talk is not about ALL the pairs, but ALL pairs in 24h, this is a not so big data blob.

I am pretty sure i can handle any change in API and write my own, but if i can rely on your API instead of my own, it would be nice.


#15

Hi, @deemru, I’m responsible for services development in Waves Platform. First of all, thank you for your feedback.

Now, I’d like to ask, do you really need ALL pairs in 24h? Thing is, our pairs are sorted by volume, and after the first 1000 they’re mostly useless/very low-volume combinations. We haven’t added the pagination so far only because we haven’t seen the need for most applications. What is your use case?


#16

Hello, @dvshur, once in 2 hours w8io updater gets /api/tickers and marks assets in internal database as active/inactive depending on their volumes.

So we have 1 get query to serve any number of user queries in milliseconds without any additional query.

It is not impossible to implement without your API, but for now it is pretty easy.


#17

It seems if our /pairs API was paginated, your case would be pretty easy to solve.


#18

Hi everybody.
I think it would be better to change https://api.wavesplatform.com/v0/pairs (Get all list of pairs info by limit…) to POST request to pass asset ids, because the ids are big in size and GET request header is very limited.
Other nice to have would be the real amount of gatewaycoins? I mean the amount that is stored in a gateway of the dex. The endpoint https://api.wavesplatform.com/v0/assets/8LQW8f7P5d5PZM7GtZEBgaqRPGSzS3DfPuiXrURJ4AJS for Bitcoin only delivers a theoretically limit of 2099999999617206 satoshis.


#19

Hello,

Can you please add a filter by asset ID for retrieving all transactions?. I was trying https://api.wavesplatform.com/v0/transactions/all?assetId=FiKspxSpkpzT4pMUA9ccZkbJmVXTdu4JhFDXNNXr5noW&limit=100?t=
but I just realized that is not actually filtering.

Cheers

F.


#20

Filtering by assetId and address it is next feature of data-service. Release is expected at the end of Q1.


#21

@ikardanov Why so many timestamp formats? Single unix epoch format is enough imho


#22

https://api.wavesplatform.com/v0/pairs/bs1kfnr8zrxkbewduuvpap6g57hic3aeskwk7qqkdlpb/waves

I can get “last trade price” data.
how do I get the “amount” of the last trade


#23

I believe you can’t do it using pairs api. Try something like this
https://api.wavesplatform.com/v0/transactions/exchange?amountAsset=BS1KFNR8zrXKBEWdUUvpaP6G57Hic3aESkwK7qQKdLpB&priceAsset=WAVES&sort=desc&limit=10