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

Minimal instead of median #12

Closed kvalter closed 2 years ago

kvalter commented 2 years ago

Hello. thanks for bot its awesome! But how can i get minimal price of all trading ads? Of course i need to tell bot the sum first, because the price is depends on sum.

sanchezmarcos commented 2 years ago

Hi @kvalter, thanks for the feedback. Binancio currently offers minimum, median and maximum price. Could it be that I am not understanding your need?

Captura de Pantalla 2022-03-28 a la(s) 16 20 49
kvalter commented 2 years ago

yes, i already found "minimum" parameter, its ok now.. Also I want to add "sum" parameter to this schema, because It also affects the final price.

sanchezmarcos commented 2 years ago

In the case of buying/selling, you should use the median as a reference parameter, not the average, unless you want to "lose" money.

Can you give me an example of the sum you are trying to do? Are you trying to get the average price? I don't quite understand your need, sorry and PR's are welcome! 😅

kvalter commented 2 years ago

Ok, may be i need to explain my full task) I want to create a parser for Binance P2P that could check minimal price for USDT buying. We are going to parse it every day and see first 3 ads to calculate minimal price at the moment. But there is a little difference between empty request and exact request. Example. We want to check minimal current price for USDT - RUB with website https://p2p.binance.com/en?fiat=RUB . We press Search and see that minimal price is 87.94 RUB. But if we define our request with "sum" to "20000" and "payment" to "tinkoff" (its our popular bank) then we get minimal price 94.01 I recorded video of this process https://www.loom.com/share/bbe6c553f90847119ba16ec971f70850

So, my question is: how can i add this "sum" parameter to your code?

sanchezmarcos commented 2 years ago

The need is now clearer! Using option -p tinkoff or --pay-types tinkoff you should be able to specify the pay type.

We don't have added yet the option to specify a minimal amount but you can see how to do it on this pull request: https://github.com/sanchezmarcos/binancio/pull/9/files

The parameter on Binance API is transAmount (Eg. transAmount: 2000) I hope it has been helpful, Thanks!

kvalter commented 2 years ago

Thank you, that is what i needed :)