In implementing a Bitcoin web wallet with the option to convert your BTC to NBT as a hedge against fluxuation, one must periodically contact an exchange to determine the current conversion and execute trades.
Say i contact the excahnge to request the currecnt price and it tells me:
I’d be tempted to pull the order book from the exchange at the same time so that you could match your sells to the current sell orders. Every exchange I’ve dealt with makes the current orders available through an API call so it will just be another http request from your service.
Are you planning on executing trades for every conversion or do you plan to hold a certain amount of liquidity in your service and trade when that becomes unbalanced?
The plan is to convert the coins in ‘real time’ by sending BTC to the exchange, trade them, and withdraw NuBits to the user’s wallet ( time estimae, ~20min [for confimations]) . Are you suggestting some kind of slush fund to enable faster conversions?
That was an idea i was mulling around.
As an end user I would see a twenty minute wait and think 'I’ll go to the exchange myself’
instant transfer though is the game changer.
It requires some up front investment but means that the funds can be kept ready to transfer
scheduled tasks can run to adjust the balances with exchanges as and when needed.
it makes the whole thing a lot more complex but I felt that might be worth it to gain that instant transfer tag