[Draft] Proposal for liquidity provision on fiat pairs (LiquidBits.net)

Never count on a combined incentive, its independent players who (usually) cannot communicate with each other. Everyone should and will act purely selfish in this scenario. Implementing above solution would be some effort, since there is a new API call which is required in each exchange wrapper, a changed server communication which will render previous releases incompatible, and of course it can lead to some bugs. The user won’t be affected by that.

Just to be clear: You can implement the exact same equilibrium (i.e. the stable state in the game) if you just directly say that 50% of your liquidity must be on the buy side and 50% on the sell side at any time. This means that you have to apply twice the spread, and the trading bot just buys from the other side to rebalance if the ratio is wrong. It however will never allow the buy side to be larger than the sell side and could suppress the sell side (which however is surely not Nu’s problem).

You’re right, and they’ll just play with which portion of their liquidity they count for the custodial sweep. If we make the server look at all orders on the exchange within a window, custodial or not, that may fix the problem to a degree.

Ok, so let’s pretend ccedk has no volume on it in any pair before we roll out operations (not far from the truth). The only thing the nbt/usd wall will be used for will be standard usage of someone selling to or from legacy or else they are trying to arbitrage nbt/btc as those pairs become unpegged.
We want to stimulate a healthy USD buy side fundamentally, but we don’t want custodians to sell just after being bought. We want the custodians to take that nbt and go do something else with it. So maybe you can get extra rewards for sending nbt that was bought as a custodian out of the exchange. Then, we don’t need the whole trade history, we could track nbt addresses or what have you.

I guess my solution would be to offer to pay the withdrawal fee (also potentially USD deposit fee?) for custodians involved in transactions. It’s not much of an incentive, but it’s the most unabusable solution I can think of.

Anyway, for this grant, I personally would prefer just a flat rate with a 50,000 NBT target on either side (just in regards to CCEDK NBT/USD). It doesn’t seem like we can find a solution within a short time scale.

What if we do first come first serve instead of auction? There are a target number of NBT and USD volume ‘slots’ and if you get bought you won’t sell back because there’s no guarantee that you’ll get a slot in a competitive market. I’d like to compensate a bigger target of liquidity-in-waiting with a much lower compensation, preferably tied to something like the 1.4 day park rate. Anyway, with this model, you could adjust the buy and sell side rates and targets however you want as long as you keep the high-compensation liquidity pools filled up.

Or, because the first come first serve causes unfair distribution of rewards, we could base the chance of getting compensated off the number of order confirmations in a row. We could impose a minimum number of confirmations before reward is paid out and a maximum number of confirmations where full reward is paid out.

Of course, both of these models require some kind of memory of individual orders.

We started with that I believe, but went to the Dutch auction model as first come first serve is unfair as you say. Tracking the orders adds a lot of complexity. Maybe just add a way to randomly cancel slots after 1 hour or so, so everyone gets a fair chance to occupy the best slots for at least one hour.

For now I will go with equal rates on the fiat pairs and pay a bit more on the sell side on BTC/NBT pair to compensate for the risk of holding BTC instead of stable NBT.

I understand that there is a risk to game the system if holding USD is more rewarded than holding NBT on NBT/USD but since it is on CCEDK, I doubt you would get easily someone to remit USD…because it costs to do so at least more than to send NBTs over to the exchange…

Announcement for beta test-run Liquidbits.net

After more testing today and the changes made by @woollysammoth yesterday for the CCEDK API, I’m good to start a public beta with small pool limits and small non-guaranteed payouts.

Step 0
When you don’t have Python installed on Windows or you don’t know, best to install Plunge as it comes with a nice auto-installer for Python. Check it out here. Unfortunately Plunge doesn’t support exchanges other than Bittrex yet, but I have been told that this will be the case soon (Thanks @woolly_sammoth). So for now you don’t need to start it after installation.

Step 1
You can join when you have or open an account on www.CCEDK.com or www.Bitcoin.co.id. For you own safety please enable two-factor authentication especially when you have more than just a few test NBTs on the exchange. Add some NBT, BTC or transfer some EUR or USD to your account depending on which pairs and exchange you like to provide liquidity. You can do some basic testing without any balance though.

Step 2
Make sure you create so-called API keys. They always come in pairs. There is a public key and a secret key.
On CCEDK you can find that under ‘My account’ (click on your login name on top right corner) and choose API keys
On Bitcoin.co.id you can find it under ‘Account’ on the left and then goto ‘Android App + Trade API’

Step 3
Download the zip (Windows) or tarball (Linux) here. Unpack the zip on a suitable location e.g. c:/program files/nu-pool for Windows, you will need to create that first and move the ZIP into that folder.
Make sure you read and understand the disclaimer in the readme.md from the ZIP you just unpacked.
You can also read it here.

Step 4
For Windows

  • Open explorer and go to the location where you unpacked the ZIP
  • Open the ‘nu-pool-x.yyLB’ folder (where x.yy is the version number e.g. 0.96)
  • Open de ‘windows’ folder
  • Edit the .bat file (right click,edit) with the exchange you like to start with e.g. pool-ccedk-usd.conf
    When open look for the header REQUIRED PARAMETERS,
  1. replace the ‘xxxxxx’ under NuBits pay-out addres with an address from your wallet. On this address you will receive any pay-outs
  2. replace the ‘xxxxx’ under Api-key from the exchange with the first key you have created under step 2
  3. replace the ‘xxxxx’ under Api-secret from the exchange with the second key you have created under step 2
    Make sure you never share the second secret key with anyone else. It is like your password.
  4. Optional Edit the minimal interest rate you want under optional parameters (default=0 is pool maximum). You will need to enter it for the bid and sell side separated with a comma like this: 0.25,0.1
  5. Save the file with File-Save and then File-Exit.

We are now getting close!

Step 5 (final)

  • Start (double click) the .bat file (there are three of them) of the exchange and pair you like to start with.
    (when it complains about compression, you haven’t unzipped the file (step 3) you downloaded or you are looking into the zip instead of the directory where you were supposed to unzip to)

At this point a dos command box (cmd.exe) opens.
When all went well, it would show something like this:

X:\temp\NuBits\Order-bots\Nu-pool-0.9\python>…\python\client.py pool-ccedk-liqu
2015/04/27-19:47:09 INFO: starting PyBot for eur on ccedk
2015/04/27-19:47:11 INFO: successfully deleted all orders for eur on ccedk
2015/04/27-19:47:12 INFO: waiting 4.70 seconds to synchronize with other trading
bots for eur on ccedk
2015/04/27-19:48:09 INFO: ccedk - balance: 0.00000000 rate: 0.00% ppm: 0.0000000
0 efficiency: 0.00% rejects: 0 missings: 0 - WN6G1LV3WX20REQPGGZNRJL6H09R8OJ1465

You will see it registering as above and it puts your entire balance on order. Therefore it can be handy to have a second account or move some funds if you still want to do other trades at the same time or don’t want your entire balance on order. If you want you can have a look at the exchange itself and you will see that your order is automatically placed by the bot.

Stopping the bot/.bat
To stop the bot on your client and with that the .bat file, click in the dos box and press CTRL-C. The bot terminates and cancels your orders. When your computer is turned off without cancelling your order, your order will still be on the exchange! Restarting the bot and properly cancelling them works or otherwise just log into the exchange to manually cancel the orders.

Linux/Mac install and manuals
This is just a quick guide, if it dazzles you or you are using Linux, you might start with Nu-pool first as they have created an excellent and detailed manual here. The software basically works the same. Liquidbits.net is just a different server/pool and the only things which are different are the .conf files. If you know what you are doing, it does work on Linux and Mac

Running on nu-pool and liquidbits.net at the same time
You can run two or more .bat files (e.g. for Bittrex on nu-pool and ccedk on liquidbitsnet) at the same time as long as they are on a different exchange. For running two bots on the same exchange but on different pairs, you will practically need two accounts on the exchange.

Settings for test
The limited settings for this testrun are set on the server as follows:
CCEDK NBT/USD pair rate 0.33%/day max 50 NBT on both bid and ask side
CCEDK NBT/EUR pair rate 0.33%/day max 12.50 NBT on both bid and ask side
Bitcoin.co.id NBT/BTC pair rate 0.38% on bid side and 0.28%/day on ask side. Max 12.5 NBT on both sides

Limited testrun and limited support
This is a testrun and I’m funding this myself. There are only limited funds available. Minimum payout = 0.25 NBT. Payouts happen every 24h when all goes well. When a server reset is required, the counter starts on zero, but you won’t loose more than 0.25 NBT assuming I don’t need to reset multiple times within a 24h window.

Please let me know if you are stuck or there are mistakes in the quick guide above or the .conf files provided. Happy to guide you through. Please be aware I’m in a different timezone and not 24/7 available.

The testrun will be at least a week. When successful I will submit the custodial grant for voting and will get some better and more comprehensive documentation in place.

Looking forward to your feedback.

Checking server status
You can check the overall server status here: http://nbt.liquidbits.net/status.

You can check the existing orders here:
For CCEDK/USD: http://nbt.liquidbits.net/info/ccedk/usd
For CCEDK/EUR: http://nbt.liquidbits.net/info/ccedk/eur
For Bitcoin.co.id/BTC: http://nbt.liquidbits.net/info/bitcoincoid/btc
Testing with BTER or Poloniex on the BTC pairs on nbt.liquidbits.net is allowed for people who know what to do. This won’t be part of the official testing though.


But when USD is compensated better, I think they will buy the USD with NBT which results in the mad game Creon describes above.

However if there is no usd in the first place, those players won t be able to play.
Is there a way to compensate better depositors of usd (not exchangers from nbt to usd)?

Not at the moment. Creon and Nagalim explained options above, but they require a lot of changes in the code.

I see. Tks for the clarification.

It is difficult to compensate USD depositors more than NBT depositors. This is because the very peg we are attempting to support makes it so easy to go back and forth between USD and NBT so if one is more compensated custodians will always trade to get back to the higher compensation side. We don’t want custodians initiating trades on NBT/USD. If gaming the system is as easy as pushing a button and paying a small trading fee, it’s not a question of ‘if’ people cheat.

That said, there must be a way to accomplish this goal. We’ll just need to talk about it more but in the meantime we want liquidbits to go forward…

1 Like

I hoped somehow that ./client-ccedk-usd would take into argument pool-ccedk-usd.conf automatically but it did not work out.
Had to do: ./client.py …/unix/pool-ccedk-usd to start the bot on ccedk’s nbt/usd pair.
Not sure if it s the right way to do with liquidbits.
Alternatively, since I was used to nupool’s ./client, I edited pool.conf :smile: and could run the bot with just ./client .
Anyway the bot places a sell order.
I have also 0.15 usd but it does place a buy order.

Is there any intrinsic min requirement?

This changes the dynamic somewhat, but I think it’s nice and implementable and superficially solves the problem.

getting now:DEBUG: exception caught in trading bot: ‘usd’ on ccedk’s nbt/usd

I’ll look into that today. What actions preceeded the error?

nothing in particular i think.

Line preceding the error:
INFO: ccedk - balance: 0.00374018 rate: 0.33% ppm: 0.00000298 efficiency: 100.00% rejects: 0 missi
ngs: 0 - usd - ask: 1.3000 x 0.33% - XXXX

I have something like 0.5 usd in ccedk by the way but somehow the bot does not put them on the buy side.

Will see if I can find something in the server logs. Haven’t seen that before myself.

Edit: nothing on the server logs except a small number of rejects which is not too bad. Likely to be something which happened on client side, will also start running USD pair as I have ran EUR pair in last 2 days without a problem except some missed handshakes. But they are not persistent, more like glitches in connections.

Thank you very much for continuing the great work that @creon has paved the way for!
I’ve just started participating in the beta test for liquidbits.
I thought you might be interested in a tester on linux.

It works like a charm and I only rarely have errors like:

  • 2015/04/29-21:21:05 ERROR: submit: server response invalid
  • {u’pagination’: False, u’errors’: False, u’response’: {u’entity’: {u’order_id’: 492755, u’transaction_id’: 1088990}}}

The first one occurs from time to time, can’t find a pattern…
The second one upon startup of the pool client, in a repeatable manner. It looks like it precedes placing an order.

And I have found a tiny glitch in version nu-pool-0.96LB:
the script unix/client-ccedk-usd tries to load a file pool-ccedk-usd.conf which doesn’t exist.
Workaround: open a shell, change to the unix directory and execute:

sed -i -e s/pool-ccedk-usd.conf/pool-ccedk-usd/ client-ccedk-usd

Afterwards you can edit pool-ccedk-usd:

sed -i -e s/"address = xxxxxxx"/"address = yourNuBitsAddress"/ pool-ccedk-usd
sed -i -e s/"apikey = xxxxxxx"/"apikey = yourApiKey"/ pool-ccedk-usd
sed -i -e s/"apisecret = xxxxxxx"/"apisecret = yourApiSecret"/ pool-ccedk-usd

Remark: the quotation marks in the expression are needed; don’t remove them.
You can for sure use an editor, but as I run this on my headless RaspberryPi, I prefer using the shell anyway…

Now you are fine to run


If you want to connect to your machine to check the status, I recommend tools like “screen”.
screen is by man page a “screen manager with VT100/ANSI terminal emulation”

1 Like

@masterOfDisaster Remove this line: https://github.com/Cybnate/nu-pool/blob/master/python/exchanges.py#L400

@Cybnate why are you always checking some boolean by asking “if b is True:” and not just “if b:”?

1 Like