[Passed] New CNY Feed for NuPond

Arbitrage channels are important when considering the price of a currency relative to the dollar (or the Nubit). In the crypto-sphere, the economy is dominated by the bitcoin instead of the dollar and bitcoin markets constitute the important arbitrage channels we need to consider. Chinese markets are notorious for being manipulated by government controls, and it is important that we be sensitive to the off-shore price of the Chinese Yuan.

More practically speaking, as long as we attempt to peg the CNY/USD price as reported by yahoo we will either be providing an obscenely cheap arbitrage channel or a broken peg, depending on if we are insolvent in that market or not. If we attempt to peg the off-shore price instead, our peg will be relevant for both the buy and sell side spread.

The software is in development here: https://github.com/Nagalim/alp-collection/tree/CNYfeed

Proposal RIPEMD160 hash: 20b265248d00ec5b5662baca002fee7df277c287

=##=##=##=##=##=## Custodian Hash starts with this line ##=##=##=##=##=##=

Custodial Address: BRz87ebxSypVwdVu8GZuYG4FFxTnbwrfkQ
Amount Requested: 100 NBT

NuPond will begin using a price feed derived from BTC/CNY feeds in conjunction with the normal BTC/USD feeds. OKCoin will be used as the primary BTC/CNY feed with BTCChina as a backup. Latest price tickers will be used, but mechanisms such as moving averages may be implemented later.

The 100 NBT fee may be understood as both a developer and an operator fee for the complications that may be associated with this implementation. This update will be mandatory for all providers as their old clients will not accept a price feed that deviates from the official CNY price this much. Efforts will be taken to give providers a fair chance to update before the server goes live.

=##=##=##=##=##=## Custodian Hash ends with this line ##=##=##=##=##=##=

Verify. Use everything between and including the <custodianhash></custodianhash> tags.
6 Likes

i would vote for this

I have put up the address for voting. I will not switch the main server over until this proposal has reached significant shareholder support. In the meantime, you can keep up on developments here:
[idea]new cny price feed
Again, I will hash this grant when assistant bot wakes up.

run a client for test

many timeout from my side , try to run at VPS

@Nagalim run at linux, cann’t setup order

2015/12/14-21:39:01 INFO: starting PyBot for cny on bter
2015/12/14-21:39:02 INFO: successfully deleted all orders for cny on bter
2015/12/14-21:39:02 INFO: waiting 12.52 seconds to synchronize with other trading bots for cny on bter
Exception in thread Thread-3:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
self.run()
  File "/root/cnyfeed/alp-collection-CNYfeed/python/trading.py", line 342, in run
self.place_orders()
  File "/root/cnyfeed/alp-collection-CNYfeed/python/trading.py", line 278, in place_orders
self.place('bid', bidprice)
  File "/root/cnyfeed/alp-collection-CNYfeed/python/trading.py", line 206, in place
empty = ast.literal_eval(self.fillamount)['bid'] - fullbid
  File "/usr/lib/python2.7/ast.py", line 80, in literal_eval
return _convert(node_or_string)
  File "/usr/lib/python2.7/ast.py", line 79, in _convert
raise ValueError('malformed string')
ValueError: malformed string

2015/12/14-21:40:01 INFO: bter - balance: 0.00000000 rate: 0.00% ppm: 0.00000000 efficiency: 0.00% rejects: 0 missings: 0 - 835BA98B-E192-47A4-82C2-EDE006C44540

Sorry, fixed it. I just missed renaming one of the 'fillfactor’s to ‘fillamount’. If you change the name of that parameter in your pool file, or just redownload the bot, it should work fine.

Would that be reused by CN-NUBITS?

would what be reused? The feed? No, exploring a new feed will be useful for NuBot as well as PyBot but CN-NBT will not really benefit from finding a CNY/USD price, unless we try to peg CN-NBT to US-NBT. Anyway, another conversation for another time.

The deviation on this is pretty rough, orders don’t really stick on the order books for long. I think @mhps’s estimated moving averages will probably help, but of course using 2 BTC price feeds is more volatile than using 1.

As far as I can tell, an EMA implementation would need to occur in both server.py and trading.py separately. To change the price feed, all I had to change was utils.py.

I’m getting good results with 0.5% deviation. I reduced the shift to 0.25% to compensate.

EMA is expotial moving average that gives more weight to recent data pointing, making EMA follow more closely to current price.

You are correct, today I learned. SMA or EMA are both of similar difficulty for implementing, I think. Either would require a memory of recent prices. If you have a good concept for implementation and want either help or just me to do it, let me know. I’ve been testing out different deviations recently, I’m a little disappointed that I have to turn it up so much. A 0.5% randomness in where the orders are kind of starts getting into the excessive side.

Just so shareholders understand, I have been holding this new peg price with 10 NBT/side for the last few days (LP has been spotty cause I’m still debugging, but I’ve only had ~10 NBT of volume). The peg on this pair has been broken for a month, if not for basically the whole time we’ve been operating here. I have held the new price feed with barely any funds and no compensation, I think that shows that the new price feed is indeed the correct direction to take the CNY pool.

new pool or change the pool recent used?

Use port 3336 and the CNYfeed branch of my github. I’ll make this stuff default when the motion passes. Also, I’m still debugging.

is a git pull all that is needed to update?

I only get many lines like

ERROR: server price 6.65354158 for cny deviates too much from price 6.48275000 received from ticker, will try to delete orders on bter

You’re using the new server with the old software, so the server is on the new price feed and you’re still on the old. The new price should be closer to the 6.6 value while the old price is like 6.4.

When I’m confident the grant will pass, I’ll need to push my final update for the branch, pull the branch into the main branch, then restart the server with the new feed. Anyone on the old feed will begin experiencing errors like what @mhps just posted.

To which extent would that improve NuPond ?

I’m sorry, I was under the impression I had put background in the OP. Let me do that.

Done.

1 Like

So the purpose is to replace Yahoo’s CNY/USD feed price by OkCoin’s BTC/CNY feed price using BTC/USD as a pivot?

1 Like

Yup