Extract the transactions in the last 15 mins on pancakeswap
Aggregrate these per token/contract
Get the number of buys and sells for that token - so I can check if there are more buys than sells
What I have now
I can retrieve the last transactions and aggregate them for the “BNB > token” pair, however, this only gives me the number of tokens bought, not the number of tokens sold since I would need the “token > BNB” pair for this too. Obviously, I could run the query below twice, once with BNB as buy and once with BNB as sell currency but this is rather tedious, perhaps there is a much easier way for this?
Thanks for looking with me!
What I actually meant is:
Get the transactions for the latest 15 minutes
Check how many of these were buys/sells grouped by token
So let’s say token $X, I want to know how many tokens were bought and how many were sold. Since we have pairs, lets always ook at BNB. I think takers/makers tells us how many “people” bought right not how many tokens were involved. In other words, I think I could rephrase it, the trade amount tells us how much was traded, I want to know how many tokens were bought and how many were sold there.
So that we get something like:
token - address - tokens sold - tokens bought
I’m just thinking, we could use the candle data for this instead (like you proposed here), and look at the open and close for each token. This does not give the exact amounts but it does tell me whether there were more buys than sells. Although I’m not entirely sure what the exact query would have to look like, since:
I don’t need all tokens just those traded recently
that query does not always seem to return the last candle
Basically, I’m trying to use the query to find tokens that are getting more buys than sells in the last X minutes
Hey Gaurav sorry for the late reply! Some personal stuff going on…
I looked into this one, but it appears that the buy and sell amount are not both in BNB?
For example if I run it for today (“2021-08-13T00:00:00”) it, for example, gives (slightly modified it to include more info):
This gives me the impression there were more buys than sells, but this is not the case, looking at the chart: PooCoin BSC Charts. I suppose this is because buyAmount and sellAmount are in different currencies - buy being the amount of the token and sell the amount of BNB.
Is there any way to make the buy and sell amount comparable such that I can see if a token went up?