sanchezmarcos / binancio

Binancio calculates median price of any crypto-asset in fiat currency on Binance's p2p exchange right on your console.
https://sanchezmarcos.me/aplicaciones/binancio
MIT License
116 stars 53 forks source link

Historical values #4

Closed laresbernardo closed 2 years ago

laresbernardo commented 3 years ago

Hi Marcos! Thanks for sharing this awesome tool/code with us. Do you think it could be possible to fetch historical results so we can compare min, med, max values in a range of dates? Thanks again!!

sanchezmarcos commented 3 years ago

Hi @laresbernardo! Nice to get in touch! At the moment I could not find a public binance API with the p2p logs.

I see two options of how we could add this feature:

  1. Saving the results of each query in a local db or in json format on disk. It is partially useful and a cronjob could be added.
  2. Use a public cloud to save the results of the queries of each Binancio user. (e.g. Firebase, MongoDB Atlas) I find it interesting as an experiment, but it would be exposed to attacks and inaccurate information.

I will see if I can think of any other option, any suggestion is welcome! Thanks for the feedback.

laresbernardo commented 3 years ago

Thanks!! I'm looking for a way to analize the distribution of daily P2P transactions (currency / USDT) vs the official exchange rate. Looking closer at your code, I noticed you added ARS as default (so you must from Argentina). For our LATAM countries, we have crazy things happening in our economy (I'm Venezuelan, lived in Argentina until a couple of months ago, and am in Colombia now)... and having this trends are quite valuable to time buying/selling correctly. Hopefully, you can help me come up with a solution no getting this data! 👍

sanchezmarcos commented 3 years ago

¡Es un placer enorme estar en contacto con un hermano venezolano! You are right! I'm from Argentina and I totally understand your point! 💸

In my case, I had already tracked the cryptocurrencies and their price in USDT and I needed to calculate the median in local currency to be clear about how my investment was performing, this is where Binancio was born.

What I did was set up a local MongoDB collection and a cronjob that saves the USDT @ ARS output generating a historical record every N times a day. Then I can see the historical analysis in my DeFi dashboard with graphs and setup alerts to take advantage of certain opportunities and to avoid certain risks.

Captura de Pantalla 2021-06-18 a la(s) 20 12 32

To get the price of any cryptocurrency against USDT, try consuming this Binance API: https://www.binance.com/bapi/asset/v2/public/asset-service/product/get-products?includeEtf=true

p.s: If I have time on the weekend I will add a parameter so that the output is just a json, maybe useful for your case. Let me know if you think I can help you. Thanks!

laresbernardo commented 3 years ago

That's great @sanchezmarcos . Thanks for taking the time!