BitShares Forum
Main => General Discussion => Topic started by: maqifrnswa on August 27, 2014, 01:55:53 pm
-
Many here are technically inclined, but not necessarily financially experienced. Right now bitsharesx is still in its infancy, and as such has small liquidity. That creates an opportunity for profit by arbitrage. Such profit also injects liquidity - so it's a win-win.
Here are two quick ways you can participate:
1) Inter-exchange arbitrage If you know the "true" market rate for BTSX in dollars (e.g., from coinmarketcap/bter/btc38 prices), you can trade the spread between such a "true" price and the price trading for BTSX:USD in bitsharesx:
fill in the gaps...
while True:
time.sleep(2)
new_price = get_true_price()
sec_since_update += 2
if abs(new_price - last_price) / last_price > (SPREAD / 3):
log("Price moved - old: %f new: %f" % (last_price, new_price))
log("Seconds since previous update: %d" % sec_since_update)
client.cancel_all_orders("USD", SYMBOL)
client.wait_for_block()
usd_balance = client.get_balance("USD")
btsx_balance = client.get_balance(SYMBOL)
client.submit_bid(0.3*(usd_balance * new_price), SYMBOL, new_price * (1+SPREAD), "USD")
client.submit_ask(0.3*btsx_balance, SYMBOL, new_price * (1-SPREAD), "USD")
last_price = new_price
2) Three-legged arbitrage If you can trade BTSX:BitUSD (bitsharesx), BitUSD:BTC (https://bter.com/trade/btc_bitusd), and BTC:BTSX (https://bter.com/trade/BTSX_BTC), you can use arbitrage to generate more coins if the exchange rates are not "correct":
right now (1400 UTC 2014-08-27) if I start with 1 BTSX and convert it to BTC then BITUSD then back to BTSX I end up with
1* 0.0000710 BTC/BTSX * 551.00 BitUSD/BTC * 26.698008 BTSX/USD = 1.044452771
That means if there are no fees, and I just buy one BTC then use that to buy BitUSD thenuse that to buy BTSX, and I end up with 4% more BTSX then I started with, free money.
3) Discount trading just check this out, and act accordingly:
https://bter.com/trade/BITUSD_USD
-
I have a little programming experience but don't feel comfortable enough to execute the code (and risk placing incorrect orders stuck in a while loop). Could someone comment each line of code and further explain the details? For instance, what does the function 'get_true_price()' actually do? Where does it get that price and what does the function do? Does it pull from an internal price feed? And from the looks of it SYMBOL and SPREAD are the only variables that need to be modified to 'fill in the gaps'.. am I reading that correctly? Gah, I'm such a n00b :D
-
I have a little programming experience but don't feel comfortable enough to execute the code (and risk placing incorrect orders stuck in a while loop). Could someone comment each line of code and further explain the details? For instance, what does the function 'get_true_price()' actually do? Where does it get that price and what does the function do? Does it pull from an internal price feed? And from the looks of it SYMBOL and SPREAD are the only variables that need to be modified to 'fill in the gaps'.. am I reading that correctly? Gah, I'm such a n00b :D
The gaps include writing the functions in that skeleton, including get_true_price() and all the client.*. It's up to the programmer to choose where and how to get the price; there is no internal price feed for that.
-
I have a little programming experience but don't feel comfortable enough to execute the code (and risk placing incorrect orders stuck in a while loop). Could someone comment each line of code and further explain the details? For instance, what does the function 'get_true_price()' actually do? Where does it get that price and what does the function do? Does it pull from an internal price feed? And from the looks of it SYMBOL and SPREAD are the only variables that need to be modified to 'fill in the gaps'.. am I reading that correctly? Gah, I'm such a n00b :D
I'm in the same boat. It's killing me to have my BTSX stake just sitting around when arbitrage opportunities are growing on trees. I'd tip heavily to get my hands on a nice modular arbitrage tool.
Sent from my SCH-S720C using Tapatalk 2
-
I have a little programming experience but don't feel comfortable enough to execute the code (and risk placing incorrect orders stuck in a while loop). Could someone comment each line of code and further explain the details? For instance, what does the function 'get_true_price()' actually do? Where does it get that price and what does the function do? Does it pull from an internal price feed? And from the looks of it SYMBOL and SPREAD are the only variables that need to be modified to 'fill in the gaps'.. am I reading that correctly? Gah, I'm such a n00b :D
I'm in the same boat. It's killing me to have my BTSX stake just sitting around when arbitrage opportunities are growing on trees. I'd tip heavily to get my hands on a nice modular arbitrage tool.
Sent from my SCH-S720C using Tapatalk 2
I second that
-
Keep in mind that the arb bot probably needs to factor in relative short/long demand... the strategy that works "long term" (flux around "true price") is not the best "short term" which is "flux around premium".
The "premium" we see right now suggests that the rate of return demanded on BitUSD is about 14% between "now" and "when the peg hits parity".
-
Keep in mind that the arb bot probably needs to factor in relative short/long demand... the strategy that works "long term" (flux around "true price") is not the best "short term" which is "flux around premium".
The "premium" we see right now suggests that the rate of return demanded on BitUSD is about 14% between "now" and "when the peg hits parity".
Agreed, but zero-delay arbitrage across exchanges works no matter what your time horizon is.
Sent from my SCH-S720C using Tapatalk 2
-
Agreed, but zero-delay arbitrage across exchanges works no matter what your time horizon is.
This is what I'm thinking - exchanges have liquidity, bitsharesx doesn't at the moment, so let's inject some of that exchange liquidity into bitsharesx using zero-delay arb.
-
Agreed, but zero-delay arbitrage across exchanges works no matter what your time horizon is.
This is what I'm thinking - exchanges have liquidity, bitsharesx doesn't at the moment, so let's inject some of that exchange liquidity into bitsharesx using zero-delay arb.
+1... lots of financial incentive out there for people to develop this :)
-
Be mindful to take into account liquidity and exchange fees.
-
+1... lots of financial incentive out there for people to develop this :)
... and not release the code ..
a.k.a ... not deliver until unprofitable ... (reminds you of sth.?)
-
I have a little programming experience but don't feel comfortable enough to execute the code (and risk placing incorrect orders stuck in a while loop). Could someone comment each line of code and further explain the details? For instance, what does the function 'get_true_price()' actually do? Where does it get that price and what does the function do? Does it pull from an internal price feed? And from the looks of it SYMBOL and SPREAD are the only variables that need to be modified to 'fill in the gaps'.. am I reading that correctly? Gah, I'm such a n00b :D
How are we supposed to use the code? Does it connect to the RPC API or what?
-
I have a little programming experience but don't feel comfortable enough to execute the code (and risk placing incorrect orders stuck in a while loop). Could someone comment each line of code and further explain the details? For instance, what does the function 'get_true_price()' actually do? Where does it get that price and what does the function do? Does it pull from an internal price feed? And from the looks of it SYMBOL and SPREAD are the only variables that need to be modified to 'fill in the gaps'.. am I reading that correctly? Gah, I'm such a n00b :D
I'm in the same boat. It's killing me to have my BTSX stake just sitting around when arbitrage opportunities are growing on trees. I'd tip heavily to get my hands on a nice modular arbitrage tool.
Sent from my SCH-S720C using Tapatalk 2
I second that
We need a scripting language built into the interface somehow. It's that simple.
The more complicated it is to do the less people there will be doing it.
I can handle C++ but someone has to make a blog like "how to make bots using Bitshares API".
Then do a brief run through of the different functions. Best way to do it is let us input our scripts or our code directly into Bitshares. If it has to deal with compiling and the formulas for arbitrage aren't documented then less people will make bots.
+1... lots of financial incentive out there for people to develop this :)
... and not release the code ..
a.k.a ... not deliver until unprofitable ... (reminds you of sth.?)
I'm not even asking about the code. I want to know how to interact with the API so I can write my own code. Also I want the formulas which make up the underlying basis of the arbitrage bots.
As far as I know it gets a set of price feeds and compares them, then trades on the difference. The code itself is very simple for any programmer. It looks like it's using RPC API http://bitshares.org/documentation/group__rpc__api.html
I will see if I can write a script myself later today.
-
checkout:
https://bitsharestalk.org/index.php?topic=5562.0;all
Some of my own code (no market, just interface)
https://github.com/xeroc/pytshares/blob/master/btsrpcapi.py
-
checkout:
https://bitsharestalk.org/index.php?topic=5562.0;all
Some of my own code (no market, just interface)
https://github.com/xeroc/pytshares/blob/master/btsrpcapi.py
awesome, thanks - great demonsrtation of RPC calls
I wanted to modify the three-legged inter-exchange arbitrage to demonstrate another common case (one we're in right now)
| bid | ask |
BTC/BTSX | 0.0000655 | 0.000066 |
BitUSD/BTC | 540 | 600 |
BTSX/BitUSD | 26.5 | 27 |
this is the current bter and bitsharesx snapshot. There is an opportunity for free, instant money there - while also evening out liquidity
1) the spread of BitUSD/BTC is so large that if you place a bid that is fulfilled less than 561.1672278339 or an ask greater than 576.1198329252, and you 2) move the exact same amount of what you purchased through the BTC->BTSX->BitUSD or BitUSD->BTSX->BTC chain, you will end up with more BitUSD and BTC than you started with, instantly.
-
Arbitrage requires a lot of liquidity but It's just such a pain to do it manually.
If someone already have a working arbitrage bot I'm more than happy to throw in some assets for operations.
I understand that a sw for a proper arbitrage fund is complicated but to bring some liquidity and stabilise BTSX and BitUSD markets I'm happy to throw in some money with a gentleman's agreement :)
-
Arbitrage requires a lot of liquidity but It's just such a pain to do it manually.
If someone already have a working arbitrage bot I'm more than happy to throw in some assets for operations.
I understand that a sw for a proper arbitrage fund is complicated but to bring some liquidity and stabilise BTSX and BitUSD markets I'm happy to throw in some money with a gentleman's agreement :)
I'm with szert, Count me in also please.