Pages:
Author

Topic: Python arbitrage script between two Bitcoin sports exchanges! - page 2. (Read 6600 times)

full member
Activity: 369
Merit: 111
I appreciate your detailed response but I'll have to take option 3 for the moment. Wish I could be of more assistance but I don't have Linux or an understanding of Python.
member
Activity: 113
Merit: 10
I am interested. And it is a fair business proposal to offer this in exchange for referral bonuses from people capable of moving large amounts of BTC around to take full advantage of arbitrage possibilities. I am one of those people. So if the script works, I'll register to these sites under your name.

Hey Hatcher Smiley

I'm still working out the kinks of the script. I agree it's fair trade to collect ref signups in exchange for the script, though - seeing as how other people (such as yourself) have the bankroll to benefit, and I'd take 30% of 4% of profit (not total gain - just the difference on gain and stake) on half the bets (the ones made on BetBTC that win). Hopefully people would see the benefit of having the script run continuously, and gain considerable $ profit over time - thereby ensuring my gains through the ref. signups - while I can share the script any number times and as long as people don't bet 10s 50s BTC culmultatively on each available arb. opportunity, there should be plenty of arb for everyone!

If you're fine creating a new Fairlay and BetBTC account (Fairlay doesn't have an active ref program):

https://www.betbtc.co/?ref=8908
https://fairlay.com/#signup

and if you're fine testing the script as-is with a minimal set of deposits (with the warning that some things aren't a-ok yet), would you want to move forward at present? The faster I can get the kinks worked out, the faster I can offer the ref. signup in exchange for the script deal.

Here's the current situation:

1) Fairlay API / UI disagreed on Odds that were bet on in a Bid order (thereby breaking Arb calculation),
2) Fairlay communicated to me to use the inverse odds,
3) I switched up the script to use inverse odds in all cases,
4) Waited a few hours for bets to close and for me to have funds avail.,
5) Tried the script again.

As in my last post on the original thread, the UI and the API now agree (however this was for a Ask order - only difference I can see). Since then, the only response I got from Fairlay was:

'Sorry, it's difficult to help you with this  more than we already did.

Best,

Team Fairlay'

So I'm on my own-e-oh.

There's two cases as to what happened here:

a) the API changed for no good reason other than my support ticket (+ they didn't tell me about it),
b) the API treats Bids in the inverse and Asks as you'd expect.

Either way, further testing is required for a finished product.

I'll have some funds (but not enough, likely, to support min. 5 mBTC deposit @Fairlay - unless my few open bets at Fairlay win and I have some spare change there for further testing) in the next ~12 hours.

If you:

i) Want to test the script with your own small deposits on your own accounts, let me know and I'll share the script + startup instructions. Do you have Linux + an understanding (at any level) of Python? I can PM the script shortly / in the morning (it's ~midnight here).
ii) Want to 'donate' / lend so I can fully test the script, then provide you (and others) a finished product, you (or anyone Smiley ) can here:

336un567tBHf1ho3qpxFhEMh5pwqRZw57z (BetBTC)
1ExtwzW8Q9jk32TmfE8aCYaVHwvdRTbTe4 (this is Fairlay, min. deposit 0.005 BTC)

iii) Want to hold off until I have a finished product, that's fine too - I'll keep your name in mind when this thing finally works as expected!

Thanks again for your interest - hope to hear from you!
full member
Activity: 369
Merit: 111
I am interested. And it is a fair business proposal to offer this in exchange for referral bonuses from people capable of moving large amounts of BTC around to take full advantage of arbitrage possibilities. I am one of those people. So if the script works, I'd be more than happy to hop on board and register to these sites under your name.
member
Activity: 113
Merit: 10
OK don't ask me why but it appears Fairlay changed the way their API works since I chatted with them?

Or it works differently in different scenarios, I'm unsure until I get a reply / am able to test more.

I just made a number of predictions (all with stream 6 ie. where the code in client.py says print 6):

[{'Sub': '', 'Am': 1.0, 'Oid': '-1', 'Pri': 2.55, 'Mid': '113963738345', 'Boa': 1, 'Rid': '0', 'Mct': 0, 'Type': 0}]
[u'{"Price":2.55,"RemAmount":0.0,"State":2,"BidOrAsk":1,"PrivAmount":1.0,"PrivSubUser":"","PrivCancelAt":3155378975999999999,"makerCT":0,"_Type":0,"PrivID":636381047605239864,"PrivUserID":1007855}']
{u'_Type': 0, u'Price': 2.55, u'PrivCancelAt': 3155378975999999999, u'PrivSubUser': u'', u'State': 2, u'PrivAmount': 1.0, u'makerCT': 0, u'RemAmount': 0.0, u'PrivUserID': 1007855, u'PrivID': 636381047605239864, u'BidOrAsk': 1}


and twice:

[{'Sub': '', 'Am': 1.136717735653077, 'Oid': '-1', 'Pri': 1.68, 'Mid': '113963783574', 'Boa': 1, 'Rid': '0', 'Mct': 0, 'Type': 0}]
[u'{"Price":1.68,"RemAmount":0.0,"State":2,"BidOrAsk":1,"PrivAmount":1.13672,"PrivSubUser":"","PrivCancelAt":3155378975999999999,"makerCT":0,"_Type":0,"PrivID":636381028756943647,"PrivUserID":1007855}']
{u'_Type': 0, u'Price': 1.68, u'PrivCancelAt': 3155378975999999999, u'PrivSubUser': u'', u'State': 2, u'PrivAmount': 1.13672, u'makerCT': 0, u'RemAmount': 0.0, u'PrivUserID': 1007855, u'PrivID': 636381028756943647, u'BidOrAsk': 1}

And ended up with:

https://www.dropbox.com/s/2y4ngou9rdvicyq/Screenshot%20from%202017-08-12%2000-23-32.png

three different bets (from stream 6) that have odds matching what the API expected before it did any inverse odds calculation??

I'll be sure to keep you appraised,
member
Activity: 113
Merit: 10
This is a really clever idea OP. I didn't realize that arbitrage was done among sports betting sites.

You're clearly an intelligent guy and you shouldn't have any trouble finding takers on your offer.

Good luck with finding someone and good work!

Thanks for the vote of confidence! I'm sure @kolesozw will provide an update from a trusted source as soon as we work through the script together.

As a note: I've finished writing the part of the script that adjusts unmatched orders, and it'll be tested (along with the changes for inversion of the odds on Fairlay) as soon as a Bitcoin transaction is confirmed...
newbie
Activity: 23
Merit: 1
This is a really clever idea OP. I didn't realize that arbitrage was done among sports betting sites.

You're clearly an intelligent guy and you shouldn't have any trouble finding takers on your offer.

Good luck with finding someone and good work!
member
Activity: 113
Merit: 10
To quote Fairlay:

Ok to answer your odds problem.   In the Fairlay UI we make it a bit simpler and only show the odds the user actually gets and the stake given is always the liability.

On the API however, if you lay 100mBTC  at 2.78   you are actually risking 178mBTC to win 100mBTC.       

We also just added this to the Readme file for clarification.

Best,

Team Fairlay

In short, the reason the odds were mixed up is because their advertised odds have to be calculated using the inverse.

That said, I'm still seeing profitable arb sequences using the new numbers.

@kolesozw - I'll send you a new .zip to your PM.

Note that the immediate next step is to write code so that:

When there is an unmatched order (because the order for the current most profitable volume/odds is taken up by some other market taker in those few seconds between checking and betting), the code checks all unmatched orders and modifies them to get matched by the next best volume/odd. I had a bet go through on BetBTC that didn't meet any current volume/odd, even though it existed for the few seconds where there was volume @ that odd.
member
Activity: 113
Merit: 10
@kolesozw, @shintosai

I've been in touch with the support departments at BetBTC and Fairlay, and they both encourage arbitrage bets Smiley They're the platforms I'd been using.

I'm having issues whereby the script executes a bet on Fairlay through the API, gets responses from the API indicated the price was accepted, but the odds I see on the Fairlay interface are far worse than the odds stated by the API (and that are quoted on the competition page).

Ie:

Tried to bet @2.78 Ask (meaning the player will lose), get feedback from the API that 2.78 is good odds, then see in the interface 1.561 odds Sad

I've just now emailed Fairlay support asking for help. Will keep everyone appraised.

Ps this is the exact same behavior I saw with the original three orders earlier today... I have add'l output this time to help troubleshooting.
member
Activity: 113
Merit: 10
Thanks @kolesozw, PMd. Smiley

@shintosai - does betcoin.ag provide an API for gathering market details / placing bets on sporting events? I see Tennis is listed, which is a good sign for compatibility with what I've done so far. Even one that's not published to the general public? I could probably drive traffic if you a) don't care about arb b) want to participate Smiley
member
Activity: 113
Merit: 10
Thanks @shintosai!

@kolesozw, I can share the script now (assuming I can PM - unsure as I haven't tried it yet) if you understand that it had ~2% loss on the three original trades I was expecting ~9% profit on. I'll explain what I've tweaked and why I think that'll resolve the issue once I have BTC to test (or, alternatively, maybe you can test).

Will update everyone as I know more. It's about 1 hour until my tennis matches resolve, and then a BTC transfer between exchanges and I'll be able to test the new version.
legendary
Activity: 1316
Merit: 1004
FRX: Ferocious Alpha
Hey @kolesozw,

I'll be able to share the script as soon as I work out the final details. As of yet it opened three trades that consumed my bankroll on one exchange, and I can't make new bets until those resolve one way or another.

My concern is that before I tweaked my code since these bets, the indicated profit % of 9ish % was eaten up as the odds I bet on were slightly worse than the odds the script was expecting - so, until I'm sure the script works as expected (and is profitable), I'll be sure to keep you updated on my progress throughout today.

Thanks for your interest!

Sure, no problem. Just PM me when you are ready.
hero member
Activity: 756
Merit: 500
Hey @kolesozw,

I'll be able to share the script as soon as I work out the final details. As of yet it opened three trades that consumed my bankroll on one exchange, and I can't make new bets until those resolve one way or another.

My concern is that before I tweaked my code since these bets, the indicated profit % of 9ish % was eaten up as the odds I bet on were slightly worse than the odds the script was expecting - so, until I'm sure the script works as expected (and is profitable), I'll be sure to keep you updated on my progress throughout today.

Thanks for your interest!
very honest answer and i think it will be worth watching this thread maybe OP will  bring something good to this community and
hopefully kolesozw will be able to test it and check it by himself and see if this can help most of us to take advantage. good luck
op keep us updated regarding to this script.
member
Activity: 113
Merit: 10
Hey @kolesozw,

I'll be able to share the script as soon as I work out the final details. As of yet it opened three trades that consumed my bankroll on one exchange, and I can't make new bets until those resolve one way or another.

My concern is that before I tweaked my code since these bets, the indicated profit % of 9ish % was eaten up as the odds I bet on were slightly worse than the odds the script was expecting - so, until I'm sure the script works as expected (and is profitable), I'll be sure to keep you updated on my progress throughout today.

Thanks for your interest!
legendary
Activity: 1316
Merit: 1004
FRX: Ferocious Alpha
Hello,

Arbitraging is interesting and I have interest to review your script. And test it.

I have some Python knowledge.
Please send it to me.

Regards
member
Activity: 113
Merit: 10
Hey everyone,

I've developed a Python script that enables arbitrage betting between two Bitcoin-enabled sports exchanges (via API - leaving them nameless in public in case they don't approve of arb). While there're still some kinks, it should work properly within the next few hours (just pending a few bets I'd made to pay out and for me to test my new version).

I'd like to offer the script in return for people signing up for one of the exchanges using my referral link Smiley The other one, unfortunately, doesn't have a ref program. No upfront cost, no subscription, nadda. I profit when you profit Smiley (and this exchange only takes a % on your wins with that particular exchange).

What's arb betting?

Pinnacle describes it best (because they encourage arbers):

https://www.pinnacle.com/en/promotions/arbitrage-friendly
https://www.pinnacle.com/en/betting-articles/Betting-Strategy/what-is-arbitrage-betting/PSWJPK7ECRAXM2BP

What my script does:

Compares all Tennis events over the next 14 or so hours between the two exchanges, then calculates which competitions it can make a 5-15% profit from by betting both sides of the event. It then calculates the appropriate amounts to bet according to how much volume of unmatched bets there are at that price. It then places the opposing bets for either the max. value it can (based on whichever outcome's volume is lower), or the max. value the current balance on the exchanges will allow for (divided by 6) (this is a bit testy because one of the exchanges doesn't return current avail. balance, just current balance since the last event - so while there's open bets, the current bal. from last event doesn't match real available balance - to offset this the script takes the lower of either balance on either exchanges for calculation). Then, on next run (which is constant in a loop), the script would notice if there's still an arb opportunity that exists with the next layer of volume/s.

Note that the APIs don't allow auto-withdrawal of funds (I'm not going to steal your BTC).

What you'd need:
1. Preferably you'll have a Linux box, access to a free Linux VPS (Amazon AWS EC2 free tier would do the trick), or some know-how surrounding getting Python to work on Windows / Mac. I'll help you set up the script, sign up to the two exchanges, and coach you should you have any questions.
2. Some BTC - there's a minimum 1 mBTC (0.001 btc) for bets on one exchange. The other apparently has no min. bet.

Next steps for the script:

1. I'd like to repurpose the script for soccer (the only other sport the two bookies have in common) but the issue is that I don't really understand 3-outcome betting (whereas tennis has two players and two outcomes, there're far fewer betting types).
2. Integrate with fiat bookie/exchange APIs (not sure I want to do this - the ease of BTC withdraw/deposit compared to fiat makes this a more interesting proposition for BTC exchanges (plus that much is already done for tennis)).

I see no issue with sharing the script as a) I don't have much of a bankroll and this would allow me to have some financial benefit while benefitting everyone else, b) I see many, many arb opportunities (at present there are 2, with volumes at those odds of 1-4 btc).

I'll have screenshot proof of % gains from specific Tennis matches to interested parties via PM.
Pages:
Jump to: