This repository has been archived by the owner on Feb 23, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 79
How to quick buy a specific coin? #19
Comments
Hey there. It seems the only way this could be accomplished is if you use websockets to get pricing updates and then use that last price to make the calculation. Binance doesn't give us a way to just say "buy BTC with 100% of X." |
How can I extract data from |
Hey @Tannguyen sorry for the late response. EM.run do
# Create event handler to update DB
# e.data should be a string json response, you will need to parse using JSON.parse or similar
updateAggTradeXRPETH = proc { |e| do_something_with JSON.parse(e)['some_value'] }
# Only pass message, and for each message received, called updateAggTradeXRPETH
aggTradeMethods = { message: updateAggTradeXRPETH }
# Pass a symbol and event handler Hash to connect and process events
client.agg_trade symbol: 'XRPETH', methods: aggTradeMethods
end Let me know if you need me to elaborate any more. |
Thanks for your response, one more question: How can I get the average price after my order is filled fully? For example if I use:
It will display |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I would like to buy a coin with my all current btc as fast as possible, I would like to know if we can do it with only 1 API call. The approach I'm using it we request to get the current price first, then calculate the quantity, then create an order based on that. Btw it will takes 2 API calls.
How can I achieve it by using only 1 API call, (the API to get current price will take about > 1sec).
The text was updated successfully, but these errors were encountered: