How to get all the waves DEX trades

Hi there.
I am new to waves.
Is there any API or another way to retrieve all the Waves DEX transactions [type = 7]?

i know of a way in the blog explorer its however ordered regarding blocks, not regarding certain assets, but this is interesting to know for me as well

regards

Every node has an api, you can scan each block for this tx type

1 Like

wow, so is it possible to depict X amount of last transactions of waves plattform based asset Y?

you can get all the info u want about what happened on the chain… by using the api and parsing json…

well then lets write a code for that and publish it here so developers can use it for filter information

it seems like I can travase block by block via the node API. - thanks for that.
I found an example of DEX transaction json(see below)

Upon reading the data below, how can I parse the specific market e.g. BTC/ETH, BTC/WAVES etc…

{
“type” : 7,
“id” : “5CjRNxWP7UuQyAMo3jSy75xmRtzk9ToDzQWpez1BDKCS”,
“sender” : “3PJaDyprvekvPXPuAtxapacuDJopgJRaU3”,
“senderPublicKey” : “7kPFrHDiGw1rCm7LPszuECwWYL3dMf6iMifLRDJQZMzy”,
“fee” : 300000,
“timestamp” : 1526306206991,
“signature” : “6517zCNWXZ6uhWxEsTFyKZZF1xTmRQfcsSymtckPtpjS6TBqfyAEKMCXepvbYenaDefsfSSEAzakJkkk3Wio1UoH”,
“order1” : {
“id” : “XiQ1qaoXuxUdF34aHYF3T9gRu9kFd2fWEp74j82q4oL”,
“sender” : “3PRAnnG4iFKXZF7kuUVMMDkqkKTFnMb49RA”,
“senderPublicKey” : “8g6yg5L42yySk62q7ijFQmBrmVyr67v2JGckKZ39kXCe”,
“matcherPublicKey” : “7kPFrHDiGw1rCm7LPszuECwWYL3dMf6iMifLRDJQZMzy”,
“assetPair” : {
“amountAsset” : null,
“priceAsset” : “8LQW8f7P5d5PZM7GtZEBgaqRPGSzS3DfPuiXrURJ4AJS”
},
“orderType” : “buy”,
“price” : 73307,
“amount” : 1000000000,
“timestamp” : 1526306110357,
“expiration” : 1526392510357,
“matcherFee” : 300000,
“signature” : “2SUJgrJWjXkHTEuwgBDLWYJ56HwWcoo18ZULYHwKGwHtVi8Z8HSaLpyX275YHVQgCcDurNcDWD5ZkvF3erJYgHyn”
},
“order2” : {
“id” : “5MjZkF3LGXoK8q9njaLrCSq9cqHhSJtCPBh6pS1Gm1dY”,
“sender” : “3PQMaqkr1Py1FcNZJkECWskFBzxhdMWxD9x”,
“senderPublicKey” : “9iYNLNpwTxZT6Lu4NKXBHN9zHfYf3rZp5w77PaAc5hmg”,
“matcherPublicKey” : “7kPFrHDiGw1rCm7LPszuECwWYL3dMf6iMifLRDJQZMzy”,
“assetPair” : {
“amountAsset” : null,
“priceAsset” : “8LQW8f7P5d5PZM7GtZEBgaqRPGSzS3DfPuiXrURJ4AJS”
},
“orderType” : “sell”,
“price” : 73307,
“amount” : 10000000,
“timestamp” : 1526306205308,
“expiration” : 1528034205309,
“matcherFee” : 300000,
“signature” : “2bKcU8qS4mDSvHjan9bEVHWniad5VhhJyrP3yvAPqXwpsK3EF2H2MiH1ZCCEDHGuBYgEbKyM5zFN5iUtXvMKFRes”
},
“price” : 73307,
“amount” : 10000000,
“buyMatcherFee” : 3000,
“sellMatcherFee” : 300000
}

can you package that in a way so it can be pasted and used in an https code window?

what do you mean?

I found this data by invoking:
https://nodes.wavesplatform.com/blocks/seq/1000000/1000055

you will get many transactions there, but you can find this specific one by looking for the transaction.id which is:
5CjRNxWP7UuQyAMo3jSy75xmRtzk9ToDzQWpez1BDKCS

so thats the automatically provided data set of a certains assets transaction in time interval X, now we only need an HTTPS packaged version so it can be copy pasted into a https coding window maybe even an more complex interactive one. so an assets last transactions on waves dex can be explored

regards

not sure I understand…
I am just trying to understand what was bought and what was sold in this specific transaction?
How can a human read and understand the result of the API?

Thanks, can you please explain how to read the API response?

dont you get that from volume and the pairings and the considered time intervalls?, there is a different adress for that:

https://marketdata.wavesplatform.com/api/candles/WAVES/EUR/60/24

this are waves/EUR trades in last 24 hours, you can use that adress systematics for all kinds of pairings,

or this is ETH/USD

https://marketdata.wavesplatform.com/api/candles/ETH/USD/60/24

if you want to create some form of waves dex market statistic, this would be the way. you have to add up all possible pairings and scan them for volume (thats a lot)

i currently think you want to filter the information regarding transactions by asset IDs

to get all the waves trades you have to combine and add up those adress pairings but there are countless pairings possible so it will be a quite some work

regards

But …actually what I want to collect is the DEX transaction data which means,
I want to know that address X sold some coin Z to address Y and address Y gave in return some T coins.

Now in order to get this data you need to read from WAVES block all the transaction where the transaction type =7.

The way to read all the transaction from a block would be by using something like:
https://nodes.wavesplatform.com/blocks/seq/1000000/1000055

Now when I read a specific transaction from the response of the above API request, I don’t understand how do you know what is Z and what is T, i.e. which coins are being transferred here…

you wont adress data as well… that sounds like a quite deep scanning into the privacy of many users especially developers like i am

yes…all the data is public, it’s on chain already…
I just want to understand how to read it…

See in the JSON I attached above, there are two orders (order1=buy and order2-sell)
and in both you can see the senderPublicKey…

you sound like you want to become a transaction of money watchdog… that can be a good and a bad thing

I want to analyze who traded the best and follow them :smile:

omg you mean daytrading?

not investment and support for projects?