Author Topic: How you can help the economy: Arbitrage for programmers  (Read 4584 times)

0 Members and 1 Guest are viewing this topic.

Offline emailtooaj

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.
Sound Editor of Beyondbitcoin Hangouts. Listen to latest here - https://beyondbitcoin.org support the Hangouts! BTS Tri-Fold Brochure https://bitsharestalk.org/index.php/topic,15169.0.html
Tip BROWNIE.PTS to EMAILTOOAJ

Offline szert

  • Newbie
  • *
  • Posts: 19
    • View Profile
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 :)

Offline maqifrnswa

  • Hero Member
  • *****
  • Posts: 661
    • View Profile
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)

bidask
BTC/BTSX0.00006550.000066
BitUSD/BTC540600
BTSX/BitUSD26.527

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.

« Last Edit: August 28, 2014, 09:10:20 pm by maqifrnswa »
maintains an Ubuntu PPA: https://launchpad.net/~showard314/+archive/ubuntu/bitshares [15% delegate] wallet_account_set_approval maqifrnswa true [50% delegate] wallet_account_set_approval delegate1.maqifrnswa true

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc

Offline luckybit

  • Hero Member
  • *****
  • Posts: 2921
    • View Profile
  • BitShares: Luckybit
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.

« Last Edit: August 27, 2014, 07:01:52 pm by luckybit »
https://metaexchange.info | Bitcoin<->Altcoin exchange | Instant | Safe | Low spreads

Offline luckybit

  • Hero Member
  • *****
  • Posts: 2921
    • View Profile
  • BitShares: Luckybit
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?
https://metaexchange.info | Bitcoin<->Altcoin exchange | Instant | Safe | Low spreads

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
+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.?)

Offline bitmeat

  • Hero Member
  • *****
  • Posts: 1116
    • View Profile
Be mindful to take into account liquidity and exchange fees.

Offline bytemaster

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 :)
For the latest updates checkout my blog: http://bytemaster.bitshares.org
Anything said on these forums does not constitute an intent to create a legal obligation or contract between myself and anyone else.   These are merely my opinions and I reserve the right to change them at any time.

Offline maqifrnswa

  • Hero Member
  • *****
  • Posts: 661
    • View Profile
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.
maintains an Ubuntu PPA: https://launchpad.net/~showard314/+archive/ubuntu/bitshares [15% delegate] wallet_account_set_approval maqifrnswa true [50% delegate] wallet_account_set_approval delegate1.maqifrnswa true

Offline biophil

  • Hero Member
  • *****
  • Posts: 880
  • Professor of Computer Science
    • View Profile
    • My Academic Website
  • BitShares: biophil
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

Support our research efforts to improve BitAsset price-pegging! Vote for worker 1.14.204 "201907-uccs-research-project."

Offline bytemaster

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".     
For the latest updates checkout my blog: http://bytemaster.bitshares.org
Anything said on these forums does not constitute an intent to create a legal obligation or contract between myself and anyone else.   These are merely my opinions and I reserve the right to change them at any time.

Offline soniq

  • Full Member
  • ***
  • Posts: 181
    • View Profile
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
Pr7V9GUm59dtKWXG6RJSymPsyCaCKWwNEj
Soniq on Bitcointalk -- Verified
Bitshares btsx:soniq

Offline biophil

  • Hero Member
  • *****
  • Posts: 880
  • Professor of Computer Science
    • View Profile
    • My Academic Website
  • BitShares: biophil
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

Support our research efforts to improve BitAsset price-pegging! Vote for worker 1.14.204 "201907-uccs-research-project."

Offline maqifrnswa

  • Hero Member
  • *****
  • Posts: 661
    • View Profile
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.
maintains an Ubuntu PPA: https://launchpad.net/~showard314/+archive/ubuntu/bitshares [15% delegate] wallet_account_set_approval maqifrnswa true [50% delegate] wallet_account_set_approval delegate1.maqifrnswa true