Process of taking trade:
Variables that we need? What are we sending?
Coin, buy rate/range, sell rate, stop loss, analyst key, risk percentage, timestamp
function will run for each user - > need APT passed before making trade for each user, if no field passed use max value (90% of the ac balance) , run only for users RPT > given by the analyst per trade
.
edit functionality / Cancel trade -> how to make this atomic? if apis are initiated we will need another request? - > Solved
edit means -> cancel the whole order and place new
check order status
api.get_order(symbol=pair,orderId=orderId)
api.cancel_order(symbol=pair, orderId=order_id, origClientOrderId=client_order_id)
After trade is done, should be saved for order history.
Users who received the trade?
Ratings calculation formula for analyst?
update user balance after successful request response cycle
Analyst handle engine:
analyst key
Key -> fetch user data ; redis
Trade taking engine:
Coin, buy rate/range, sell rate, stop loss,
APT thing & RPT calculation:
After one loss, a/c balance will be made 0, now when trade is made, balance will be cut from apt, keeping the Risk percentage in mind.
APT & RPT calculation is done real time , on every trade basically and will be updated on admin and analyst panels.
use only APT & RPT
Big problem here = bulk trades?
How can we pull this off? Multi-threading? multiple instances for binance requests?
-
if analyst is controlling a lot of money, he can add that to many coins