NuBex Wallet trade API interface with NuBot ( thru exchange )

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:

{“result”:“true”,“last”:0.002654,“high”:0.002672,“low”:0.002469,“avg”:0.002602,“sell”:0.002653,“buy”:0.002653,“vol_nbt”:196278.147,“vol_btc”:510.7163}

-“last”:0.002654,- <— notice the last price

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?

what is nubex?

Cybnate’s idea, from Vision for NuNet ecosystem with stable, non-volatile Bitcoins and Peercoins for end users

used Bter’s ‘depth’ API command to get that info (https://bter.com/api#depth ).

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

Would it make sense for a share holder elected custodian to make the initial investment to maintain liquidity?

Can that happen with in the existing system?

I think there are two models:

  1. You rely on exchange to provide liquidity for you and have user to pay fees to exchange (e.g. use shapeshift API).
  2. 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.