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:
To make an offer on the exchange currency pair (NBT_BTC), trading type (BUY) , rate, and amount must be specified.
My question is, at what rate can i offer BTC to be sure the bot will buy?
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
You rely on exchange to provide liquidity for you and have user to pay fees to exchange (e.g. use shapeshift API).
You build your own exchange and provide liquidity by asking 3rd parties to do at fee and charge users a fee or premium exchange rate to make some money to pay those 3rd parties.
In both models you can add additional fees to sustain NuBex development and maintenance. The market will determine what rates and fees will be acceptable over just going to the exchange.