Bitcoin Forum

Bitcoin => Project Development => Topic started by: HowardF on November 19, 2014, 08:29:13 PM



Title: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF on November 19, 2014, 08:29:13 PM
Description

MarginBot is  a PHP based Margin Lending Management Bot for the Bitfinex API.  It will do it's best to keep any money in the "deposit" wallet lent out at the highest rate possible while avoiding long periods of pending loans (as often happens when using the Flash Return Rate, or some other arbitrary rate). There are numerous options and setting to tailor the bot to your requirements.

Now that we're several versions into this bot, it has several years of stable performance history, and several users who have been using it for more than 3 years.  I myself have been running it on several accounts for ~4 years now, and it has consistently outperformed FRR.  I recently added in Cryptocurrency lending as well, one of the most requested features.  It currently supports all currencies that Bitfinex supports, and you can easily add new currencies as Bitfinex does.

Future Plans
We're always working to add features and improve MarginBot.  My current plan is to try to add some other exchanges, such as Poloniex, though my experience so far has been that the other exchanges tend to have terrible rates compared to Bitfinex.  If anyone has any suggestions for future additions, we're always open to ideas.

Installation

Download the most current version (https://github.com/HFenter/MarginBot/archive/master.zip), unzip to a folder on your server, then browse to that folder. An install script will run you through the rest of the process.

Note: If you get the following error during install:
Code:
PHP Parse error:  syntax error, unexpected ''America/Los_Angeles\\');' (T_CONSTANT_ENCAPSED_STRING), expecting identifier (T_STRING) in /var/www/html/web/install.php on line 92
you most likely have your PHP configured without short_open_tag = on.  Make sure to set
Code:
short_open_tag = on

Upgrading From Older Versions
If you are upgrading from an older version, you may sometimes be required to run through a quick upgrade process the first time you log in.  As of v.1.07+ the bot should automatically detect if you need to upgrade and send you there.  However if it doesn't work for some reason, just go to yoursite.com/MarginBot/update.php and it should detect if you need to upgrade or not.


Updates
  • 11/22/2014 - Update v0.1.02 posted - Details (https://bitcointalk.org/index.php?topic=865250.msg9623694#msg9623694)
  • 11/24/2014 - Update v0.1.03 posted - Details (https://bitcointalk.org/index.php?topic=865250.msg9639730#msg9639730)
  • 11/26/2014 - Update v0.1.04 posted - Details (https://bitcointalk.org/index.php?topic=865250.msg9664229#msg9664229)
  • Critical Update - 12/16/2014 - Update v0.1.05 posted - Details (https://bitcointalk.org/index.php?topic=865250.msg9857824#msg9857824)
  • 12/18/2014 - Update v0.1.06 posted
  • 8/17/2017 - Update v0.1.07 posted - Details (https://bitcointalk.org/index.php?topic=865250.msg20969175#msg20969175)
  • 9/19/2017 - Update v0.1.08 posted - Details (https://bitcointalk.org/index.php?topic=865250.msg22007217#msg22007217)

Requirements

A live webserver running
  • PHP 5.1+ (with CURL support)
  • MySQL
  • Access to add a cronjob
  • A Bitfinex Account with API Access
  • At least $50 in your Bitfinex "Deposit" wallet. Preferably $100 or more. ( Note: This is a bitfinex requirement, not a bot requirement. Bitfinex doesn't allow Margin Loans of less than $50. )

I'm sure everyone reading this already has a bitfinex account, but if you don't for some reason, please consider using my affiliate code ( vsAnxuo5bM ) (https://www.bitfinex.com/?refcode=vsAnxuo5bM) when signing up. By doing so, you'll save 10% on all fees for the first month, and it will help support further development of this code.


Links

Github Repo (https://github.com/HFenter/MarginBot)

Latest Download (From GitHub) (https://github.com/HFenter/MarginBot/archive/master.zip)

Reddit Discussion (http://www.reddit.com/r/bitfinex/comments/2mt0nv/marginbot_a_bitfinex_margin_lending_management_bot/)


Screenshots

http://therovegroup.com/MBot/MarginBot-Crypto3.JPG

http://therovegroup.com/MBot/MarginBot-Crypto4.JPG

http://fuckedgox.com/MBot/mbot_acctsettings.jpg

http://fuckedgox.com/MBot/mbot_newacct.jpg

http://therovegroup.com/MBot/MarginBot-Crypto5.JPG

http://therovegroup.com/MBot/MarginBot-Crypto1.JPG

http://therovegroup.com/MBot/MarginBot-Crypto2.JPG

Donate

Developing this software, and testing the various strategies for lending that led to its development have taken significant time and effort. If you find this software useful, please send a donation our way. All donations support the continued development of this software, and help to cover my distribution and support costs.

Bitcoin: 1A3y1xDXtyZySmPZySbpz7PPog4Vsyqig1 (bitcoin:1A3y1xDXtyZySmPZySbpz7PPog4Vsyqig1)

Ethereum: 0xf159d969e065b20083b50c930b71d29364ae5247 (http://ethereum:0xf159d969e065b20083b50c930b71d29364ae524)



Edit: Updated All of the images to represent v1.08


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: Sukrim on November 20, 2014, 11:47:38 PM
Looks nice, do you have comparison data vs. the "standard": Lending 30 days at FRR?


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF on November 21, 2014, 12:46:19 AM
Looks nice, do you have comparison data vs. the "standard": Lending 30 days at FRR?

Unfortunately, I don't.  I've never run any of the accounts I manage at FRR beyond the first few weeks I used bitfinex, because I didn't like how often my money stayed unlent.  Thats a big part of the goal of this bot, it keeps my money lent almost all the time, with no downtime.  Even with dozens of loans closing daily, very little money goes a full hour unlent, and during high volatility, I've had significant portions of my money lent out several times in a single hour.

If anyone has been running their account on FRR auto renew and wants to share some of their return data, I'll be happy to correlate it to my returns.  I have good data using basically this bot for about 5 months, and data using an earlier, simpler version of this bot back to January, so any period from then on should work to at least give us a rough idea.   I can convert the data to just a % return / day so you don't have to share actual balances if you don't want.

I also have a bitfinex account right now that I can put maybe $2000 into and post the daily results here if that would interest anybody.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF on November 21, 2014, 12:51:55 AM
I should also point out that chart above is an actual account running the bot, with real returns AFTER FEES, so you can get an estimate of returns from there....  It is an account that occasionally gets used for trading and paying bills though, so its not a 100% pristine investment return.



Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: Sukrim on November 21, 2014, 12:55:49 AM
%/day would be great, I'll look into parsing the csv files...

Edit: Done. I'm not sure if I did more manual work a few months back, but recently I mostly tried (when I thought FRR might go down further) to have whatever is available in some fixed rates if I got around to set some (every 2 days or so), the rest ran on "autopilot". Here's the swap payment data for November, depending on how you view "days", it could be one day off.

Code:
0,06140%	01.11.2014
0,06727% 02.11.2014
0,06598% 03.11.2014
0,06663% 04.11.2014
0,06504% 05.11.2014
0,06206% 06.11.2014
0,05659% 07.11.2014
0,05555% 08.11.2014
0,05490% 09.11.2014
0,05887% 10.11.2014
0,06133% 11.11.2014
0,05927% 12.11.2014
0,05223% 13.11.2014
0,07998% 14.11.2014
0,06349% 15.11.2014
0,04800% 16.11.2014
0,04660% 17.11.2014
0,06829% 18.11.2014
0,06706% 19.11.2014
0,06721% 20.11.2014
0,06621% 21.11.2014


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF on November 21, 2014, 12:59:49 AM
%/day would be great, I'll look into parsing the csv files...

Ok, just want to make sure we're parsing the same info here, so %/day after fees right?


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: Sukrim on November 21, 2014, 01:15:54 AM
Exactly.

Get history_USD, filter by Description "Swap Payment on wallet deposit", divide Balance by Amount and multiply by 100, then add another column for the date (I just used the date the interest was paid). Since the percentages were relatively small, I used 5 digits after the comma for no real reason.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF on November 21, 2014, 01:50:01 AM
Code:
11/1/2014		0.070107%
11/2/2014 0.071485%
11/3/2014 0.070634%
11/4/2014 0.069861%
11/5/2014 0.066710%
11/6/2014 0.065107%
11/7/2014 0.065237%
11/8/2014 0.061520%
11/9/2014 0.059754%
11/10/2014 0.058940%
11/11/2014 0.058172%
11/12/2014 0.057646%
11/13/2014 0.076388%
11/14/2014 0.089101%
11/15/2014 0.075083%
11/16/2014 0.068916%
11/17/2014 0.072677%
11/18/2014 0.071281%
11/19/2014 0.070086%
11/20/2014 0.069047%



Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF on November 21, 2014, 01:56:00 AM
Get history_USD, filter by Description "Swap Payment on wallet deposit", divide Balance by Amount and multiply by 100, then add another column for the date (I just used the date the interest was paid). Since the percentages were relatively small, I used 5 digits after the comma for no real reason.

I should also mention, the bot does this automatically every day to calculate returns (exactly this formula), so figuring out your actual returns with this bot running is a breeze.  It automatically updates a database table that looks like this:

Code:
id		userid	tid		date		balance		return	return_percent
343 1 1389744985 1/14/2014 21969.48 135.58 0.617142


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: DoubleSwapper on November 21, 2014, 02:02:54 AM
Very interesting project!

Can you elaborate a bit on what algorithm the bot uses to determine the lending rate at which it will put the offer? Will it always try to lend as much as possible or can you set limits like "lend out 1k per hour"?


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF on November 21, 2014, 02:19:49 AM
Very interesting project!

Can you elaborate a bit on what algorithm the bot uses to determine the lending rate at which it will put the offer? Will it always try to lend as much as possible or can you set limits like "lend out 1k per hour"?

I'm actually in bed using a tablet right now, so I can get you a much more detailed reply tomorrow if this doesn't clear it up, but here is a copy/paste of basically the same question answered over on reddit:
(also, there is no setting to limit the amount it lends per hour.  It tries to keep everything lent all the time.  My philosophy, and the last year of experience, has taught me that hours of interest lost waiting for a slightly higher rate will end up losing far more than you'll ever make up on the slightly higher rates.  Also, as this bot splits available money among several loans, after a while, you end up having a lot of small loans out, which means there is almost always a loan closing, so there's almost always at least a little available to lend when rates do spike.  If you really want to keep some available for spikes, there is a High Hold setting that lets you basically set aside $x to lend at a minimum of y% / day )


From Reddit: http://www.reddit.com/r/bitfinex/comments/2mt0nv/marginbot_a_bitfinex_margin_lending_management_bot/ (http://www.reddit.com/r/bitfinex/comments/2mt0nv/marginbot_a_bitfinex_margin_lending_management_bot/)
Quote
basically, if you look at the settings image:

http://fuckedgox.com/MBot/mbot_acctsettings.jpg

theres a couple of settings of interest:
  • Gap Top
  • Gap Bottom
  • Spread Lends
basically it splits your current available money into (Spread Lends) loans, then it loads the full lendbook from bitfinex. It skips through the lendbook until it hits (Gap Bottom) $USD in total value, and offers the first loan at this rate -.0001%/day.
If your Spread Lends is higher than 1, it will then try to evenly spread the rest of your money between the Gap Bottom setting and the Gap Top setting. For Example:
Gap Bottom = $25,000
Gap Top = $100,000
Spread Lends = 3
so, it will look through the lendbook, find the rate where where the total offers = $25,000 for lend 1
then it'll find the rate where total offers = $62,500 (midway between $25,000 and $100,000) for lend offer 2
then it'll find the rate where total offers = $100,000 for lend offer 3
However, it will never lend lower than your Minimum Lend Rate setting. Also, it will make all offers for 2 days, unless the rate is above your "Minimum for 30 Day" setting, then it'll make the offer for 30 days. This is so it can catch flash runs and try to keep high rate loans out for as long as possible.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: DoubleSwapper on November 21, 2014, 02:26:09 AM
Very interesting project!

Can you elaborate a bit on what algorithm the bot uses to determine the lending rate at which it will put the offer? Will it always try to lend as much as possible or can you set limits like "lend out 1k per hour"?

I'm actually in bed using a tablet right now, so I can get you a much more detailed reply tomorrow if this doesn't clear it up, but here is a copy/paste of basically the same question answered over on reddit:
(also, there is no setting to limit the amount it lends per hour.  It tries to keep everything lent all the time.  My philosophy, and the last year of experience, has taught me that hours of interest lost waiting for a slightly higher rate will end up losing far more than you'll ever make up on the slightly higher rates.  Also, as this bot splits available money among several loans, after a while, you end up having a lot of small loans out, which means there is almost always a loan closing, so there's almost always at least a little available to lend when rates do spike.  If you really want to keep some available for spikes, there is a High Hold setting that lets you basically set aside $x to lend at a minimum of y% / day )


From Reddit: http://www.reddit.com/r/bitfinex/comments/2mt0nv/marginbot_a_bitfinex_margin_lending_management_bot/ (http://www.reddit.com/r/bitfinex/comments/2mt0nv/marginbot_a_bitfinex_margin_lending_management_bot/)
Quote
basically, if you look at the settings image:

theres a couple of settings of interest:
  • Gap Top
  • Gap Bottom
  • Spread Lends
basically it splits your current available money into (Spread Lends) loans, then it loads the full lendbook from bitfinex. It skips through the lendbook until it hits (Gap Bottom) $USD in total value, and offers the first loan at this rate -.0001%/day.
If your Spread Lends is higher than 1, it will then try to evenly spread the rest of your money between the Gap Bottom setting and the Gap Top setting. For Example:
Gap Bottom = $25,000
Gap Top = $100,000
Spread Lends = 3
so, it will look through the lendbook, find the rate where where the total offers = $25,000 for lend 1
then it'll find the rate where total offers = $62,500 (midway between $25,000 and $100,000) for lend offer 2
then it'll find the rate where total offers = $100,000 for lend offer 3
However, it will never lend lower than your Minimum Lend Rate setting. Also, it will make all offers for 2 days, unless the rate is above your "Minimum for 30 Day" setting, then it'll make the offer for 30 days. This is so it can catch flash runs and try to keep high rate loans out for as long as possible.
Absolutely amazing job! I wish BFX would have implemented a system like this natively. That would clear up a lot of the stupid discussions about the FRR! I'll make sure to take a closer look at this project tomorrow!


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF on November 21, 2014, 04:10:36 PM
So, I just realized, if anyone was trying to email the "bug report" address found in the code of this bot, it wasn't forwarding correctly to me.  It's fixed now, but any emails sent before this morning probably didn't make it to me.  Sorry about that.    :-\


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: noggin-scratcher on November 21, 2014, 05:50:14 PM
Well consider me taken by surprise... I wasn't expecting it but, if I have the alignment of days right, your bot is outperforming my manual swap-managing. Not 100% of the time and not by very much, but for a majority of the days listed.

That said, it looks like I make up most of the difference by reacting better for those 2 days when the rates spiked - looking at the overall percentage increase across the full period, it's... well that's very slightly in the bot's favour too, but I think it's close enough to call it a wash, and suggests that if rates ever spiked for longer I might pull ahead.

Still, further evidence for the proposition that idle funds is the main thing to avoid.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF on November 21, 2014, 06:31:55 PM
Well consider me taken by surprise... I wasn't expecting it but, if I have the alignment of days right, your bot is outperforming my manual swap-managing. Not 100% of the time and not by very much, but for a majority of the days listed.

That said, it looks like I make up most of the difference by reacting better for those 2 days when the rates spiked - looking at the overall percentage increase across the full period, it's... well that's very slightly in the bot's favour too, but I think it's close enough to call it a wash, and suggests that if rates ever spiked for longer I might pull ahead.

Still, further evidence for the proposition that idle funds is the main thing to avoid.

Actually, if you apply the differences to any significant amount of money, its not a small difference....

Lets say a $50,000 balance (and this doesn't include daily compounding):

Code:
Date		MarginBot Returns	 MarginBot $50,000 Return 	FRR Returns	 FRR $50,000 Return 
10/31/2014 0.0727% $36.33 0.061% $30.70
11/1/2014 0.0701% $35.06 0.067% $33.64
11/2/2014 0.0715% $35.75 0.066% $32.99
11/3/2014 0.0706% $35.32 0.067% $33.32
11/4/2014 0.0699% $34.93 0.065% $32.52
11/5/2014 0.0667% $33.36 0.062% $31.03
11/6/2014 0.0651% $32.56 0.057% $28.30
11/7/2014 0.0652% $32.62 0.056% $27.78
11/8/2014 0.0615% $30.76 0.055% $27.45
11/9/2014 0.0598% $29.88 0.059% $29.44
11/10/2014 0.0589% $29.47 0.061% $30.67
11/11/2014 0.0582% $29.09 0.059% $29.64
11/12/2014 0.0577% $28.83 0.052% $26.12
11/13/2014 0.0764% $38.20 0.080% $39.99
11/14/2014 0.0891% $44.55 0.063% $31.75
11/15/2014 0.0751% $37.54 0.048% $24.00
11/16/2014 0.0689% $34.46 0.047% $23.30
11/17/2014 0.0727% $36.34 0.068% $34.15
11/18/2014 0.0713% $35.64 0.067% $33.53
11/19/2014 0.0701% $35.05 0.067% $33.61
11/20/2014 0.0691% $34.53 0.066% $33.11

$720.22 $646.98

Total Difference 11.320% $73.23


and i'm pretty sure this would hold up over any rate spikes, since my returns always spike by quite a bit along with the rates...  like i said, theres almost always some money coming off loan to take advantage of any spikes, and since loans update every 10 minutes, it catches even tiny flash spikes...

The above is adjusted so our days match up by the way
Edit: and I rounded all my returns to 5 decimals to keep it fair
Edit 2: argh, formatting tables here is a pain, heres the csv i used to make this, if anyone is interested:
http://fuckedgox.com/MBot/MarginBotCompare.csv (http://fuckedgox.com/MBot/MarginBotCompare.csv)




Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: noggin-scratcher on November 21, 2014, 06:34:56 PM
Comparing bot to FRR, sure, small differences add up. But I'm not FRR-ing it up, which puts me pretty much in line with the bot... give me a minute and I'll round up some actual numbers.




Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF on November 21, 2014, 06:45:17 PM
Oh, sorry, for some reason I got out of order there a bit and was thinking Sukrim's numbers were yours. : :)  Yeah, I'd love to see your numbers as well, out of curiosity...

I have to imagine if you micromanage your lends you can probably outperform just about any bot out there, but I only have so much time, and can't devote a ton of time to lending just to make a few pennies a day more, so for my needs the bot works pretty well.  I would love to see how it stacks up to a closely managed account though.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: noggin-scratcher on November 21, 2014, 07:18:45 PM
I think I have these in the right order and on the right days. Somehow doesn't look quite the same as when I was comparing it earlier but anyway...

Code:
Date		MarginBot Returns	 noggin-scratcher Return
10/31/2014 0.0727% 0.0677%
11/1/2014 0.0701% 0.0630%
11/2/2014 0.0715% 0.0672%
11/3/2014 0.0706% 0.0665%
11/4/2014 0.0699% 0.0662%
11/5/2014 0.0667% 0.0640%
11/6/2014 0.0651% 0.0639%
11/7/2014 0.0652% 0.0605%
11/8/2014 0.0615% 0.0595%
11/9/2014 0.0598% 0.0568%
11/10/2014 0.0589% 0.0597%
11/11/2014 0.0582% 0.0590%
11/12/2014 0.0577% 0.0590%
11/13/2014 0.0764% 0.0996%
11/14/2014 0.0891% 0.0983%
11/15/2014 0.0751% 0.0634%
11/16/2014 0.0689% 0.0674%
11/17/2014 0.0727% 0.0690%
11/18/2014 0.0713% 0.0708%
11/19/2014 0.0701% 0.0719%
11/20/2014 0.0691% 0.0725%

Ah, have located the difference between now and earlier; was previously using the 5 d.p. numbers quoted higher up the thread, which appear to have mostly rounded up slightly when cut down to 3 d.p. -- using the more detailed figures for MarginBot, and my actual start/end balance, I make the overall percentages +1.45037% for the bot and +1.43566% for my efforts. Which if I've done the right calculations would be 28.438% and 28.115% if extended over the course of a full year.

End conclusion: I'm spending a lot of time on not quite keeping up with a surprisingly simple algorithm. I should probably get a bot.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF on November 21, 2014, 07:46:12 PM
Cool, for my own amusement, i'm going to add all these numbers into an excel file if you don't mind.  Looks like on an average day the bot out performs you by a tiny amount like you said, but you occasionally seem to have a much better day, which probably makes it pretty close to a wash, but i'd like to see the exact difference in a spreadsheet.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: noggin-scratcher on November 21, 2014, 07:54:04 PM
Cool, for my own amusement, i'm going to add all these numbers into an excel file if you don't mind.  Looks like on an average day the bot out performs you by a tiny amount like you said, but you occasionally seem to have a much better day, which probably makes it pretty close to a wash, but i'd like to see the exact difference in a spreadsheet.

No objection to the spreadsheet thing. If you want more numbers I have almost a year of 'em.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF on November 21, 2014, 08:13:47 PM
Cool, for my own amusement, i'm going to add all these numbers into an excel file if you don't mind.  Looks like on an average day the bot out performs you by a tiny amount like you said, but you occasionally seem to have a much better day, which probably makes it pretty close to a wash, but i'd like to see the exact difference in a spreadsheet.

No objection to the spreadsheet thing. If you want more numbers I have almost a year of 'em.

Actually, I made it a google sheet, so anyone can play with it or throw their own numbers into it:

https://docs.google.com/spreadsheets/d/1NRZdcKrZTq0KLnIKs6tI0qAuNTXckldL1CMtDf72oek/edit?usp=sharing



Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: noggin-scratcher on November 21, 2014, 08:56:19 PM
You're not going to see this until it's too late, but for reference... just watched you go down a list hand-editing a whole series of formulae from "=adjacent cell * 50000" to "=adjacent cell * H3"

Easier method: enter "=adjacent cell * $H$3" into one cell, then copy/paste or click and drag the little black square handle in the corner to duplicate. The dollar signs make it an absolute cell reference that won't change when you copy it, whereas the 'adjacent cell' reference is still relative and will change.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF on November 21, 2014, 08:58:21 PM
You're not going to see this until it's too late, but for reference... just watched you go down a list hand-editing a whole series of formulae from "=adjacent cell * 50000" to "=adjacent cell * H3"

Easier method: enter "=adjacent cell * $H$3" into one cell, then copy/paste or click and drag the little black square handle in the corner to duplicate. The dollar signs make it an absolute cell reference that won't change when you copy it, whereas the 'adjacent cell' reference is still relative and will change.

heh, you're right, it was too late...  i knew there was a way to do it, but couldn't remember how.  I hate excel....


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF on November 21, 2014, 09:47:09 PM
End conclusion: I'm spending a lot of time on not quite keeping up with a surprisingly simple algorithm. I should probably get a bot.

If it makes you feel any better, for a while I was spending 8+ hours a day trying to figure out how best to keep my Margin lending maxed.  I came up with some insanely complex algorithms, but after testing, it turned out none of them could outperform this pretty simple bot.  It really comes down to keep it lent always.  Every hour lost is way more than a few .0001% higher rate can make up.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: noggin-scratcher on November 21, 2014, 09:59:37 PM
I may perhaps be a bit of a spreadsheet nerd. The one I have set up to track my swaps, I enter the details of each one (amount, rate, start/end times) and record the daily payments, and from there it will...

  • calculate the duration and expected return of each swap
  • calculate the expected return each day
  • track the 'total error' (accumulated difference between expectation and reality) - needed to do this to compensate for accumulated error in the predictions, but it provides a check that I'm getting as much as I expect to in the long-term even if day to day it varies a little
  • calculate how much I have lent out, and checks that isn't more than my balance (which would suggest that I've forgotten to tell it that a swap has ended
  • calculate the average rate of open swaps... two averages actually; the average pre-fee rate of active swaps, and the implied post-fee rate as a percentage of my balance
  • record the USD/GBP conversion rate each day so I can separate gains due to swaps from gains due to currency fluctuations
  • keep track of all manner of running totals and averages on a summary page
  • project that average forward until the end of the year
  • reverse that calculation - "To hit some specified target point by the end of the year, the average rate needs to be X"

and my personal favourite new thing that it does: I've started telling it the initial maximum duration of each swap, so now it can summarise the total amount I'm expecting repaid on each day, so I know what durations to offer to keep that relatively even across the week ahead (without having to bust out a calculator, and without worrying about having missed a large swap in amongst the shrapnel of $0.002 swaps that 'finex seems to like to create lately). Also the number of individual swaps due to be repaid and their average rate, just because. I mean, that was practically the same formula.

It started out fairly simple, then just kind of... grew.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: Sukrim on November 22, 2014, 11:28:45 AM
Just to make sure: My returns are mostly but not purely FRR 30 day autolend - about 10-15% are fixed rate.

I decided to publish a bit more data (again: mostly, but NOT purely FRR!) to be able to average out a bit more. Would it be possible to use a bit more lightwheight backend for your bot? I don't want to have to configure and run a whole mySQL database just for a handful of values...

Anyways, here are my returns in % for interest (calculated as before: interest received / balance AFTER receiving interest) since June (as you said, you have ~5 months of data) - USD only (It would be interesting to see this bot on BTC btw.):

[Again: From time to time there can be quite heavy manual intervention in there, this is NOT 100% representative of 30 day FRR autolend, but I would call it relatively low maintenance mode - checking rates maybe once every few days to decide if I continue autolending]

Code:
0,16253%	01.06.2014
0,16241% 02.06.2014
0,20568% 03.06.2014
0,34525% 04.06.2014
0,27556% 05.06.2014
0,17703% 06.06.2014
0,15182% 07.06.2014
0,15150% 08.06.2014
0,14268% 09.06.2014
0,13070% 10.06.2014
0,12775% 11.06.2014
0,14125% 12.06.2014
0,18729% 13.06.2014
0,22851% 14.06.2014
0,23010% 15.06.2014
0,21886% 16.06.2014
0,19884% 17.06.2014
0,18296% 18.06.2014
0,17672% 19.06.2014
0,16868% 20.06.2014
0,10190% 21.06.2014
0,15184% 22.06.2014
0,16362% 23.06.2014
0,14050% 24.06.2014
0,14804% 25.06.2014
0,10659% 26.06.2014
0,13180% 27.06.2014
0,17049% 28.06.2014
0,13822% 29.06.2014
0,14926% 30.06.2014
0,14680% 01.07.2014
0,14086% 02.07.2014
0,13296% 03.07.2014
0,13731% 04.07.2014
0,13662% 05.07.2014
0,10275% 06.07.2014
0,15265% 07.07.2014
0,15260% 08.07.2014
0,15233% 09.07.2014
0,11333% 10.07.2014
0,14309% 11.07.2014
0,13786% 12.07.2014
0,13777% 13.07.2014
0,14285% 14.07.2014
0,14393% 15.07.2014
0,14349% 16.07.2014
0,14329% 17.07.2014
0,14320% 18.07.2014
0,14322% 19.07.2014
0,14295% 20.07.2014
0,14290% 21.07.2014
0,14244% 22.07.2014
0,14156% 23.07.2014
0,13898% 24.07.2014
0,14011% 25.07.2014
0,13774% 26.07.2014
0,13601% 27.07.2014
0,13527% 28.07.2014
0,13410% 29.07.2014
0,13243% 30.07.2014
0,13183% 31.07.2014
0,12571% 01.08.2014
0,11115% 02.08.2014
0,06339% 03.08.2014
0,06297% 04.08.2014
0,06334% 05.08.2014
0,09062% 06.08.2014
0,09752% 07.08.2014
0,09553% 08.08.2014
0,08966% 09.08.2014
0,03936% 10.08.2014
0,03936% 11.08.2014
0,04148% 12.08.2014
0,03923% 13.08.2014
0,07416% 14.08.2014
0,07478% 15.08.2014
0,07962% 16.08.2014
0,07510% 17.08.2014
0,01814% 18.08.2014
0,00151% 19.08.2014
0,00117% 20.08.2014
0,00117% 21.08.2014
0,00117% 22.08.2014
0,00117% 23.08.2014
0,00983% 24.08.2014
0,01565% 25.08.2014
0,01548% 26.08.2014
0,01709% 27.08.2014
0,02310% 28.08.2014
0,03960% 29.08.2014
0,03863% 30.08.2014
0,03471% 31.08.2014
0,02335% 01.09.2014
0,01625% 02.09.2014
0,01639% 03.09.2014
0,02753% 04.09.2014
0,03761% 05.09.2014
0,03739% 06.09.2014
0,03714% 07.09.2014
0,03703% 08.09.2014
0,03689% 09.09.2014
0,03683% 10.09.2014
0,03588% 11.09.2014
0,03427% 12.09.2014
0,03579% 13.09.2014
0,03682% 14.09.2014
0,03621% 15.09.2014
0,03444% 16.09.2014
0,03449% 17.09.2014
0,03494% 18.09.2014
0,04196% 19.09.2014
0,05311% 20.09.2014
0,04865% 21.09.2014
0,06061% 22.09.2014
0,02475% 23.09.2014
0,03946% 24.09.2014
0,04229% 25.09.2014
0,04176% 26.09.2014
0,04058% 27.09.2014
0,04116% 28.09.2014
0,04105% 29.09.2014
0,04091% 30.09.2014
0,04088% 01.10.2014
0,04090% 02.10.2014
0,04096% 03.10.2014
0,03461% 04.10.2014
0,03365% 05.10.2014
0,03985% 06.10.2014
0,03910% 07.10.2014
0,04127% 08.10.2014
0,04306% 09.10.2014
0,06093% 10.10.2014
0,08203% 11.10.2014
0,08648% 12.10.2014
0,08804% 13.10.2014
0,08064% 14.10.2014
0,07468% 15.10.2014
0,07122% 16.10.2014
0,06920% 17.10.2014
0,07852% 18.10.2014
0,08137% 19.10.2014
0,08611% 20.10.2014
0,08204% 21.10.2014
0,07797% 22.10.2014
0,07580% 23.10.2014
0,06454% 24.10.2014
0,06401% 25.10.2014
0,05821% 26.10.2014
0,06924% 27.10.2014
0,06922% 28.10.2014
0,06904% 29.10.2014
0,06877% 30.10.2014
0,06373% 31.10.2014
0,06140% 01.11.2014
0,06727% 02.11.2014
0,06598% 03.11.2014
0,06663% 04.11.2014
0,06504% 05.11.2014
0,06206% 06.11.2014
0,05659% 07.11.2014
0,05555% 08.11.2014
0,05490% 09.11.2014
0,05887% 10.11.2014
0,06133% 11.11.2014
0,05927% 12.11.2014
0,05223% 13.11.2014
0,07998% 14.11.2014
0,06349% 15.11.2014
0,04800% 16.11.2014
0,04660% 17.11.2014
0,06829% 18.11.2014
0,06706% 19.11.2014
0,06721% 20.11.2014
0,06621% 21.11.2014
0,04586% 22.11.2014

Would be cool to get this kind of data by other bot authors by the way... it is really easy to produce, doesn't leak any info (do you lend 1000 USD or 100k? Percentages don't really care unless you run it with very low amounts that can't be put on the books).


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF on November 22, 2014, 05:29:47 PM
I'll post more data later, I'm out of the house right now, but as I said, my data isn't pure beyond about Oct 1st, because I was using the account to do some day trading, and during really terrible FRR walls I pulled a ton of money out and put it into other investments.  The data is probably reasonably accurate, but wouldn't represent 100% pure bot returns, so I'm not sure how fair a comparison it would be ( most days it would probably be much lower than my real returns, since I likely pulled some money out, did something else with it so it wasn't earning interest from loans, then put it back in before the end of the day, thus i'm dividing swap_return by a dep_balance that's much higher than what was actually earning from swaps) .


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF on November 22, 2014, 05:32:46 PM
Would it be possible to use a bit more lightwheight backend for your bot? I don't want to have to configure and run a whole mySQL database just for a handful of values...

I could probably make it use a noSQL solution, like MongoDB, but to be perfectly honest, 99.9% of people who run PHP on a server are going to have mySQL installed and ready to go.  If this is a feature lots of people want, I guess I could make the DB type an extension though....


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF on November 22, 2014, 06:50:23 PM
Update v0.1.02 just posted

Just a few minor bug fixes, changed the default minimum lend rate, and moved some stuff out of the config.php file to make future updates easier for people who already have the app installed.  In the future upgrading to a new version should just require backing up your config.php file then overwriting everything else, but this version takes a little more work because I didn't correctly plan the config file out.... oops.

If you need any help updating, just let me know and I assist how I can.

Update Instructions
Important - Make sure to backup your existing inc/config.php file FIRST

To update, make a backup of your inc/config.php file, then download the most current version. Unzip the files and overwrite your existing install.

In your inc/config.php file, update the following lines, copying over from your previous backup:

Code:
$config['db']['host'] = '';
$config['db']['dbname'] = '';
$config['db']['dbuser'] = '';
$config['db']['dbpass'] = '';

$config['db']['prefix'] = '';

$config['admin_email'] = 'support@fuckedgox.com';


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF on November 22, 2014, 07:46:56 PM
Just to make sure: My returns are mostly but not purely FRR 30 day autolend - about 10-15% are fixed rate.

I decided to publish a bit more data (again: mostly, but NOT purely FRR!) to be able to average out a bit more. Would it be possible to use a bit more lightwheight backend for your bot? I don't want to have to configure and run a whole mySQL database just for a handful of values...

Would be cool to get this kind of data by other bot authors by the way... it is really easy to produce, doesn't leak any info (do you lend 1000 USD or 100k? Percentages don't really care unless you run it with very low amounts that can't be put on the books).

I just updated the shared spreadsheet at:

https://docs.google.com/spreadsheets/d/1QYSVhW_PM8V7kk64ar5KPauB504H3hswGZPopbHmc3w/edit?usp=sharing
with a new tab that has full data for as far back as I have it.  However, this account was used for lots of other stuff in the past, so i marked the data up a bit to represent how reliable it is.  Anything in red I'd be wary of, I was doing a lot of other things back then.  Yellow means it probably is pretty accurate, but a few days may be a bit off, no color is probably pretty reliable (95% of days being completely accurate, the rest close enough to not matter much), and the green days are 100% representative of this bot's returns.

If other people want to share data in this same format, it will make comparison much easier going forwards...

(looking back at this chart, man I miss last January....  those were the days...)


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: noggin-scratcher on November 22, 2014, 09:06:54 PM
Can I suggest reversing the direction of your data? (newest at the top) -- that way if you have contributions from different people that go back in time by different amounts, they can be aligned to the same dates without leaving lots of empty space at the top of the sheet.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF on November 22, 2014, 09:28:00 PM
done.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: noggin-scratcher on November 22, 2014, 10:16:55 PM
To add to the analysis: just short of a year's worth of returns, all under more or less the same method... occasional periods where I took a little out to consider trading with it, but no trading returns included in the figures as quoted.

Also occasional periods where I was either away from home and only able to check on 'finex intermittently, or just got dispirited with suddenly crappy returns and effectively quit for a few days (e.g. the last couple of days of 2013, where it went abruptly from ~1%/day to jack-all)

Code:
21/11/14	0.06998%
20/11/14 0.07252%
19/11/14 0.07194%
18/11/14 0.07078%
17/11/14 0.06897%
16/11/14 0.06744%
15/11/14 0.06344%
14/11/14 0.09826%
13/11/14 0.09960%
12/11/14 0.05897%
11/11/14 0.05898%
10/11/14 0.05967%
09/11/14 0.05684%
08/11/14 0.05952%
07/11/14 0.06055%
06/11/14 0.06390%
05/11/14 0.06399%
04/11/14 0.06619%
03/11/14 0.06649%
02/11/14 0.06717%
01/11/14 0.06302%
31/10/14 0.06774%
30/10/14 0.07083%
29/10/14 0.07163%
28/10/14 0.07423%
27/10/14 0.07531%
26/10/14 0.07576%
25/10/14 0.07729%
24/10/14 0.07737%
23/10/14 0.07833%
22/10/14 0.08016%
21/10/14 0.08106%
20/10/14 0.07925%
19/10/14 0.08478%
18/10/14 0.08416%
17/10/14 0.08524%
16/10/14 0.08367%
15/10/14 0.08706%
14/10/14 0.08468%
13/10/14 0.08556%
12/10/14 0.08660%
11/10/14 0.07594%
10/10/14 0.06726%
09/10/14 0.05624%
08/10/14 0.04312%
07/10/14 0.04430%
06/10/14 0.04285%
05/10/14 0.04317%
04/10/14 0.04447%
03/10/14 0.04194%
02/10/14 0.04493%
01/10/14 0.04530%
30/09/14 0.04536%
29/09/14 0.04460%
28/09/14 0.04633%
27/09/14 0.04520%
26/09/14 0.04384%
25/09/14 0.04554%
24/09/14 0.04107%
23/09/14 0.05393%
22/09/14 0.04279%
21/09/14 0.08309%
20/09/14 0.06421%
19/09/14 0.06776%
18/09/14 0.03990%
17/09/14 0.03349%
16/09/14 0.03184%
15/09/14 0.03364%
14/09/14 0.03264%
13/09/14 0.03304%
12/09/14 0.03340%
11/09/14 0.03205%
10/09/14 0.03291%
09/09/14 0.03199%
08/09/14 0.03234%
07/09/14 0.03006%
06/09/14 0.03264%
05/09/14 0.03345%
04/09/14 0.03346%
03/09/14 0.03528%
02/09/14 0.03248%
01/09/14 0.03558%
31/08/14 0.03616%
30/08/14 0.03458%
29/08/14 0.03782%
28/08/14 0.03945%
27/08/14 0.03247%
26/08/14 0.04075%
25/08/14 0.03948%
24/08/14 0.03611%
23/08/14 0.04338%
22/08/14 0.04400%
21/08/14 0.04323%
20/08/14 0.04343%
19/08/14 0.04678%
18/08/14 0.05062%
17/08/14 0.06473%
16/08/14 0.07323%
15/08/14 0.07783%
14/08/14 0.07910%
13/08/14 0.08269%
12/08/14 0.08787%
11/08/14 0.08561%
10/08/14 0.08548%
09/08/14 0.09569%
08/08/14 0.09731%
07/08/14 0.09824%
06/08/14 0.09916%
05/08/14 0.10236%
04/08/14 0.10528%
03/08/14 0.11195%
02/08/14 0.11406%
01/08/14 0.12414%
31/07/14 0.13097%
30/07/14 0.13009%
29/07/14 0.13547%
28/07/14 0.13405%
27/07/14 0.13322%
26/07/14 0.13447%
25/07/14 0.13818%
24/07/14 0.13814%
23/07/14 0.14163%
22/07/14 0.14015%
21/07/14 0.14210%
20/07/14 0.14063%
19/07/14 0.13592%
18/07/14 0.14293%
17/07/14 0.14339%
16/07/14 0.14342%
15/07/14 0.14070%
14/07/14 0.14332%
13/07/14 0.13771%
12/07/14 0.14088%
11/07/14 0.14273%
10/07/14 0.15336%
09/07/14 0.15019%
08/07/14 0.15232%
07/07/14 0.15149%
06/07/14 0.14606%
05/07/14 0.15349%
04/07/14 0.15052%
03/07/14 0.15231%
02/07/14 0.15228%
01/07/14 0.14606%
30/06/14 0.15983%
29/06/14 0.16436%
28/06/14 0.16689%
27/06/14 0.17158%
26/06/14 0.14913%
25/06/14 0.13931%
24/06/14 0.16383%
23/06/14 0.19351%
22/06/14 0.18701%
21/06/14 0.18860%
20/06/14 0.18313%
19/06/14 0.20472%
18/06/14 0.21314%
17/06/14 0.19941%
16/06/14 0.28588%
15/06/14 0.42936%
14/06/14 0.39128%
13/06/14 0.37471%
12/06/14 0.18875%
11/06/14 0.16495%
10/06/14 0.15816%
09/06/14 0.13655%
08/06/14 0.13210%
07/06/14 0.12818%
06/06/14 0.17192%
05/06/14 0.24909%
04/06/14 0.30102%
03/06/14 0.34649%
02/06/14 0.30518%
01/06/14 0.20349%
31/05/14 0.16909%
30/05/14 0.14373%
29/05/14 0.15736%
28/05/14 0.16225%
27/05/14 0.14994%
26/05/14 0.12253%
25/05/14 0.17539%
24/05/14 0.09054%
23/05/14 0.09838%
22/05/14 0.08651%
21/05/14 0.08796%
20/05/14 0.06921%
19/05/14 0.06341%
18/05/14 0.06480%
17/05/14 0.06473%
16/05/14 0.05110%
15/05/14 0.04990%
14/05/14 0.05323%
13/05/14 0.06995%
12/05/14 0.07247%
11/05/14 0.07795%
10/05/14 0.09579%
09/05/14 0.09321%
08/05/14 0.07248%
07/05/14 0.05507%
06/05/14 0.05376%
05/05/14 0.06408%
04/05/14 0.07112%
03/05/14 0.08080%
02/05/14 0.10884%
01/05/14 0.10301%
30/04/14 0.09395%
29/04/14 0.09368%
28/04/14 0.10784%
27/04/14 0.10011%
26/04/14 0.07344%
25/04/14 0.04076%
24/04/14 0.03223%
23/04/14 0.03820%
22/04/14 0.03671%
21/04/14 0.03434%
20/04/14 0.05104%
19/04/14 0.04951%
18/04/14 0.03620%
17/04/14 0.04264%
16/04/14 0.03621%
15/04/14 0.06718%
14/04/14 0.05083%
13/04/14 0.00333%
12/04/14 0.00535%
11/04/14 0.01960%
10/04/14 0.06618%
09/04/14 0.09996%
08/04/14 0.14108%
07/04/14 0.16608%
06/04/14 0.16390%
05/04/14 0.15498%
04/04/14 0.15747%
03/04/14 0.13942%
02/04/14 0.12368%
01/04/14 0.12543%
31/03/14 0.13035%
30/03/14 0.10225%
29/03/14 0.10049%
28/03/14 0.09765%
27/03/14 0.09199%
26/03/14 0.08697%
25/03/14 0.10289%
24/03/14 0.10198%
23/03/14 0.09167%
22/03/14 0.10196%
21/03/14 0.09406%
20/03/14 0.08662%
19/03/14 0.08568%
18/03/14 0.06605%
17/03/14 0.10754%
16/03/14 0.08800%
15/03/14 0.11692%
14/03/14 0.13664%
13/03/14 0.14181%
12/03/14 0.13881%
11/03/14 0.13325%
10/03/14 0.12983%
09/03/14 0.11338%
08/03/14 0.12178%
07/03/14 0.13326%
06/03/14 0.13636%
05/03/14 0.09085%
04/03/14 0.07954%
03/03/14 0.07330%
02/03/14 0.06328%
01/03/14 0.09567%
28/02/14 0.10827%
27/02/14 0.13531%
26/02/14 0.13262%
25/02/14 0.13254%
24/02/14 0.10707%
23/02/14 0.09929%
22/02/14 0.09219%
21/02/14 0.07561%
20/02/14 0.09003%
19/02/14 0.08866%
18/02/14 0.08347%
17/02/14 0.08644%
16/02/14 0.09002%
15/02/14 0.08934%
14/02/14 0.09730%
13/02/14 0.14186%
12/02/14 0.14419%
11/02/14 0.13546%
10/02/14 0.16444%
09/02/14 0.21017%
08/02/14 0.22267%
07/02/14 0.22377%
06/02/14 0.23084%
05/02/14 0.23612%
04/02/14 0.22161%
03/02/14 0.22045%
02/02/14 0.21603%
01/02/14 0.19879%
31/01/14 0.21470%
30/01/14 0.24017%
29/01/14 0.23532%
28/01/14 0.23558%
27/01/14 0.25518%
26/01/14 0.19593%
25/01/14 0.22959%
24/01/14 0.24787%
23/01/14 0.28522%
22/01/14 0.29071%
21/01/14 0.31656%
20/01/14 0.31549%
19/01/14 0.32917%
18/01/14 0.35430%
17/01/14 0.32820%
16/01/14 0.35051%
15/01/14 0.43171%
14/01/14 0.56549%
13/01/14 0.36198%
12/01/14 0.35851%
11/01/14 0.27675%
10/01/14 0.37779%
09/01/14 0.50182%
08/01/14 0.59695%
07/01/14 0.49588%
06/01/14 0.32589%
05/01/14 0.15037%
04/01/14 0.07666%
03/01/14 0.07051%
02/01/14 0.09232%
01/01/14 0.00681%
31/12/13 0.01431%
30/12/13 0.02475%
29/12/13 0.02683%
28/12/13 0.02198%
27/12/13 0.09332%
26/12/13 0.67913%
25/12/13 0.89971%
24/12/13 0.90691%
23/12/13 0.90697%
22/12/13 0.90549%
21/12/13 0.81664%
20/12/13 0.87225%
19/12/13 0.45687%
18/12/13 0.21964%
17/12/13 0.17311%
16/12/13 0.22494%
15/12/13 0.20890%
14/12/13 0.20063%
13/12/13 0.31472%
12/12/13 0.53393%
11/12/13 0.63791%
10/12/13 0.59213%
09/12/13 0.73736%
08/12/13 0.73616%
07/12/13 0.62273%
06/12/13 0.37476%
05/12/13 0.75527%
04/12/13 0.76656%
03/12/13 0.76399%
02/12/13 0.77736%
01/12/13 0.68380%
30/11/13 0.34922%
29/11/13 0.41774%
28/11/13 0.39704%
27/11/13 0.09549%


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: Sukrim on November 23, 2014, 12:48:53 AM
Google docs has pretty time series graphs by the way, if you want to pimp your spreadsheet.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF on November 23, 2014, 03:04:03 PM
Google docs has pretty time series graphs by the way, if you want to pimp your spreadsheet.

I put the data out there, you guys can take over and do as you will with those spreadsheets.  I just wanted to get the information out, but my focus is on the bot, and I've already got a bunch of ideas and requests for the next version.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF on November 24, 2014, 01:19:01 PM
Update v0.1.03 just posted

Added cron monitoring, to make sure the crons are running as often as they should.  If the cron doesn't seem to have run recently, it will pop a warning on the dashboard to let you know that something isn't right.



Update Instructions
Important - Make sure to backup your existing inc/config.php file FIRST

From v0.01.02
To install just overwrite everything EXCEPT your inc/config.php file.  You should be good to go.

From v0.01.01
To update, make a backup of your inc/config.php file, then download the most current version. Unzip the files and overwrite your existing install.

In your inc/config.php file, update the following lines, copying over from your previous backup:

Code:
$config['db']['host'] = '';
$config['db']['dbname'] = '';
$config['db']['dbuser'] = '';
$config['db']['dbpass'] = '';

$config['db']['prefix'] = '';

$config['admin_email'] = 'support@fuckedgox.com';


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF on November 24, 2014, 09:28:42 PM
For anyone who may be interested, I decided to use the API to figure out what the returns would be if you were somehow able to keep 100% of your money out 100% of the time at the FRR.  I had to make a few assumptions, and it is averaged by the hour, so this isn't exactly accurate, but its close enough for any meaningful comparison I think.  ( On the columns that include the fee, please note I used 15% all the way back, so those columns aren't accurate to the real world before the fee change, but for my purposes using 15% works fine).

Find the document here:

https://docs.google.com/spreadsheets/d/1Fq0Ru1wXmxqUiaxkXtEfY1704rcCZrK9U49vibEglf4/edit?usp=sharing


Also, I'm wondering if we should start a new thread somewhere to keep and discuss all this data we've collected.  As much as I like data updates and discussions bumping my bot to the top of the forum list, it would probably make more sense to put all this data in its own place.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF on November 26, 2014, 05:34:10 PM
Just to let everyone know i'm working on a bug in the install process right now. It should be fixed in the next few minutes, and uploaded to github.  I'll update here when its live.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF on November 26, 2014, 06:12:07 PM
Well, thats a bit embarrassing...   ::) Forgot to test my installer before the last update and I'd introduced a show stopping bug.  Its now fixed, but anyone who downloaded yesterday and had an issue with the installer will need to download the latest version.  If your install went ok and the bot is running for you, regular update methods should be fine.


v0.1.04

* Added balance to the stats charts
* Changed chart coloring and layout styles
* Fixed a major bug in the install system introduced in 0.1.03


Update Instructions
Important - Make sure to backup your existing inc/config.php file FIRST

Updating from v0.1.03 or newer

Make a backup of your inc/config.php file, then download the most current version. Unzip the files and overwrite your existing install.  Copy your inc/config.php backup back to the live server.

Updating from v0.1.02 or older

To update, make a backup of your inc/config.php file, then download the most current version. Unzip the files and overwrite your existing install.

In your inc/config.php file, update the following lines, copying over from your previous backup:


Code:
$config['db']['host'] = '';
$config['db']['dbname'] = '';
$config['db']['dbuser'] = '';
$config['db']['dbpass'] = '';

$config['db']['prefix'] = '';

$config['admin_email'] = 'support@fuckedgox.com';


If you have any difficulty with the install up upgrade, please don't hesitate to let me know here or at marginbot@fuckedgox.com .


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: superbit on November 28, 2014, 02:24:43 AM
This is an awesome project, but I don't know much about the intricacies of coding, but how can a user be sure that there is nothing in the bot to send you an api key, do a withdraw to an unknown BTC account, or sabotage the account by trading lending funds to BTC at a terrible rate?

Thanks,


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF on November 28, 2014, 02:41:30 AM
This is an awesome project, but I don't know much about the intricacies of coding, but how can a user be sure that there is nothing in the bot to send you an api key, do a withdraw to an unknown BTC account, or sabotage the account by trading lending funds to BTC at a terrible rate?

Thanks,

The full source code is available at the Github repository, and has been reviewed by everyone in this thread I imagine.  I believe a few bitfinex employees themselves have also looked at the code and while they didn't endorse the bot in any way, they also didn't warn against its use, as I'm sure they would be inclined to do if they thought I was trying to steal from their customers.  Beyond that all I can say is your best bet would be to look through the code itself.   Even without a good understanding of PHP, it should be pretty easy to spot anything that would constitute me trying to send data back to any urls I control, and there isn't any in the code.  If you have any friends that are coders, you could also have them take a look I guess.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: Sukrim on November 28, 2014, 09:26:15 AM
This is an awesome project, but I don't know much about the intricacies of coding, but how can a user be sure that there is nothing in the bot to send you an api key, do a withdraw to an unknown BTC account, or sabotage the account by trading lending funds to BTC at a terrible rate?

Thanks,

The full source code is available at the Github repository, and has been reviewed by everyone in this thread I imagine.

Not by me at least so far, I might have to do it though, as the returns seem viable (I'd still love to see data points back to before November, back when swaps rates were more sideways). I am not much of a fan of PHP and setting up MySQL just to run something that checks a market every 10 minutes and sends a couple orders - also I don't need the UI and stuff like that, so I might just carve out the algorithm and put it into a smaller commandline only bot...

Not to spam more about data collection, I'l just edit my thanks in this post:
as the returns seem viable (I'd still love to see data points back to before November, back when swaps rates were more sideways).
I put up returns through January already... about 5 posts back  ;)

... thanks! :D


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF on November 28, 2014, 05:24:19 PM
as the returns seem viable (I'd still love to see data points back to before November, back when swaps rates were more sideways).


I put up returns through January already... about 5 posts back  ;)


I just updated the shared spreadsheet at:

https://docs.google.com/spreadsheets/d/1QYSVhW_PM8V7kk64ar5KPauB504H3hswGZPopbHmc3w/edit?usp=sharing
with a new tab that has full data for as far back as I have it.  However, this account was used for lots of other stuff in the past, so i marked the data up a bit to represent how reliable it is.  Anything in red I'd be wary of, I was doing a lot of other things back then.  Yellow means it probably is pretty accurate, but a few days may be a bit off, no color is probably pretty reliable (95% of days being completely accurate, the rest close enough to not matter much), and the green days are 100% representative of this bot's returns.

If other people want to share data in this same format, it will make comparison much easier going forwards...

(looking back at this chart, man I miss last January....  those were the days...)


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: noggin-scratcher on November 29, 2014, 11:48:20 PM
Just going to check you're aware; the shared spreadsheet only seems to have permissions granted for viewing, not for other users to add/edit. Not sure what your intentions were - can plausibly imagine that being how you want it (so that no-one can come along and mess with it maliciously), but equally I know I've intended to share something as group-editable before and instead not even managed to grant viewing permissions.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF on November 30, 2014, 04:43:04 PM
Just going to check you're aware; the shared spreadsheet only seems to have permissions granted for viewing, not for other users to add/edit. Not sure what your intentions were - can plausibly imagine that being how you want it (so that no-one can come along and mess with it maliciously), but equally I know I've intended to share something as group-editable before and instead not even managed to grant viewing permissions.

yeah, it was supposed to be editable, sorry about that.  Should be set right now.   I don't use google sheets much, thought i had it set right.

For anyone who wants to add their own returns, I would ask that you just create a new tab, so we can keep the existing info in place.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: jabetizo on December 02, 2014, 07:41:03 PM
I'm having trouble installing... Step 1 and 2 go through smoothly but after clicking "Complete Install", I just get a blank page.

I'm running Debian 7.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF on December 03, 2014, 03:51:55 PM
I'm having trouble installing... Step 1 and 2 go through smoothly but after clicking "Complete Install", I just get a blank page.

I'm running Debian 7.

Hmm... can you tell if it correctly made the database tables?  Do you have any errors in your apache http error log?


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: jabetizo on December 03, 2014, 04:50:13 PM
I'm having trouble installing... Step 1 and 2 go through smoothly but after clicking "Complete Install", I just get a blank page.

I'm running Debian 7.

Hmm... can you tell if it correctly made the database tables?  Do you have any errors in your apache http error log?

Code:
mysql> show tables from mbot;
+---------------------+
| Tables_in_mbot      |
+---------------------+
| BFXLendBot_CronRuns |
| BFXLendBot_Tracking |
| BFXLendBot_Users    |
| BFXLendBot_Vars     |
+---------------------+
4 rows in set (0.01 sec)

The tables are made but are all empty.

error log:

Code:
[Wed Dec 03 11:30:25 2014] [error] [client 123.123.123.123] PHP Notice:  Undefined index: doInstall in /var/www/mbot/install.php on line 9
[Wed Dec 03 11:30:25 2014] [error] [client 123.123.123.123] PHP Notice:  Undefined index: doInstall in /var/www/mbot/install.php on line 135
[Wed Dec 03 11:30:25 2014] [error] [client 123.123.123.123] PHP Notice:  Undefined index: doInstall in /var/www/mbot/install.php on line 287
[Wed Dec 03 11:30:25 2014] [error] [client 123.123.123.123] PHP Notice:  Undefined index: installDBHost in /var/www/mbot/install.php on line 289
[Wed Dec 03 11:30:25 2014] [error] [client 123.123.123.123] PHP Notice:  Undefined index: installDBPrefix in /var/www/mbot/install.php on line 290
[Wed Dec 03 11:30:25 2014] [error] [client 123.123.123.123] PHP Notice:  Undefined index: installDBName in /var/www/mbot/install.php on line 348
[Wed Dec 03 11:30:25 2014] [error] [client 123.123.123.123] PHP Notice:  Undefined index: installDBUser in /var/www/mbot/install.php on line 351
[Wed Dec 03 11:30:25 2014] [error] [client 123.123.123.123] PHP Notice:  Undefined index: installDBPassword in /var/www/mbot/install.php on line 354
[Wed Dec 03 11:30:25 2014] [error] [client 123.123.123.123] PHP Notice:  Undefined index: installEmail in /var/www/mbot/install.php on line 380
[Wed Dec 03 11:31:39 2014] [error] [client 123.123.123.123] PHP Notice:  Undefined index: installAdminUser in /var/www/mbot/install.php on line 442, referer: http://123.123.123.123/mbot/install.php
[Wed Dec 03 11:31:39 2014] [error] [client 123.123.123.123] PHP Notice:  Undefined index: installAdminEmail in /var/www/mbot/install.php on line 445, referer: http://123.123.123.123/mbot/install.php
[Wed Dec 03 11:31:39 2014] [error] [client 123.123.123.123] PHP Notice:  Undefined index: installAdminPassword in /var/www/mbot/install.php on line 448, referer: http://123.123.123.123/mbot/install.php
[Wed Dec 03 11:31:39 2014] [error] [client 123.123.123.123] PHP Notice:  Undefined index: installAdminBFXKey in /var/www/mbot/install.php on line 451, referer: http://123.123.123.123/mbot/install.php
[Wed Dec 03 11:31:39 2014] [error] [client 123.123.123.123] PHP Notice:  Undefined index: installAdminBFXSec in /var/www/mbot/install.php on line 454, referer: http://123.123.123.123/mbot/install.php
[Wed Dec 03 11:33:00 2014] [error] [client 123.123.123.123] PHP Fatal error:  Call to undefined function curl_init() in /var/www/mbot/inc/ExchangeAPIs/bitfinex.php on line 110, referer: http://123.123.123.123/mbot/install.php

Thanks! :)


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF on December 03, 2014, 05:33:13 PM

Code:
[Wed Dec 03 11:33:00 2014] [error] [client 123.123.123.123] PHP Fatal error:  Call to undefined function curl_init() in /var/www/mbot/inc/ExchangeAPIs/bitfinex.php on line 110, referer: http://123.123.123.123/mbot/install.php

Thanks! :)


You don't seem to have curl support enabled on your PHP install, which is typically standard.  CURL is required to use the bitfinex API.

See http://php.net/manual/en/curl.installation.php for help compiling with CURL


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: jabetizo on December 03, 2014, 05:58:51 PM
You don't seem to have curl support enabled on your PHP install, which is typically standard.  CURL is required to use the bitfinex API.

See http://php.net/manual/en/curl.installation.php for help compiling with CURL

My bad, it's my first time using a VPS. It's working like a charm now, thank you! :)


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF on December 03, 2014, 06:02:46 PM

My bad, it's my first time using a VPS. It's working like a charm now, thank you! :)

Glad to hear it.  I added CURL support to the requirements on the front page, so hopefully your experience will help others in the future.

If I got really ambitious some day I could actually have the installer check for all the required components when it runs, but that seems like a lot of work for such a limited scope product....   ::)


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: fandango66 on December 04, 2014, 01:11:41 PM
Great work! Testing it now..

What would be the easiest way to pause the bot? Stop the cron jobs?


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF on December 04, 2014, 02:55:39 PM
Great work! Testing it now..

What would be the easiest way to pause the bot? Stop the cron jobs?

Yeah, stopping the crons would be your best bet.  Right now there's no built in pause button per se, but sometimes when I want to keep some of my money available when it comes off loan, I'll use a High Hold set to a really high interest rate.  That way if something crazy happens and interest spikes to 1% or something the money will still go out, but in all likelihood it will be there waiting for me when I need it.

I have been asked for a pause feature a couple of times now though, so I may roll that into the next update.  I would be pretty easy to add.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF on December 08, 2014, 07:38:00 PM
For anyone who may be interested in such things, I've set up an account running MarginBot with the Following settings:

Spread Available Lends    4
Minimum Lend Rate         0.0650%
Minimum for 30 Day        0.1250%
High Hold Amount           $0.00
Gap Bottom                      $25,000.00
Gap Top                        $125,000.00

http://fuckedgox.com/MBot/mbotTestSettings.PNG

And the results are automatically posted here daily:

http://fuckedgox.com/MBot/#mbRet


So Far I'm averaging pretty much on par with FRR after fees, but with a more realistic FRR efficiency rate of 70%, I'm getting about 28% higher returns.




Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: noggin-scratcher on December 09, 2014, 12:46:12 PM
with a more realistic FRR efficiency rate of 70%

Looking at the height of the FRR wall, and the low volume taken in the last 24hours, I've been assuming the efficiency would be drastically lower than that... I have no data either way, but I'd be quite interested if someone did have a firm idea of just how long the waiting time to get a swap taken at FRR is right now.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF on December 09, 2014, 04:34:11 PM
with a more realistic FRR efficiency rate of 70%

Looking at the height of the FRR wall, and the low volume taken in the last 24hours, I've been assuming the efficiency would be drastically lower than that... I have no data either way, but I'd be quite interested if someone did have a firm idea of just how long the waiting time to get a swap taken at FRR is right now.


My assumption is that it is much lower than that too.  40% wouldn't surprise me at all.  I set it at 70% so that there would be no doubt my comparison is reasonable and fair, if not skewed against me...


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: jabetizo on December 09, 2014, 06:40:50 PM
For anyone who may be interested in such things, I've set up an account running MarginBot with the Following settings:

Spread Available Lends    4
Minimum Lend Rate         0.0650%
Minimum for 30 Day        0.1250%
High Hold Amount           $0.00
Gap Bottom                      $25,000.00
Gap Top                        $125,000.00


Are these settings based on tests? I've been wondering which settings to use and the most intuitive solution for me would be to lend everything at Gap Bottom around $5000, to make sure it gets taken ASAP. Getting lucky and "catching" higher rates at the Gap Top seems just as probable as getting unlucky and the interest rates lowering during that time... :-\


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF on December 09, 2014, 09:58:41 PM
For anyone who may be interested in such things, I've set up an account running MarginBot with the Following settings:

Spread Available Lends    4
Minimum Lend Rate         0.0650%
Minimum for 30 Day        0.1250%
High Hold Amount           $0.00
Gap Bottom                      $25,000.00
Gap Top                        $125,000.00


Are these settings based on tests? I've been wondering which settings to use and the most intuitive solution for me would be to lend everything at Gap Bottom around $5000, to make sure it gets taken ASAP. Getting lucky and "catching" higher rates at the Gap Top seems just as probable as getting unlucky and the interest rates lowering during that time... :-\

They are based on testing I've done.  Setting a gap bottom of $5000 is very low in my opinion, and likely to have you catching lots of random very low loan offers.  For instance, right now there's an offer for $4001.83 at 0.055 then the next step is at %0.0675 .  While your $5000 bottom wouldn't trigger on that offer, it would come close, and I see random low offers like that on the books all the time.  I've found that around $25,000 is where the realistic bottom is, and misses the random low crap.  I've also found that even on a slow day, $25,000 tends to get taken very quickly.  However, the high gap of $125,000 may be a bit high, depending on how much you have in the account.   On accounts with only a few $1,000 or less, a more aggressive and probably better overall setting would be:

Code:
Spread Available Lends    2
Minimum Lend Rate         0.0650%
Minimum for 30 Day        0.1250%
High Hold Amount          $0.00
Gap Bottom           $15,000.00
Gap Top                   $50,000.00



As with all things though, your own testing should trump my opinion.  I'm sure there are settings that would result in better returns than I get, and I'm sure account balance and other factors play a role.




Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: jabetizo on December 09, 2014, 10:47:42 PM
They are based on testing I've done.  Setting a gap bottom of $5000 is very low in my opinion, and likely to have you catching lots of random very low loan offers.  For instance, right now there's an offer for $4001.83 at 0.055 then the next step is at %0.0675 .  While your $5000 bottom wouldn't trigger on that offer, it would come close, and I see random low offers like that on the books all the time.  I've found that around $25,000 is where the realistic bottom is, and misses the random low crap.  I've also found that even on a slow day, $25,000 tends to get taken very quickly.  However, the high gap of $125,000 may be a bit high, depending on how much you have in the account.


What is the reasoning behind using a Gap Top? With a Gap Top the money will not always be lent out, and during this "lost time", the rates can go either higher or lower - if they go lower you are facing a double loss (lost time and lower rates). Do the higher rates you catch with a Gap Top make this risk worthwhile? Why not just set the "Spread Available Lends" to 1, so all offers go $25,000 deep?

However, the high gap of $125,000 may be a bit high, depending on how much you have in the account.

Why should the Gap Top be lower if you have less money?

Thanks :)


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF on December 10, 2014, 03:14:03 AM
What is the reasoning behind using a Gap Top? With a Gap Top the money will not always be lent out, and during this "lost time", the rates can go either higher or lower - if they go lower you are facing a double loss (lost time and lower rates). Do the higher rates you catch with a Gap Top make this risk worthwhile? Why not just set the "Spread Available Lends" to 1, so all offers go $25,000 deep?

The way it tends to play out in my testing (and on my year old live account) is like this:

After a few weeks, my loans will split into 100's of small chunks.   Since each chuck is typically on a 2 day loan, dozens end up closing each hour.  Every 10 minutes the bot will check that balance and split it into 4 offers.  The lowest offer, set at the $25k mark is almost always taken quickly.  During slightly above average movement periods, the next chunk at the second highest rate will be taken in that 10 minute period as well (this is usually only a few .001's of a % higher, but since it was taken in the same hour, it was worth the effort).  The next 2 splits likely won't get taken during that 10 minute period unless the market is going crazy.  So, the 10 minute bot will run, split what's left of those 2 higher points into 4 loans again, and start all over with the lowest 2 likely to get taken, and the highest 2 not.  This will continue to happen until my available balance gets too low too split more than 2 times (under $150, since the smallest loan is $50).  Then it will put that final balance up at the lowest rate, where it will promptly get taken.  Generally, all of this takes less than an hour, maybe 2, so I've effectively lost no interest payments while gambling on a possible mini run that gets a little cash out at a higher rate. The other benefit is the constant splitting of loans into smaller chunks.   This keeps my balance split across many small loans, which creates a constant stream of closing loans, and available balance, which in turn keeps me in a good position to catch any sudden rise in rates when the FRR wall is broken. In general, downward trends are slow and methodical, but the FRR wall breaks are fast and short lived,  and there is nothing in the world more annoying than seeing the wall break and interest hit .75%, but having no available balance to take advantage of it.  In average to good market conditions this has always worked well for me, eaking out a few extra % on my loans.  In particularly slow markets,  i tend to adjust these settings to make sure the money always lends out in an hour or less.  While this is a bot, for best results, it does need occasional tweaking due to market conditions...   ;)


However, the high gap of $125,000 may be a bit high, depending on how much you have in the account.

Why should the Gap Top be lower if you have less money?

Thanks :)

Lower balances mean less available money, which means you'll likely not have enough for multiple splits ($50 / split minimum), so if your available balance is only $120 and your account has a high gap of $125k, it will create 2 splits (instead of the 3 or 4 it would do with more balance), and it will put the second split at the top where it likely won't get hit.  With smaller balances your better off setting the split to 2 (or 1 if it's a really small balance, under $500 or so) and the top somewhere that's more likely to get hit in a 10 minute period.

Again though, this is just my philosophy, and I'm sure there are better ones out there.  That's why I designed the bot to let users set things their own way.

( sorry if this is a thick read or if any of it doesn't make sense, I just typed this all out on a tablet in bed and this forum and auto correct do not like each other....)


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF on December 14, 2014, 04:07:37 PM

Just a warning for everyone running MarginBot on default settings.  The Bitfinex FRR monster is pushing interest rates below .065%, which is the default "Minimum Lend Rate" setting.  :-[  If you want to insure your money stays lent out, make sure to change this to a lower number, or alternatively, move your money into other investments while waiting for the Bitfinex rate to increase.  For reference, 0.065% is about 23% / year after fees, and .05% which is the lowest I will take before moving to other investments ends up being about 17% / year after fees...



Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: Sukrim on December 14, 2014, 08:07:16 PM
The Bitfinex FRR monster is pushing interest rates below .065%
And your bot is helping that by automatically undercutting it, forcing it down further... ;)

I agree that everybody should set their minimal rate they are comfortable with and then also stick to that. That way interest rates will sort themselves out, no matter the FRR or not.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF on December 16, 2014, 04:16:30 PM
Just released a new version of the bot, v0.1.05.

This is an important update for everyone to install, as it fixes a bug that was allowing the bot to put in loan offers under your "Minimum Lend Rate" setting at times.

To update, just save a copy of your existing inc/config.php file, download the latest version and overwrite everything on the server, then upload your saved inc/config.php file.  Everything should be ready to go.

New features include:

v0.1.05

  • If only 1 user account is set up, stats page only shows 1 chart
          (instead of "Global" and that user, which would always be identical)
  • Lots of small fixes for WAMP servers
  • Added a pause feature to disable lending





Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: Sukrim on January 01, 2015, 07:51:20 PM
Got some recent return numbers? As you're forced to undercut FRR most of the time it would be interesting to compare December returns...


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: jabetizo on January 01, 2015, 10:15:58 PM
I noticed in the taskbar that the website interface of the bot sometimes loads google-analytics.com, is this normal?


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF on January 02, 2015, 01:59:13 AM
Got some recent return numbers? As you're forced to undercut FRR most of the time it would be interesting to compare December returns...

Yeah, results are posted for a $5,000 account here daily:

http://fuckedgox.com/MBot/ (http://fuckedgox.com/MBot/)

I did change minimum rate to .025 on that bot, so I can at least get results, but I haven't updated the page explanation.

I noticed in the taskbar that the website interface of the bot sometimes loads google-analytics.com, is this normal?

Yeah, it's just a Google code I accidentally left in the footer from my base template.  You can delete it if you don't like it there, it won't hurt the bot any, and I'll pull it from the next release.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: Sukrim on January 02, 2015, 08:24:52 PM
Hm, interestingly I get significantly better results than the bot now with 30 day FRR autolend - but that likely will change once the market goes upwards again because there's no chance to catch some short high rate profits with that strategy. Looking at the BTC lending market though even with fluctuating prices FRR seems to be mostly "good enough" still, even with undercutting bots.

The difference is about 0.1% less over December with 0 maintenance and managing costs (your returns: ~1.44%, mine 1.34%).


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: noggin-scratcher on January 03, 2015, 04:26:02 PM
Hm, interestingly I get significantly better results than the bot now with 30 day FRR autolend

I'm curious; what's the wait-time like to get a swap taken at FRR? Seems like there's a lot of funds on offer compared to the number/value of FRR swaps taken in a day.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: Sukrim on January 04, 2015, 09:30:16 AM
If you tell me an automated way to extract this information from the downloadable CSV files, I'm happy to help. When I wrote this, FRR was the lowest offer for borrowing for 30 days btw.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: ASutas on January 06, 2015, 12:23:36 AM

Not by me at least so far, I might have to do it though, as the returns seem viable (I'd still love to see data points back to before November, back when swaps rates were more sideways). I am not much of a fan of PHP and setting up MySQL just to run something that checks a market every 10 minutes and sends a couple orders - also I don't need the UI and stuff like that, so I might just carve out the algorithm and put it into a smaller commandline only bot...


I felt the same way so I built https://github.com/eAndrius/BitfinexLendingBot (https://github.com/eAndrius/BitfinexLendingBot) in my spare time (no LAMP required). Pull requests encouraged!


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF on January 06, 2015, 04:21:45 PM
Hm, interestingly I get significantly better results than the bot now w
...
The difference is about 0.1% less over December with 0 maintenance and managing costs (your returns: ~1.44%, mine 1.34%).

So, are your results better than the bot, or just better than they were?  from the above I take it your return is .1% lower than the bots?  Also, I'd point out so far this month, I've logged into MarginBot once, just too look at my charts.  So, maintenance and management are a non-issue.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF on January 06, 2015, 04:27:57 PM

Not by me at least so far, I might have to do it though, as the returns seem viable (I'd still love to see data points back to before November, back when swaps rates were more sideways). I am not much of a fan of PHP and setting up MySQL just to run something that checks a market every 10 minutes and sends a couple orders - also I don't need the UI and stuff like that, so I might just carve out the algorithm and put it into a smaller commandline only bot...


I felt the same way so I built https://github.com/eAndrius/BitfinexLendingBot (https://github.com/eAndrius/BitfinexLendingBot) in my spare time (no LAMP required). Pull requests encouraged!

Good Work.  I built MarginBot to live on a webserver because I didn't want to constantly leave a desktop on and running the bot.  I'd rather not hear loud fans running all night, and I'd rather the bot live on a rack with guaranteed power and 100% internet uptime, but for people with a good server or extra desktop at home, a command-line bot makes sense.

For those that don't want to run it at home though, this bot will perform well on any cheap php hosting plan, like bluehosts or godaddys $2/month plans.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: Sukrim on January 06, 2015, 09:33:18 PM
Hm, interestingly I get significantly better results than the bot now w
...
The difference is about 0.1% less over December with 0 maintenance and managing costs (your returns: ~1.44%, mine 1.34%).
So, are your results better than the bot, or just better than they were?

Recently better than the bot, over whole december 0.1% less than the bot.

Here's a quick chart in Excel (depending on how you use your dates on your site, there might be an off by one error):
https://i.imgur.com/fLtZRM8.png

It seems your strategy might catch up soon, especially if some larger loans get returned and it takes some time to chew through undercutters (hence the 30 day limit, it doesn't take long to find takers at this duration even at rates that are >10% higher than the lowest current short term rates).
Unfortunately https://github.com/eAndrius/BitfinexLendingBot doesn't publish USD returns (only BTC, which are interesting too but far more jaggy usually, also I'm not too willing to publish returns there), otherwise it would be another interesting data point to have.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: gabbello on January 07, 2015, 12:44:46 AM
Nice work.

How does this work for lending BTC? Since I only have BTC in my account I see that it shows my BTC balance where USD balance is shown (in UI). Does this mean that the Gap Bottom and Gap Top should also be expressed in BTC volume and not USD volume?


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF on January 07, 2015, 04:44:16 AM
Nice work.

How does this work for lending BTC? Since I only have BTC in my account I see that it shows my BTC balance where USD balance is shown (in UI). Does this mean that the Gap Bottom and Gap Top should also be expressed in BTC volume and not USD volume?

If your talking about MarginBot, it actually doesn't handle BTC or LTC lending right now, only USD.  I may add BTC in the near future, but up until recently it wasn't worth it for the rates in my mind to lend BTC.  The rates used to be so much lower that converting to USD and lending that, then converting back to BTC would have better returns even if the rate of BTC went up by $100's.   With margin rates how they are now though, I imagine theres a lot more reason to lend BTC.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: gabbello on January 07, 2015, 08:01:31 AM
Thanks for the reply, I hope you will add this soon. I thought this works even now since for some reason my BTC balance appears as "Deposit Balance" in current implementation (e.g. I have 3 BTC in my account and I see $3.00 in MarginBot). I'll keep an eye on this thread for news.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: ASutas on January 15, 2015, 02:23:34 PM

Not by me at least so far, I might have to do it though, as the returns seem viable (I'd still love to see data points back to before November, back when swaps rates were more sideways). I am not much of a fan of PHP and setting up MySQL just to run something that checks a market every 10 minutes and sends a couple orders - also I don't need the UI and stuff like that, so I might just carve out the algorithm and put it into a smaller commandline only bot...


I felt the same way so I built https://github.com/eAndrius/BitfinexLendingBot (https://github.com/eAndrius/BitfinexLendingBot) in my spare time (no LAMP required). Pull requests encouraged!

Good Work.  I built MarginBot to live on a webserver because I didn't want to constantly leave a desktop on and running the bot.  I'd rather not hear loud fans running all night, and I'd rather the bot live on a rack with guaranteed power and 100% internet uptime, but for people with a good server or extra desktop at home, a command-line bot makes sense.

For those that don't want to run it at home though, this bot will perform well on any cheap php hosting plan, like bluehosts or godaddys $2/month plans.

a webserver where you have access to crontab? Surely you will have access to GNU Screen as well :) Also, no need for a "good" server like LAMP stacks require, simple headless rpi will be more than enough! The nice thing about yours is that you can use a GUI.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: ASutas on January 15, 2015, 02:30:11 PM
Nice work.

How does this work for lending BTC? Since I only have BTC in my account I see that it shows my BTC balance where USD balance is shown (in UI). Does this mean that the Gap Bottom and Gap Top should also be expressed in BTC volume and not USD volume?

https://github.com/eAndrius/BitfinexLendingBot can do any Bitfinex-supported currency trading :) Moreover, it has different trading strategies, which you can compare here: https://docs.google.com/a/sutas.eu/spreadsheets/d/1lUwuN0KUwVIDBCxXOMNBsZyx_XsB1ND_KFmAJlUMRKQ


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: gabbello on January 17, 2015, 01:26:55 PM
Unfortunately I'm not familiar with go and I have some difficulties starting this. I managed to install go under ubuntu, configured variables as below:
export GOROOT=/usr/lib/go
export GOPATH=$HOME/go
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin

Then I do: go get -u github.com/eAndrius/bitfinex-go this creates the go folder in $HOME/go.

I'm not sure where I should run "go build". I presume I should run this from folder:  $HOME/go/src/github.com/eAndrius/bitfinex-go
I run this, there is no error, but nothing seems to happen.

And in this folder I just have the files:
LICENSE  README.md  bitfinex.go  bitfinex_test.go  glide.yaml  img

There is no default.conf and, of course, no ./BitfinexLendingBot script.





Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF on January 19, 2015, 04:07:40 PM
Unfortunately I'm not familiar with go and I have some difficulties starting this. I managed to install go under ubuntu, configured variables as below:
export GOROOT=/usr/lib/go
export GOPATH=$HOME/go
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin

Then I do: go get -u github.com/eAndrius/bitfinex-go this creates the go folder in $HOME/go.

I'm not sure where I should run "go build". I presume I should run this from folder:  $HOME/go/src/github.com/eAndrius/bitfinex-go
I run this, there is no error, but nothing seems to happen.

And in this folder I just have the files:
LICENSE  README.md  bitfinex.go  bitfinex_test.go  glide.yaml  img

There is no default.conf and, of course, no ./BitfinexLendingBot script.

Guys, can we keep this thread focused on MarginBot please?  I don't want people getting confused about what script your discussing.  If you want to discuss or need support on the other script, please start a thread for it.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: ASutas on January 23, 2015, 02:53:40 PM
Guys, can we keep this thread focused on MarginBot please?  I don't want people getting confused about what script your discussing.  If you want to discuss or need support on the other script, please start a thread for it.

Totally agree! Sorry for hijacking :)


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: Amph on January 23, 2015, 08:55:19 PM
cool , do you have enough for another job based on php? i need a programmer


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF on January 23, 2015, 09:06:22 PM
cool , do you have enough for another job based on php? i need a programmer

Absolutely.  I'm a freelance programmer.  Contact me at howard@fuckedgox.com and I'll be happy to discuss any projects you're working on.



Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: PRab on January 27, 2015, 02:28:58 AM
Can I have a little more help setting this up? I have ubuntu server installed with the LAMP stack. I extracted MarginBot to /var/www/html, and went to the webpage. Everything is looking good and I tried to run through the setup procedure. I got a little hung up because it appears that you have to actually create the DB in mysql before the setup will build the tables and such. Everything is still looking good, so I log in to MarginBot using the username/password I setup.

It is now complaining that the the cron scripts haven't run. I waited at least 10 minutes, but it was still showing the same error. Is there anything special I have to do to allow MarginBot "Access to add a cronjob"?


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF on January 27, 2015, 02:47:56 AM
It is now complaining that the the cron scripts haven't run. I waited at least 10 minutes, but it was still showing the same error. Is there anything special I have to do to allow MarginBot "Access to add a cronjob"?

You'll need to set up the crons yourself, unfortunately MarginBot can't do that for you.  If you don't know how to set up a cronjob,  i'd take a look at the Ubuntu docs for your specific distribution version.

This also gives a good intro to cron:

https://help.ubuntu.com/community/CronHowto

For MarginBot you'll want to add 2 lines, one to run the 10 minute cron, and one to run the hourly cron.  It should give you the details on the exact lines to add in the error when you log in to MarginBot.   Something like:

5 * * * * wget -qO- http://yoururl.com/HourlyCron.php >/dev/null 2>&1

and

01,11,21,31,41,51 * * * * wget -qO- http://yoururl.com/TenMinuteCron.php >/dev/null 2>&1


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: PRab on January 28, 2015, 12:25:36 AM
I added those lines (from index.php) to my crontab, waited 10 minutes, but still nothing. Does that cron job have to run for a specific user? Also, if I just wget that url, would that be the equivalent of the cron job running? I tried it, but wget just returned an empty file. (Sorry if these questions are stupid, I'm a programmer, but I don't use Linux often and have never used php)

Another observation, after the 2nd page of setup, it just left me at a blank screen. Is that correct?


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF on January 28, 2015, 04:26:58 PM
I added those lines (from index.php) to my crontab, waited 10 minutes, but still nothing. Does that cron job have to run for a specific user? Also, if I just wget that url, would that be the equivalent of the cron job running? I tried it, but wget just returned an empty file. (Sorry if these questions are stupid, I'm a programmer, but I don't use Linux often and have never used php)

If you run wget manually it should get rid of the warning for a little while, but the point of the cron is to run it every 10 minutes, and I'm assuming you wouldn't want to have to run it manually every 10 minutes...

Another observation, after the 2nd page of setup, it just left me at a blank screen. Is that correct?

No, this is definitely not normal.  It sounds like something didn't work right.  When you load the index or MarginBot, does it show your balance correctly?  Do you see any data in the database tables it created?  Try opening the cron urls in a web browser as well, if something isn't working there it should give you an error message of some kind.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: PRab on January 29, 2015, 01:19:28 AM
I see 4 tables:
BFXLendBot_CronRuns
BFXLendBot_Tracking
BFXLendBot_Users
BFXLendBot_Vars

All of the tables appear to be empty.

When I open the cron urls in a web browser, it just displays an empty page.

Edit: Missed answering one of your questions. I do not see my balance anywhere. First it shows me a login page. When I login, it gives an error "Your Username or Email was not found! Please Try Again." and shows what looks like the headers to a table.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF on January 30, 2015, 03:29:02 PM
I see 4 tables:
BFXLendBot_CronRuns
BFXLendBot_Tracking
BFXLendBot_Users
BFXLendBot_Vars

All of the tables appear to be empty.

When I open the cron urls in a web browser, it just displays an empty page.

Edit: Missed answering one of your questions. I do not see my balance anywhere. First it shows me a login page. When I login, it gives an error "Your Username or Email was not found! Please Try Again." and shows what looks like the headers to a table.

something didnt work during install.  I'm guessing maybe your config file wasnt writeable, or else you entered something about your database incorrectly...  Try going through the install.php process again and see what happens


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: jabetizo on February 02, 2015, 02:24:40 AM
Another observation, after the 2nd page of setup, it just left me at a blank screen. Is that correct?

Does your PHP installation have curl enabled?


I'm having trouble installing... Step 1 and 2 go through smoothly but after clicking "Complete Install", I just get a blank page.

You don't seem to have curl support enabled on your PHP install, which is typically standard.  CURL is required to use the bitfinex API.

See http://php.net/manual/en/curl.installation.php for help compiling with CURL


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: PRab on February 03, 2015, 03:38:05 AM
Looks like Ubuntu doesn't install php5-curl by default. Running
Code:
sudo apt-get install php5-curl
and restarting the webserver fixed it. Thanks for all the help!

Edit: After installing php5-curl, I had to drop all the tables and rerun the install script.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: PRab on February 03, 2015, 03:46:55 AM
Is there a way to make MarginBot also lend out my BTC balance? All I see are options for USD. Right not I have my money stored in Bitfinex split between both USD and BTC because I'm not sure which direction the market is going to go.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF on February 03, 2015, 03:38:43 PM
Is there a way to make MarginBot also lend out my BTC balance? All I see are options for USD. Right not I have my money stored in Bitfinex split between both USD and BTC because I'm not sure which direction the market is going to go.

Currently it only supports USD.  In a future update I may add BTC and LTC back in, but when the bot was written BTC/LTC lending rates were so low it wasn't worth lending them (and the rates are quickly slipping back into the not worth lending area again.....).


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: nrd525 on February 27, 2015, 02:01:23 AM
Looks like a great idea and a good implementation. I'm a php/mysql developer, though not a security expert - so a lot of my security concerns may be totally wrong and are partially for my own education.  Some comments:

BTC lending is becoming a bigger deal.  Who knows if it will last.

Hourlycron.php and TenMinuteCron.php - are mostly identical and could be refactored.

What's the risk of storing a plain text bitfinex api key in a mysql database?

Is the fact that PasswordHash.php function: crypt_private() uses md(5) a security issue?

Do you have any plans to support leap years? Just kidding =)

It's really a feature that BFX should offer - but it might be nice to have multiple auto-lend rates.  So you could set aside $1000 at 0.03%, $1000 at 0.04%, and so on.  I'm guessing this bot could be customized to do this.  It's similar to your high hold concept, but a bit more elaborate.

Is any kind of collision attack possible using the install function?  As it will tell if you a BFX key is already used.

Are there any places you might want to use strip_tags() to exclude javascript (or other) attacks?




Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF on February 28, 2015, 07:03:09 PM
Looks like a great idea and a good implementation. I'm a php/mysql developer, though not a security expert - so a lot of my security concerns may be totally wrong and are partially for my own education.  Some comments:

BTC lending is becoming a bigger deal.  Who knows if it will last.

Hourlycron.php and TenMinuteCron.php - are mostly identical and could be refactored.


probably could, but they work fine as is...  when they were originally coded, for my own internal use, there were reasons they were seperated out.  most of those reasons didn't make it to the open source code.

What's the risk of storing a plain text bitfinex api key in a mysql database?

Low, but not non-existant.  api keys don't allow removal or any other direct access to currency on bitfinex, only orders and balance checks basically.  So someone could potentially set a low order or something along those lines with your key, but they couldn't withdraw any currency for example.  One way encryption isn't feasible since I need to pass the key, and I'm generally of the opinion that simple encrpytion isn't especially useful if someone is able to get access to your DB, since they probably have access to the code that contains the encryption salt at that point as well.

Is the fact that PasswordHash.php function: crypt_private() uses md(5) a security issue?

It doesn't.  thats just a fallback that shouldn't come into play.  Read more about the framework here:
http://www.openwall.com/phpass/


Do you have any plans to support leap years? Just kidding =)
It's really a feature that BFX should offer - but it might be nice to have multiple auto-lend rates.  So you could set aside $1000 at 0.03%, $1000 at 0.04%, and so on.  I'm guessing this bot could be customized to do this.  It's similar to your high hold concept, but a bit more elaborate.

I'm available for hire  ;-P

Is any kind of collision attack possible using the install function?  As it will tell if you a BFX key is already used.

Thus the "Delete install.php" nag when its installed.


As I state in the install direction, people should really consider security as they see fit when installing this app. I consider it pretty low risk, since the API is pretty limited at bitfinex, but on my own server, I have several extra layers of protection, as I would any financial app.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: nrd525 on February 28, 2015, 10:33:41 PM
Thanks for all your responses!  Also, please reply to my PM which found something that I didn't want to share publicly in case it was a real bug.

How is the bot performing in the recent upsurge in rates? I've been feeling that the USD rates would increase for a week or two - and just now they're hitting 0.07%/day.   Unfortunately I gave up waiting and have most of my money lent out at 0.0288%/day for the next 5 days.

We're probably in another spike and then slow decline phase.

I've been lending out USD swap on BFX since Jan or Feb 2013.  Got around 100% in 2013 which was pretty crazy, and 40% in 2014.  This year, I'm guessing that I might make as little as 10%


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF on March 01, 2015, 01:34:22 AM
Thanks for all your responses!  Also, please reply to my PM which found something that I didn't want to share publicly in case it was a real bug.

I'll reply tomorrow when I've had a few less beers, since i just came back from a Mardi Gras party, but suffice it to say, I don't particularly consider what you found a risk.  The strings are always escaped before actual use in a database.  

EDIT:  I feel like I should elaborate here for anyone now concerned about this.  The userid string is set to a session variable here:
accounts.php line 46:   $this->userid = $_SESSION['userid'];

He was concerned that I pass this string to the bitfinex object without escaping it later on, which is true, but every time I use the session object, or the passed setter variable in the bitfinex class, I ALWAYS escape it before passing it to the database...  so, there is no real security concern here.  This is verifiable throughout the bitfinex class, on lines:
132, 150, and 363  (the only places the userid variable is ever passed to a database in the bitfinex class).  could it have been escaped earlier?  yes.  but i prefer to always escape when doing a sql query, not before.


How is the bot performing in the recent upsurge in rates? I've been feeling that the USD rates would increase for a week or two - and just now they're hitting 0.07%/day.   Unfortunately I gave up waiting and have most of my money lent out at 0.0288%/day for the next 5 days.

We're probably in another spike and then slow decline phase.


the latest results on a very basic setup are always available here, as mentioned earlier in this thread:
http://fuckedgox.com/MBot/

Yesterdays return was %0.040010, but i imagine todays will be better (current estimate is 0.05790%).  Automation bots like margin bot are very good at splitting your total investment across many small loans, so you always have at least some money ready to catch waves like we've had the last few days.  On my larger account the last few days return is even higher.

I've been lending out USD swap on BFX since Jan or Feb 2013.  Got around 100% in 2013 which was pretty crazy, and 40% in 2014.  This year, I'm guessing that I might make as little as 10%

I started in mid 2013, but I've been running the bot (in a very early form) since Jan 14.  in 2014 I made .1277% / day averaged over the year (About 50% for the year).  earlier in this thread you can see most of my returns posted in csv format, though i was doing other things with the account during part of that time, so its not 100% accurate.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: Sukrim on March 04, 2015, 12:28:52 PM
I recently updated my spreadsheet (since now the FRR wall has been broken a few times) to compare your bot returns with 30 day auto-FRR:

The statement on your website ("* FRR Return Difference Assumes a 70% Efficiency for time money spends lent out. This is actually MUCH higher than most users get using the FRR, but seems like a reasonable comparison") is completely wrong, here are actual differences between your retuns and mine in percent ( -(100%-my_returns/your_returns) ) since you report them on your page:
Code:
01.12.2014	-7,443460%
02.12.2014 -10,054463%
03.12.2014 -15,504663%
04.12.2014 -16,924298%
05.12.2014 -10,553673%
06.12.2014 -27,546879%
07.12.2014 -29,276524%
08.12.2014 -33,408200%
09.12.2014 -33,379851%
10.12.2014 -25,599959%
11.12.2014 -11,808594%
12.12.2014 -11,556969%
13.12.2014 -11,719647%
14.12.2014 -11,798841%
15.12.2014 -9,980899%
16.12.2014 2,099330%
17.12.2014 1,963954%
18.12.2014 1,618318%
19.12.2014 9,932038%
20.12.2014 10,659478%
21.12.2014 17,783933%
22.12.2014 19,632251%
23.12.2014 -0,274929%
24.12.2014 36,185919%
25.12.2014 47,920128%
26.12.2014 21,771841%
27.12.2014 33,091841%
28.12.2014 24,557408%
29.12.2014 42,748676%
30.12.2014 22,251068%
31.12.2014 22,583313%
01.01.2015 19,038134%
02.01.2015 16,775189%
03.01.2015 18,753871%
04.01.2015 20,981465%
05.01.2015 10,475503%
06.01.2015 -4,716642%
07.01.2015 -9,402876%
08.01.2015 2,937789%
09.01.2015 1,264892%
10.01.2015 -7,299879%
11.01.2015 4,262874%
12.01.2015 6,635660%
13.01.2015 7,094768%
14.01.2015 3,554590%
15.01.2015 12,009196%
16.01.2015 8,244013%
17.01.2015 0,757309%
18.01.2015 1,362987%
19.01.2015 0,743891%
20.01.2015 -3,301981%
21.01.2015 3,499526%
22.01.2015 -3,648495%
23.01.2015 -17,951652%
24.01.2015 -3,792983%
25.01.2015 1,869511%
26.01.2015 4,668778%
27.01.2015 1,901741%
28.01.2015 3,410024%
29.01.2015 5,961179%
30.01.2015 -0,522030%
31.01.2015 -6,395268%
01.02.2015 -4,071584%
02.02.2015 -2,634039%
03.02.2015 0,237169%
04.02.2015 -3,479075%
05.02.2015 -7,313430%
06.02.2015 -11,208395%
07.02.2015 -5,065939%
08.02.2015 3,776792%
09.02.2015 1,576461%
10.02.2015 -5,731081%
11.02.2015 -9,831616%
12.02.2015 -7,923571%
13.02.2015 4,206058%
14.02.2015 1,688207%
15.02.2015 -5,998144%
16.02.2015 -25,304583%
17.02.2015 -18,174385%
18.02.2015 -9,773438%
19.02.2015 -3,527300%
20.02.2015 -4,175197%
21.02.2015 -5,676997%
22.02.2015 -4,951486%
23.02.2015 -10,979872%
24.02.2015 -16,248698%
25.02.2015 -25,884357%
26.02.2015 -19,517822%
27.02.2015 -14,240242%
28.02.2015 -31,930358%
01.03.2015 -36,312944%
02.03.2015 -30,285468%
03.03.2015 -17,201920%

-30% for example means that I earned 30% less that day in swaps than your bot did, +30% means I earned more than your bot. While FRR seems to definitely underperform if the FRR wall is broken (like recently), in a downtrend the FRR seems to be actually the better choice (last week of December) or at least not much different from your bot (January until mid-February).

I'd recommend a less aggressive strategy when the rates are trending down (FRR falls slower than a bot undercutting it) but it seems to be great in situations like right now where FRR might be a loss. To determine the strategy, you might want to sample and store the currently lowest rate on the books as well as the current FRR rate every 10 minutes, then calculate the return of the last 24 hours with each strategy, and either place FRR bids (FRR wall existing, FRR returns of the last 24h were above lowest rate returns) or undercut the current best offer (no FRR wall, lowest rate return of the last 24h was above FRR return). Maybe with an optional setting to adjust the time window (24 hours, 72 hours, 1 hour...)


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: najzenmajsen on March 04, 2015, 01:36:18 PM
cool , do you have enough for another job based on php? i need a programmer

Absolutely.  I'm a freelance programmer.  Contact me at howard@fuckedgox.com and I'll be happy to discuss any projects you're working on.


That was one hell of a proffesional email adress you have there ;) seriously tho , i think i might be contacting you into near future if that's a real email i need a php aswell : >


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF on March 08, 2015, 04:02:15 PM
I recently updated my spreadsheet (since now the FRR wall has been broken a few times) to compare your bot returns with 30 day auto-FRR:

The statement on your website ("* FRR Return Difference Assumes a 70% Efficiency for time money spends lent out. This is actually MUCH higher than most users get using the FRR, but seems like a reasonable comparison") is completely wrong, here are actual differences between your retuns and mine in percent ( -(100%-my_returns/your_returns) ) since you report them on your page:

-30% for example means that I earned 30% less that day in swaps than your bot did, +30% means I earned more than your bot. While FRR seems to definitely underperform if the FRR wall is broken (like recently), in a downtrend the FRR seems to be actually the better choice (last week of December) or at least not much different from your bot (January until mid-February).



This is the information I got from a VERY reliable source.   ;D  If you're doing better great, but I trust the information to be accurate, at least as an average, which is my primary concern, since most people using the bot will be concerned about beating the average.  ( I think the main difference is you do 30 Day FRR Lends, which very few other people do.  Most people don't seem to want their money tied up for a full 30 days, unless they are getting exceptional rates. )



I'd recommend a less aggressive strategy when the rates are trending down (FRR falls slower than a bot undercutting it) but it seems to be great in situations like right now where FRR might be a loss. To determine the strategy, you might want to sample and store the currently lowest rate on the books as well as the current FRR rate every 10 minutes, then calculate the return of the last 24 hours with each strategy, and either place FRR bids (FRR wall existing, FRR returns of the last 24h were above lowest rate returns) or undercut the current best offer (no FRR wall, lowest rate return of the last 24h was above FRR return). Maybe with an optional setting to adjust the time window (24 hours, 72 hours, 1 hour...)

Theres always room for improvement in my overall strategy, but as a basic out of the box bot, I'm fairly sure MarginBot is currently unbeaten in returns (including annualized against even the best FRR users).  There is a new version which will be released soon which will make a few tweaks to the core engine.  In my internal testing, its performing about 3-5% better than the current version of MarginBot.  Not a huge difference, but certainly worthwhile.

One thing I will say, my bots will never support the FRR.  It would be completely counter intuitive to the entire point of this bot, which is to lend money quickly and catch uptrends.  The only way to get a reasonable return in FRR is to keep the money lent out, and the only way to do that is with 30 day loans.  2 day FRR loans sit for a very long time, especially in down markets, making no returns at all.  And 30 day loans would miss any rate rises, and significantly reduce annual returns.  As it stands, those FRR wall breaks and rapid rate rises more than make up for any slightly lower days MarginBot has.  It only takes a few days where rates jump to .45% to beat months of FRR being .005% higher than MarginBot rates.

Besides, as a general rule, I have serious issues with the manipulative concept of an "Averaged" open market.



Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF on March 08, 2015, 04:09:51 PM
cool , do you have enough for another job based on php? i need a programmer

Absolutely.  I'm a freelance programmer.  Contact me at howard@fuckedgox.com and I'll be happy to discuss any projects you're working on.


That was one hell of a proffesional email adress you have there ;) seriously tho , i think i might be contacting you into near future if that's a real email i need a php aswell : >

I have many, many domains.  Thats just the one I use here.  If you were in tech in the 90's / early 00's, there was a website called fuckedcompany.com that pretty much everyone knew about and hated / dreaded / loved  depending on their job title.  It was a bit of a play on that.

As for php, I'm happy to discuss any projects.  I am going to be travelling for the next week or so though, so I may be a little slower to respond than normal.  I will get back to you as quickly as available internet allows.



Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: theskillzdatklls on March 09, 2015, 08:27:19 AM
nice project


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: SebastianJu on March 27, 2015, 11:39:19 PM
I like the bot but i wonder about the settings i should use. When i use standard settings then loans are given out pretty fast but often for low rates. Today there were many hours of low rates because for some reason (does someone know why) there were many many usd on offer. I ended up getting swaps for 20% less than normal. So when the minimum is 48 hours to lend then 20% of this is 9,6 hours. So if i would have sat up my values that it would wait around that long then i would still get the same like i get now. Plus a higher chance of getting more on other times.

So taking these considerations into account, what USD-Values should i chose? Any advise?

And can someone say why there were so many usd on offer today? It doesnt look like it had an effect on price though.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF on March 28, 2015, 04:04:30 PM
I like the bot but i wonder about the settings i should use. When i use standard settings then loans are given out pretty fast but often for low rates. Today there were many hours of low rates because for some reason (does someone know why) there were many many usd on offer. I ended up getting swaps for 20% less than normal. So when the minimum is 48 hours to lend then 20% of this is 9,6 hours. So if i would have sat up my values that it would wait around that long then i would still get the same like i get now. Plus a higher chance of getting more on other times.

So taking these considerations into account, what USD-Values should i chose? Any advise?

And can someone say why there were so many usd on offer today? It doesnt look like it had an effect on price though.

The markets over the last couple of days are back to normal actually.  We had been on a pretty crazy rise for about 3 weeks, which is why things probably seemed a bit weird if you just started doing margin lending.

MarginBot was designed in particular to undercut the FRR so that money would actually lend out (in normal conditions, the FRR is an unbreakable wall that almost never gets crossed, so people who set their money to autorenew lend at the FRR would have very long wait times until their money was actually lent).  The philosophy behind MarginBot is to lend out any money in the account as quickly as possible, while still getting as good as possible of a return.  Money not lent lowers your returns much worse than money lent at a slightly lower % rate.

As for settings, I generally do not give setting advice because everyone has their own needs and return expectations, and the amount you have in your account can have a significant impact on appropriate settings.

As a rough guide though, in the current market, on an account with between say $25,000 - $50,000 setting:

Spread Available Lends:   6
Minimum Lend Rate:        0.025% (or whatever you are comfortable with, we've recently been lower than this, but probably won't get this low again for at least a month or 2)
Minimum for 30 Day:       0.1%
Gap Bottom:                  $20,000
Gap Top:                       $125,000

This should provide a good mix of quickly lending out most of the money (the $20,000 gap bottom goes quickly, then a few of your loans will go out), while keeping a little bit waiting for a better rate if theres a spike.  And since the rates are over 0.1% right now you'll take advantage of the high rates with 30 day loans, but as rates go down, you'll move into a position to keep loans short and wait for another rate spike.

(again, these are just loose suggestions, and you mileage may vary....)




Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: jabetizo on March 28, 2015, 10:22:27 PM
Some borrowers seem to only take 30-day loans. I think it would be useful to calculate the "Gap Bottom" taking into account only the 30-day offers when the "Minimum for 30 Day" rate is achievable this way (when there are less than "Gap bottom" 30 day offers below the "Minimum for 30 Day" rate).

https://i.imgur.com/1xr0uVc.png https://i.imgur.com/f6EZQIL.png


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF on March 29, 2015, 04:03:23 PM
Some borrowers seem to only take 30-day loans. I think it would be useful to calculate the "Gap Bottom" taking into account only the 30-day offers when the "Minimum for 30 Day" rate is achievable this way (when there are less than "Gap bottom" 30 day offers below the "Minimum for 30 Day" rate).

This is a feature I'm working on adding into the next version.  I've got a lot of other projects taking priority right now, but hope to get the next version up in a few weeks.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: SebastianJu on March 30, 2015, 04:56:51 PM
HowardF... can you take out the functioninality that when you change the USD-Values that with every key entered the number is redrawn and the cursor set at the last place? It makes it hard to change anything especially substantially changes.

And it might make sense, if different swap offers created have the same percentage, to merge those offers into one offer. This way the fragmentation of offers could be lowered. They are in the same place anyway with the same percent.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: SebastianJu on March 31, 2015, 11:07:57 AM
Its some time since i made something with a server so i wonder do you guys protect your marginbot directory? I guess first step would be to exclude it from the robots.txt so that no hacker can find it in google. Next would be to make a password protection for the directory?

How do you protect it? Im not even sure if the API can be misused really but i guess better safe than sorry.

Edit: And a statspage would be good. For example showing how long funds stayed not lent out. That could lead to find better settings. Sorry when i have so many requests. I test the software and some things come to mind while doing it. ;)

Edit2: Looks like i cant enable short_open_tag = On on my hosting because of security reasons. I will have to change all files because of that. Maybe its possible to use <?php instead <? in the next version? Ill change my files manually for now.

Edit3: It looks most files already have the normal tag. Only a couple of files has to be changed. Those are:

index.php
install.php
crons/HourlyCron.php
crons/TenMinuteCron.php
inc/header.php
inc/version_info.php
json/stats.php

I hope i didnt miss one.

Edit4: header.php contains a couple of short tags in the code. Its the only file though. Im sure i found all now.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: SebastianJu on April 06, 2015, 05:27:34 PM
It might  be good to only cancel swap offers when the total amount of deposit available and loans pending is over 50USD. Otherwise it will cancel a swap with, for example 40$ and no way to put it out there again until more comes in, which might take a day. In that time the swap most probably would have been taken then.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: Sukrim on April 07, 2015, 09:16:39 PM
You can put out smaller offers using Autolend, I am not sure if it is possible using the API though (or worth the hassle of implementing this...).


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: SebastianJu on April 08, 2015, 10:40:59 AM
You can put out smaller offers using Autolend, I am not sure if it is possible using the API though (or worth the hassle of implementing this...).

At the moment the bot has a $50 limit. He wont create new offers below that value.

But he cancels all orders on starting of the cron it seems. At least as far as i read the code. All orders get cancelled and then he meets the $50 limit and cant recreate them. I had $42 sitting around over night because no swap ended in that time.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF on April 15, 2015, 07:52:58 PM
Its some time since i made something with a server so i wonder do you guys protect your marginbot directory? I guess first step would be to exclude it from the robots.txt so that no hacker can find it in google. Next would be to make a password protection for the directory?

How do you protect it? Im not even sure if the API can be misused really but i guess better safe than sorry.

I use a password protected directory on a firewalled server to protect mine.  The actual risk from the API is low, but it is a good idea to put some reasonable security in place, and do you best to prevent anything from finding it in general.  The next version will have a robots.txt by the way, I just haven't pushed it live yet.  Making your own for now is highly suggested.  Nothing worse than having your Marginbot show up on google.



Edit: And a statspage would be good. For example showing how long funds stayed not lent out. That could lead to find better settings. Sorry when i have so many requests. I test the software and some things come to mind while doing it. ;)


I would love to do better stats when I have the time.  I'll be happy to add this to the feature request list.


Edit2: Looks like i cant enable short_open_tag = On on my hosting because of security reasons. I will have to change all files because of that. Maybe its possible to use <?php instead <? in the next version? Ill change my files manually for now.

Edit3: It looks most files already have the normal tag. Only a couple of files has to be changed. Those are:

index.php
install.php
crons/HourlyCron.php
crons/TenMinuteCron.php
inc/header.php
inc/version_info.php
json/stats.php

I hope i didnt miss one.

Edit4: header.php contains a couple of short tags in the code. Its the only file though. Im sure i found all now.

yeah, i'm terrible at using short tags. Sorry about that, I'll make sure to clean this up in the next release.



Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF on April 15, 2015, 07:55:05 PM
You can put out smaller offers using Autolend, I am not sure if it is possible using the API though (or worth the hassle of implementing this...).

At the moment the bot has a $50 limit. He wont create new offers below that value.

But he cancels all orders on starting of the cron it seems. At least as far as i read the code. All orders get cancelled and then he meets the $50 limit and cant recreate them. I had $42 sitting around over night because no swap ended in that time.

Last time I tried it wasn't possible using the API, though I haven't tried in a while.  I'll check into this next update.  If its still not possible, I do like the idea of not canceling small orders when below $50.  I'm not sure its really worth the effort, but it would be easy to implement, so I'll look into it.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF on April 15, 2015, 08:00:38 PM
HowardF... can you take out the functioninality that when you change the USD-Values that with every key entered the number is redrawn and the cursor set at the last place? It makes it hard to change anything especially substantially changes.




I use an open source money formatter script that causes this.  I'll look into making it optional.

And it might make sense, if different swap offers created have the same percentage, to merge those offers into one offer. This way the fragmentation of offers could be lowered. They are in the same place anyway with the same percent.

This wouldn't effect the fragmentation significantly to be honest, since most small amounts will all get taken as one loan, and returned at the same time to go back into the loan queue.  Besides, fragmentation is a good thing.  it keeps loans always coming due, which keeps money always going back out on loan, which is how this bot manages to always take advantage of suddent rate spikes. I've generally got anywhere between 200 - 400 loans out on my account, which means I'm always able to catch even 5 or 10 minute long spikes with at least a little loan.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: SebastianJu on April 17, 2015, 11:15:30 AM
HowardF... can you take out the functioninality that when you change the USD-Values that with every key entered the number is redrawn and the cursor set at the last place? It makes it hard to change anything especially substantially changes.




I use an open source money formatter script that causes this.  I'll look into making it optional.

And it might make sense, if different swap offers created have the same percentage, to merge those offers into one offer. This way the fragmentation of offers could be lowered. They are in the same place anyway with the same percent.

This wouldn't effect the fragmentation significantly to be honest, since most small amounts will all get taken as one loan, and returned at the same time to go back into the loan queue.  Besides, fragmentation is a good thing.  it keeps loans always coming due, which keeps money always going back out on loan, which is how this bot manages to always take advantage of suddent rate spikes. I've generally got anywhere between 200 - 400 loans out on my account, which means I'm always able to catch even 5 or 10 minute long spikes with at least a little loan.

Youre right with the fragmentation but often i see open swap offers that are offered at the exact same rate. Since they are added at the same moment they will most probably will taken in the same moment. But they will still show up as two even though they are the same rate and time. And they will end at the same time too.

Only thought it might be a bit easier to read though its not as important.

Regarding not swapped out USD. You might count them like Dollar-Minutes. Each amount of USD not lend out for some minutes will add to that account. Then one might be able to adjust the settings and lower that amount by checking the performance at the same time.

I think it would be a great tool to maximize profits.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: nemercry on May 02, 2015, 01:10:45 PM
Hey there,

i want to test the script right now. I am using XAMPP for testing with Windows. Everytime i went past the database configuration and the website config the install.php script tells me that everything should work fine now and i should make my config readable only. After i did that and klick on "Log On" it just redirects me to install.php again and starts a new installation process.

What could be wrong ?


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: SebastianJu on May 04, 2015, 11:03:52 AM
Hey there,

i want to test the script right now. I am using XAMPP for testing with Windows. Everytime i went past the database configuration and the website config the install.php script tells me that everything should work fine now and i should make my config readable only. After i did that and klick on "Log On" it just redirects me to install.php again and starts a new installation process.

What could be wrong ?

Maybe your config isnt readable anymore now? Only a guess.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF on May 04, 2015, 02:48:47 PM
Hey there,

i want to test the script right now. I am using XAMPP for testing with Windows. Everytime i went past the database configuration and the website config the install.php script tells me that everything should work fine now and i should make my config readable only. After i did that and klick on "Log On" it just redirects me to install.php again and starts a new installation process.

What could be wrong ?

Sounds like you may be changing your config to be unreadable.  Make sure to set it to something your webserver can read, but not write too.  Using chmod 0644 *should* work, unless your server has some strange custom settings.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: nemercry on May 06, 2015, 08:50:18 AM
I did not get it work. I decided to write my own bot. When i finished the Server gave me a "nonce to small error" which can be interpreted as "your privat key and secret key are already in use". Which was not done by my own program and the key was only used for the php bot. I deleted the old keys, created a new one and everything worked as it should.
Any idea how or why that happened ?


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: SebastianJu on May 06, 2015, 01:16:05 PM
I did not get it work. I decided to write my own bot. When i finished the Server gave me a "nonce to small error" which can be interpreted as "your privat key and secret key are already in use". Which was not done by my own program and the key was only used for the php bot. I deleted the old keys, created a new one and everything worked as it should.
Any idea how or why that happened ?

Maybe bitfinex is binding keys to one single application, storing all the details about the sending computer, browser and so on? Though you might better ask that in bitfinex services thread. https://bitcointalk.org/index.php?topic=229438


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF on June 24, 2015, 06:03:28 PM
Sorry for my long absence in this thread.  I was working on some other projects over the last couple months, and haven't had much time to spend on bitcoin projects.  I'm going to be checking in a bit more though, and answering any questions about MarginBot anybody has, so feel free to ask away again.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF on June 24, 2015, 06:04:54 PM
I did not get it work. I decided to write my own bot. When i finished the Server gave me a "nonce to small error" which can be interpreted as "your privat key and secret key are already in use". Which was not done by my own program and the key was only used for the php bot. I deleted the old keys, created a new one and everything worked as it should.
Any idea how or why that happened ?

nonce to small means you aren't passing a good nonce id to your API key.  It needs to be a unique always incrementing number passed with every query.  I use the microtime in Marginbot.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: deponzit on July 28, 2015, 12:48:35 AM
Thanks for this, HowardF. Seems to be working well so far!

I got this working on 000webhost.com - which is a free web host if anyone was looking for a working free option. If anyone needs help setting it up, let me know. To get it to work, I changed the short tags to full and had to make cron "loaders," which just called get_file_contents() on the real cron files, as 000webhost limits you to running "php -f" in the cronjobs.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: Sukrim on July 28, 2015, 07:42:00 AM
That sounds like a REALLY REALLY REALLY bad idea to run on a free webhost! Run this only on hardware you trust and control!


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: deponzit on July 28, 2015, 02:56:01 PM
That sounds like a REALLY REALLY REALLY bad idea to run on a free webhost! Run this only on hardware you trust and control!

I suppose if you think the site owner will snoop through your files, then yeah, that could result in someone getting your BFX API key. That's a risk on any hosting platform, though, and I'm not sure it's much worse an idea than hosting on the $2/month plans suggested in this thread.

Of course using your own hardware is best, but if you're looking for a free option and understand the above risks, there is at least one that works.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: jabetizo on July 28, 2015, 04:43:05 PM
That sounds like a REALLY REALLY REALLY bad idea to run on a free webhost! Run this only on hardware you trust and control!

I suppose if you think the site owner will snoop through your files, then yeah, that could result in someone getting your BFX API key. That's a risk on any hosting platform, though, and I'm not sure it's much worse an idea than hosting on the $2/month plans suggested in this thread.

Of course using your own hardware is best, but if you're looking for a free option and understand the above risks, there is at least one that works.

There's not much an attacker could do with your API key anyway, especially if all your funds are in the "deposit" wallet.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: Blawpaw on July 28, 2015, 06:08:57 PM
This looks great!
I would be more than happy to try your bot for some time!
Do you have any special trial period offer for this one?


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: DebitMe on July 28, 2015, 06:44:06 PM
Is the bot able to handle Btc and Ltc lending as well?  Or does it solely work with USD?


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: SebastianJu on July 28, 2015, 07:06:03 PM
Is the bot able to handle Btc and Ltc lending as well?  Or does it solely work with USD?

It only works on USD. I wonder if the bot works fully fine now. I stopped using bitfinex when all the complaints started. Withdraws, wrong orderbooks, wrong swap payments, no answers and so on. It reminded me too much on the beginning of problems on exchanges that afterwards claimed being hacked... or so.

It worked great when i used it and i had a lot of ideas to optimize it but the work-reward is not so high so that i didnt work on it.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: DebitMe on July 28, 2015, 07:17:12 PM
Is the bot able to handle Btc and Ltc lending as well?  Or does it solely work with USD?

It only works on USD. I wonder if the bot works fully fine now. I stopped using bitfinex when all the complaints started. Withdraws, wrong orderbooks, wrong swap payments, no answers and so on. It reminded me too much on the beginning of problems on exchanges that afterwards claimed being hacked... or so.

It worked great when i used it and i had a lot of ideas to optimize it but the work-reward is not so high so that i didnt work on it.

Yea IDK what to think about Bitfinex, I like them and the returns are nice, I would like to see another audit be done.  I guess we will see.

The bot seems neat, I would really like support for Btc and Ltc to make it more, "complete", but I will take what I can get.  Have my brother working on what set up costs would be since I don't own a server.  As of right now, if it really can get about 20% better returns, then the amount I have deposited would about break me even with server costs every month, but only have the money lent out for a couple of days at a time would help liquidity.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: deponzit on July 29, 2015, 04:35:16 PM
Is the bot able to handle Btc and Ltc lending as well?  Or does it solely work with USD?

It only works on USD. I wonder if the bot works fully fine now. I stopped using bitfinex when all the complaints started. Withdraws, wrong orderbooks, wrong swap payments, no answers and so on. It reminded me too much on the beginning of problems on exchanges that afterwards claimed being hacked... or so.

It worked great when i used it and i had a lot of ideas to optimize it but the work-reward is not so high so that i didnt work on it.

Yea IDK what to think about Bitfinex, I like them and the returns are nice, I would like to see another audit be done.  I guess we will see.

The bot seems neat, I would really like support for Btc and Ltc to make it more, "complete", but I will take what I can get.  Have my brother working on what set up costs would be since I don't own a server.  As of right now, if it really can get about 20% better returns, then the amount I have deposited would about break me even with server costs every month, but only have the money lent out for a couple of days at a time would help liquidity.

See my post above about free hosting.

I'm planning on forking this to work with BTC as well, as it doesn't look like it would be too hard to do. I'll post here when it's ready for you all to try out :)


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: SebastianJu on July 31, 2015, 11:07:25 AM
Is the bot able to handle Btc and Ltc lending as well?  Or does it solely work with USD?

It only works on USD. I wonder if the bot works fully fine now. I stopped using bitfinex when all the complaints started. Withdraws, wrong orderbooks, wrong swap payments, no answers and so on. It reminded me too much on the beginning of problems on exchanges that afterwards claimed being hacked... or so.

It worked great when i used it and i had a lot of ideas to optimize it but the work-reward is not so high so that i didnt work on it.

Yea IDK what to think about Bitfinex, I like them and the returns are nice, I would like to see another audit be done.  I guess we will see.

The bot seems neat, I would really like support for Btc and Ltc to make it more, "complete", but I will take what I can get.  Have my brother working on what set up costs would be since I don't own a server.  As of right now, if it really can get about 20% better returns, then the amount I have deposited would about break me even with server costs every month, but only have the money lent out for a couple of days at a time would help liquidity.

See my post above about free hosting.

I'm planning on forking this to work with BTC as well, as it doesn't look like it would be too hard to do. I'll post here when it's ready for you all to try out :)

Yes, it should be fairly easy. I wonder why i didnt get the idea before. ... I think its because the profit from lending btc is much lower than lending usd. And you have the risk of btc price dropping, killing all your profits.

If this would work then you could go short and long on bitcoin and earning money on the way by multiplying the currency you hold at that time.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: deponzit on July 31, 2015, 12:57:00 PM
Is the bot able to handle Btc and Ltc lending as well?  Or does it solely work with USD?

It only works on USD. I wonder if the bot works fully fine now. I stopped using bitfinex when all the complaints started. Withdraws, wrong orderbooks, wrong swap payments, no answers and so on. It reminded me too much on the beginning of problems on exchanges that afterwards claimed being hacked... or so.

It worked great when i used it and i had a lot of ideas to optimize it but the work-reward is not so high so that i didnt work on it.

Yea IDK what to think about Bitfinex, I like them and the returns are nice, I would like to see another audit be done.  I guess we will see.

The bot seems neat, I would really like support for Btc and Ltc to make it more, "complete", but I will take what I can get.  Have my brother working on what set up costs would be since I don't own a server.  As of right now, if it really can get about 20% better returns, then the amount I have deposited would about break me even with server costs every month, but only have the money lent out for a couple of days at a time would help liquidity.

See my post above about free hosting.

I'm planning on forking this to work with BTC as well, as it doesn't look like it would be too hard to do. I'll post here when it's ready for you all to try out :)

Yes, it should be fairly easy. I wonder why i didnt get the idea before. ... I think its because the profit from lending btc is much lower than lending usd. And you have the risk of btc price dropping, killing all your profits.

If this would work then you could go short and long on bitcoin and earning money on the way by multiplying the currency you hold at that time.

I've actually got it working now. I made a setting for currency when creating an account, and it's working fine with USD and BTC. Haven't tried LTC yet, but there's no reason I could see that it wouldn't work. I've got some fixing to do for the graphs and changing of hard coded dollar signs in the admin, but once that's done I'll fork the repo so everyone can use it :)


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: DebitMe on July 31, 2015, 01:48:14 PM
Is the bot able to handle Btc and Ltc lending as well?  Or does it solely work with USD?

It only works on USD. I wonder if the bot works fully fine now. I stopped using bitfinex when all the complaints started. Withdraws, wrong orderbooks, wrong swap payments, no answers and so on. It reminded me too much on the beginning of problems on exchanges that afterwards claimed being hacked... or so.

It worked great when i used it and i had a lot of ideas to optimize it but the work-reward is not so high so that i didnt work on it.

Yea IDK what to think about Bitfinex, I like them and the returns are nice, I would like to see another audit be done.  I guess we will see.

The bot seems neat, I would really like support for Btc and Ltc to make it more, "complete", but I will take what I can get.  Have my brother working on what set up costs would be since I don't own a server.  As of right now, if it really can get about 20% better returns, then the amount I have deposited would about break me even with server costs every month, but only have the money lent out for a couple of days at a time would help liquidity.

See my post above about free hosting.

I'm planning on forking this to work with BTC as well, as it doesn't look like it would be too hard to do. I'll post here when it's ready for you all to try out :)

Yes, it should be fairly easy. I wonder why i didnt get the idea before. ... I think its because the profit from lending btc is much lower than lending usd. And you have the risk of btc price dropping, killing all your profits.

If this would work then you could go short and long on bitcoin and earning money on the way by multiplying the currency you hold at that time.

Yea it does stink that the profit from bitcoin is so low.  It just seems that there are too many people who are interested in lending their bitcoin and not enough people interested in trading with it.  Really drives the interest rate down.

Still though, I have tried just setting my btc to the FRR, but they never get taken out.  So, I still have to trust Bitfinex with my coins, and I am getting nothing in return.  This would at least get some minimal return.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: SebastianJu on July 31, 2015, 11:37:21 PM
Is the bot able to handle Btc and Ltc lending as well?  Or does it solely work with USD?

It only works on USD. I wonder if the bot works fully fine now. I stopped using bitfinex when all the complaints started. Withdraws, wrong orderbooks, wrong swap payments, no answers and so on. It reminded me too much on the beginning of problems on exchanges that afterwards claimed being hacked... or so.

It worked great when i used it and i had a lot of ideas to optimize it but the work-reward is not so high so that i didnt work on it.

Yea IDK what to think about Bitfinex, I like them and the returns are nice, I would like to see another audit be done.  I guess we will see.

The bot seems neat, I would really like support for Btc and Ltc to make it more, "complete", but I will take what I can get.  Have my brother working on what set up costs would be since I don't own a server.  As of right now, if it really can get about 20% better returns, then the amount I have deposited would about break me even with server costs every month, but only have the money lent out for a couple of days at a time would help liquidity.

See my post above about free hosting.

I'm planning on forking this to work with BTC as well, as it doesn't look like it would be too hard to do. I'll post here when it's ready for you all to try out :)

Yes, it should be fairly easy. I wonder why i didnt get the idea before. ... I think its because the profit from lending btc is much lower than lending usd. And you have the risk of btc price dropping, killing all your profits.

If this would work then you could go short and long on bitcoin and earning money on the way by multiplying the currency you hold at that time.

Yea it does stink that the profit from bitcoin is so low.  It just seems that there are too many people who are interested in lending their bitcoin and not enough people interested in trading with it.  Really drives the interest rate down.

Still though, I have tried just setting my btc to the FRR, but they never get taken out.  So, I still have to trust Bitfinex with my coins, and I am getting nothing in return.  This would at least get some minimal return.

Yes, FRR is not a good solution to choose. You really should try out the marginbot if you didnt already. It really makes a great job and will let your money be lent out constantly with low downtime. And that downtime is only to get the best rates.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: DebitMe on July 31, 2015, 11:40:19 PM
Is the bot able to handle Btc and Ltc lending as well?  Or does it solely work with USD?

It only works on USD. I wonder if the bot works fully fine now. I stopped using bitfinex when all the complaints started. Withdraws, wrong orderbooks, wrong swap payments, no answers and so on. It reminded me too much on the beginning of problems on exchanges that afterwards claimed being hacked... or so.

It worked great when i used it and i had a lot of ideas to optimize it but the work-reward is not so high so that i didnt work on it.

Yea IDK what to think about Bitfinex, I like them and the returns are nice, I would like to see another audit be done.  I guess we will see.

The bot seems neat, I would really like support for Btc and Ltc to make it more, "complete", but I will take what I can get.  Have my brother working on what set up costs would be since I don't own a server.  As of right now, if it really can get about 20% better returns, then the amount I have deposited would about break me even with server costs every month, but only have the money lent out for a couple of days at a time would help liquidity.

See my post above about free hosting.

I'm planning on forking this to work with BTC as well, as it doesn't look like it would be too hard to do. I'll post here when it's ready for you all to try out :)

Yes, it should be fairly easy. I wonder why i didnt get the idea before. ... I think its because the profit from lending btc is much lower than lending usd. And you have the risk of btc price dropping, killing all your profits.

If this would work then you could go short and long on bitcoin and earning money on the way by multiplying the currency you hold at that time.

Yea it does stink that the profit from bitcoin is so low.  It just seems that there are too many people who are interested in lending their bitcoin and not enough people interested in trading with it.  Really drives the interest rate down.

Still though, I have tried just setting my btc to the FRR, but they never get taken out.  So, I still have to trust Bitfinex with my coins, and I am getting nothing in return.  This would at least get some minimal return.

Yes, FRR is not a good solution to choose. You really should try out the marginbot if you didnt already. It really makes a great job and will let your money be lent out constantly with low downtime. And that downtime is only to get the best rates.
Yea agreed, if I had more time I would do it myself, its just easier to leave it on auto lend.  I have my brother looking into getting it set up on a server for me.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: SebastianJu on August 01, 2015, 01:50:40 PM
Is the bot able to handle Btc and Ltc lending as well?  Or does it solely work with USD?

It only works on USD. I wonder if the bot works fully fine now. I stopped using bitfinex when all the complaints started. Withdraws, wrong orderbooks, wrong swap payments, no answers and so on. It reminded me too much on the beginning of problems on exchanges that afterwards claimed being hacked... or so.

It worked great when i used it and i had a lot of ideas to optimize it but the work-reward is not so high so that i didnt work on it.

Yea IDK what to think about Bitfinex, I like them and the returns are nice, I would like to see another audit be done.  I guess we will see.

The bot seems neat, I would really like support for Btc and Ltc to make it more, "complete", but I will take what I can get.  Have my brother working on what set up costs would be since I don't own a server.  As of right now, if it really can get about 20% better returns, then the amount I have deposited would about break me even with server costs every month, but only have the money lent out for a couple of days at a time would help liquidity.

See my post above about free hosting.

I'm planning on forking this to work with BTC as well, as it doesn't look like it would be too hard to do. I'll post here when it's ready for you all to try out :)

Yes, it should be fairly easy. I wonder why i didnt get the idea before. ... I think its because the profit from lending btc is much lower than lending usd. And you have the risk of btc price dropping, killing all your profits.

If this would work then you could go short and long on bitcoin and earning money on the way by multiplying the currency you hold at that time.

Yea it does stink that the profit from bitcoin is so low.  It just seems that there are too many people who are interested in lending their bitcoin and not enough people interested in trading with it.  Really drives the interest rate down.

Still though, I have tried just setting my btc to the FRR, but they never get taken out.  So, I still have to trust Bitfinex with my coins, and I am getting nothing in return.  This would at least get some minimal return.

Yes, FRR is not a good solution to choose. You really should try out the marginbot if you didnt already. It really makes a great job and will let your money be lent out constantly with low downtime. And that downtime is only to get the best rates.
Yea agreed, if I had more time I would do it myself, its just easier to leave it on auto lend.  I have my brother looking into getting it set up on a server for me.

Its pretty easy to set up. Yeah... let your brother work for you... you dont want him to get lazy. :P

If youre lucky you will get USD lending soon too. If someone revels the code.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: deponzit on August 01, 2015, 08:30:44 PM
As promised, here is my fork, which works with USD, BTC, and (untested) LTC.

https://github.com/deponzit/MarginBot

Major changes:
Add BTC/LTC support
Improve compatibility with older PHP versions
Improve responsiveness
Increased lend amount accuracy
Fix undercutting
Minor bug fixes
UI tweaks

You'll need to do a reinstall, as it's not compatible with the old version (new DB fields and column name changes). Maybe next version will be backwards compatible, but this one is not.

Screenshots

https://i.imgur.com/KjHRQyU.png

https://i.imgur.com/Ao5IPup.png


EDIT: I haven't really tested the install process, so if you run into any bugs let me know and I'll fix them.

EDIT 2: If you appreciate my work, you can send a few bitcents my way :) 1rq1YCXFemXAWyfUHpZo8fYinWor9eVst


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: Blawpaw on August 02, 2015, 02:39:30 PM
A lending bot seems like a good idea to me :) I will probably try this one out!
Are you planning to add trading bit features to your bot as well?


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: SebastianJu on August 05, 2015, 07:59:32 PM
As promised, here is my fork, which works with USD, BTC, and (untested) LTC.

https://github.com/deponzit/MarginBot

Major changes:
Add BTC/LTC support
Improve compatibility with older PHP versions
Improve responsiveness
Increased lend amount accuracy
Fix undercutting
Minor bug fixes
UI tweaks

You'll need to do a reinstall, as it's not compatible with the old version (new DB fields and column name changes). Maybe next version will be backwards compatible, but this one is not.

Screenshots

https://i.imgur.com/KjHRQyU.png

https://i.imgur.com/Ao5IPup.png


EDIT: I haven't really tested the install process, so if you run into any bugs let me know and I'll fix them.

EDIT 2: If you appreciate my work, you can send a few bitcents my way :) 1rq1YCXFemXAWyfUHpZo8fYinWor9eVst

Thank you for the work. It looks good. If i ever trust bitfinex enough again to upload something of value i will make sure to use your version. :)


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: deponzit on August 06, 2015, 03:50:07 PM
I've updated my fork to ignore the FRR offers on the offerbook. This will let it place offers above the FRR, as FRR offers are bypassed for fixed-rate loans. Result of this should mean taking advantage of higher loan rates when rates are climbing above the FRR.

Latest version can always be found at:
https://github.com/deponzit/MarginBot


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: DebitMe on August 08, 2015, 05:23:18 PM
I've updated my fork to ignore the FRR offers on the offerbook. This will let it place offers above the FRR, as FRR offers are bypassed for fixed-rate loans. Result of this should mean taking advantage of higher loan rates when rates are climbing above the FRR.

Latest version can always be found at:
https://github.com/deponzit/MarginBot


Please note, I mean no disrespect and I could be completely off the mark here but, has anyone checked this code to make sure it isn't malicious?  Or is there really anything that could be stolen by only knowing my API code?


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: deponzit on August 09, 2015, 09:46:36 PM
I've updated my fork to ignore the FRR offers on the offerbook. This will let it place offers above the FRR, as FRR offers are bypassed for fixed-rate loans. Result of this should mean taking advantage of higher loan rates when rates are climbing above the FRR.

Latest version can always be found at:
https://github.com/deponzit/MarginBot


Please note, I mean no disrespect and I could be completely off the mark here but, has anyone checked this code to make sure it isn't malicious?  Or is there really anything that could be stolen by only knowing my API code?

No disrespect taken, and thanks for the interest. That link goes straight to the source code, so feel free to scope it out yourself. The core of it is unchanged from the original version. If someone got ahold of your API keys, they could potentially make some bad trades, but they can't withdraw any of your funds. You can read about Bitfinex's API here: https://www.bitfinex.com/pages/api. I still keep my bot behind a password protected folder on my web server, though it's probably not necessary. If you decide to do the same I've included some code in the crons folder to get your cronjobs to authenticate.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: DebitMe on August 10, 2015, 02:37:52 AM
I've updated my fork to ignore the FRR offers on the offerbook. This will let it place offers above the FRR, as FRR offers are bypassed for fixed-rate loans. Result of this should mean taking advantage of higher loan rates when rates are climbing above the FRR.

Latest version can always be found at:
https://github.com/deponzit/MarginBot


Please note, I mean no disrespect and I could be completely off the mark here but, has anyone checked this code to make sure it isn't malicious?  Or is there really anything that could be stolen by only knowing my API code?

No disrespect taken, and thanks for the interest. That link goes straight to the source code, so feel free to scope it out yourself. The core of it is unchanged from the original version. If someone got ahold of your API keys, they could potentially make some bad trades, but they can't withdraw any of your funds. You can read about Bitfinex's API here: https://www.bitfinex.com/pages/api. I still keep my bot behind a password protected folder on my web server, though it's probably not necessary. If you decide to do the same I've included some code in the crons folder to get your cronjobs to authenticate.

I appreciate your reply, goes a long way to instilling confidence.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: deponzit on August 11, 2015, 04:55:00 PM
It seems that when using 000webhost.com, the cronjobs are not exactly reliable. Not a big surprise for a free webhost. To counter this, I've pushed some changes that will allow you to run the cronjobs every 5 mins if you so choose. The bot will only run on accounts that were missed last attempt, so it still won't run more than once every 10 mins on any account.

Updating is only necessary if you've been seeing the 10 minute cronjob skipping any users that it shouldn't be. You can check this by looking at your CronRuns table.

Latest version can always be found at:
https://github.com/deponzit/MarginBot


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: bitcoinmasterlord on August 18, 2015, 04:20:27 PM
It seems that when using 000webhost.com, the cronjobs are not exactly reliable. Not a big surprise for a free webhost. To counter this, I've pushed some changes that will allow you to run the cronjobs every 5 mins if you so choose. The bot will only run on accounts that were missed last attempt, so it still won't run more than once every 10 mins on any account.

Updating is only necessary if you've been seeing the 10 minute cronjob skipping any users that it shouldn't be. You can check this by looking at your CronRuns table.

Latest version can always be found at:
https://github.com/deponzit/MarginBot

000webhost.com, so you are using a free webhost? Oo I really don't think that is a good idea except you only have playmoney you use on bitfinex.

If your money is withdrawn then who was it? A hacker, an employee of simply someone on the same server who could access your webhosting with a simple trick?

Sounds way too risky for reasonable amounts.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: deponzit on August 18, 2015, 06:59:39 PM
It seems that when using 000webhost.com, the cronjobs are not exactly reliable. Not a big surprise for a free webhost. To counter this, I've pushed some changes that will allow you to run the cronjobs every 5 mins if you so choose. The bot will only run on accounts that were missed last attempt, so it still won't run more than once every 10 mins on any account.

Updating is only necessary if you've been seeing the 10 minute cronjob skipping any users that it shouldn't be. You can check this by looking at your CronRuns table.

Latest version can always be found at:
https://github.com/deponzit/MarginBot

000webhost.com, so you are using a free webhost? Oo I really don't think that is a good idea except you only have playmoney you use on bitfinex.

If your money is withdrawn then who was it? A hacker, an employee of simply someone on the same server who could access your webhosting with a simple trick?

Sounds way too risky for reasonable amounts.

I wanted to get it working on a free host. I am no longer using them. Regardless, if a hacker/employee/whatever snooped on my files, the worst they could do using the API is lend my money out at low rates. The API does not allow withdrawals, or even transferring balances between wallets (https://www.bitfinex.com/pages/api).


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: DebitMe on August 19, 2015, 01:31:13 AM
Getting this error...
Warning: json_encode() expects exactly 1 parameter, 2 given in /home/a7180419/public_html/MarginBot/inc/ExchangeAPIs/bitfinex.php on line 98
on step 2 of the install.  Any ideas whats going on?


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: deponzit on August 20, 2015, 07:35:44 PM
Getting this error...
Warning: json_encode() expects exactly 1 parameter, 2 given in /home/a7180419/public_html/MarginBot/inc/ExchangeAPIs/bitfinex.php on line 98
on step 2 of the install.  Any ideas whats going on?

It's fixed in my version ;)
But if you want to fix it yourself, here's how:

Change the code "json_encode($req, true)" to "json_encode($req)" - This appears twice in bitfinex.php
And/or turn error reporting down, by replacing "error_reporting(E_ALL & ~E_NOTICE);" at the top of index.php with "error_reporting(E_ERROR);"

Explanation:
json_encode was changed to accept a second parameter in PHP 5.3, so you're likely using a version of PHP older than that which only supports the one. Editing out the "true" here won't break anything. The parameter is actually wrong, anyway, as that is supposed to be an integer.

As for the error reporting, unfortunately the original code actually has quite a few warnings and notices, so the change I listed will only stop execution on actual errors.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: PRab on August 29, 2015, 10:46:55 PM
Glanced at deponzit's code (diff) and didn't see any glaringly evil so I'm running that code now. Please don't consider this a full audit or anything. Overall it appears to be working, but it is a bit odd that you need multiple accounts to setup lending multiple currencies. Not a big deal, but a bit unintuitive.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: statdude on September 03, 2015, 06:39:44 PM
Anything like this for Poloniex?


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF on September 10, 2015, 05:13:12 PM
Wow, I go away a couple weeks and my old bot goes crazy...  ::)

Anyways, thanks deponzit for all the updates and tweaks.  A lot of these things are stuff I had been planning to work on, and in fact have in my private install, but never got around to rolling back into the core code.

I took a look at all the diffs in your branch and can vouch for anyone curious, he's not doing anything malicious, so his code is certainly safe to use.

I will mention, running on older versions of PHP is a BAD idea.  There are numerous reasons this is so, but for simplicity sake lets just say if you are running code that manages actual finances on anything older than PHP 5.3, just.... don't.  Upgrade... its easy, and its worth it.

I would also mention that I actually originally had BTC and LTC working in marginbot, but I removed them a while ago, when doing an update.  The reasons are described better in a discussion earlier in this post ( as well as here: https://bitcointalk.org/index.php?topic=229438.msg9739115#msg9739115 ), but basically, it wasn't worth my time to build the UI because the return rates on BTC /LTC are so terribly low in general that you would do better to cash them out and put the money in a low interest savings account.  The only reasonable way to lend on bitfinex is in USD (unless you really still believe BTC To the moon!!1 ┗(°0°)┛ o    ) .  Of course with USD rates dipping below .02, I guess the argument could be made there now too....


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: DebitMe on September 10, 2015, 05:54:00 PM
Thanks for vouching for his copy, I hadn't tried it yet because I was nervous.  I just don't like risking these things.  I had tried to use the free webhosting from 000webhost like he had mentioned earlier, but it seems like it didn't have the correct version of PHP or something?  IDK what was going on.

Can you recommend a host to run this on?  Are you planning to add some of the features that deponzit made into your original bot?


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF on September 10, 2015, 06:30:09 PM
I imagine the free webhost was probably running an older version of PHP that was causing the errors.  I generally don't worry about writing code to support anything before 5.3 anymore because of security issues with older versions.  I know I've helped a couple of people set up accounts on Godaddy that work fine.  Not my favorite host in the world, but I can confirm they do work.

As for updating my version of the bot, I may do it at some point in the future, but I don't have any time right now unfortunately.  If you're interested in lending BTC/LTC, I'd just use deponzits version at this point.  If I make any future updates to my version, I'll probably try to merge his updates back into mine, or somehow work to make them compatible.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: Investacoin on October 20, 2015, 06:36:03 PM
If you are looking for a BitFinex margin lending bot, you should  consider BFX Swapmaster. http://www.bfxswapmaster.com (http://www.bfxswapmaster.com)
It's a windows application that runs in a background, supports all currencies and several strategies. More strategies will be added soon.
There is a free version to play with.
Disclaimer: I'm a developer


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: Sukrim on October 20, 2015, 10:10:22 PM
Yeah, closed source, paid subscription model and Windows only (do you expect me to run a Windows machine 24/7 for this?!) - also advertising in threads of other projects! >:(

I think I'll pass on that...


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: SebastianJu on October 20, 2015, 10:35:23 PM
Yeah, closed source, paid subscription model and Windows only (do you expect me to run a Windows machine 24/7 for this?!) - also advertising in threads of other projects! >:(

I think I'll pass on that...

Are you sure you mean this bot here? This bot is free, open source, since php, and it can be run on any machine that can run a webhosting software.

And advertising makes no sense either.

You sure that you don't mix something?


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: Investacoin on October 20, 2015, 10:49:51 PM
Sebastian, I guess Sucrim was answering me.
Yes, I'm a developer of closed source, paid product for Windows. I thought that readers of this thread should be aware of this product, that's why I posted in this thread, too.
Sorry if that's disturbing :)
There are many people running Windows machine 24/7.
In any case, if you are comfortable with Windows, you are welcome to try the bot - should take couple of minutes to install and configure.
[no more advertising here, I promise:)]


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: SebastianJu on October 20, 2015, 10:54:52 PM
Sebastian, I guess Sucrim was answering me.
Yes, I'm a developer of closed source, paid product for Windows. I thought that readers of this thread should be aware of this product, that's why I posted in this thread, too.
Sorry if that's disturbing :)
There are many people running Windows machine 24/7.
In any case, if you are comfortable with Windows, you are welcome to try the bot - should take couple of minutes to install and configure.
[no more advertising here, I promise:)]

Ah ok. Misunderstanding then. Though i somehow doubt that someone will pay for something that he can get for free too. Without the risk of hidden code that might steal funds or infect the computer. You know what i mean...


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: chadwickx16 on November 05, 2015, 03:50:56 PM
I'm having issues setting up my crontabs. I've tried what the dashboard has suggested and the method my host recommends, but still not running. Can you provide any advice on how they should be coded?


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: SebastianJu on November 05, 2015, 05:56:02 PM
I'm having issues setting up my crontabs. I've tried what the dashboard has suggested and the method my host recommends, but still not running. Can you provide any advice on how they should be coded?

If you don't manage to set it up on your hosting then there are free cron job websites on the internet. They simply request the url(s) you specify in the timeframes you specify. Works like normal cron jobs.

I'm not sure if this would mean any privacy issues since they know your url.

Only a headsup.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: chadwickx16 on November 05, 2015, 06:02:55 PM
Thanks! After fiddling with it this morning, I discovered that I am getting an error in the database.php file.
Code:
Cannot instantiate non-existent class:  mysqli 


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: LMGTFY on November 13, 2015, 09:10:27 AM
Thanks! After fiddling with it this morning, I discovered that I am getting an error in the database.php file.
Code:
Cannot instantiate non-existent class:  mysqli 

I'm not anywhere near a development box to test this, so it's possible this is a red herring, but...

There's a compile-time flag for mysqli - PHP needs to be compiled with the flag set. It's also version-dependent (http://php.net/manual/en/mysqli.requirements.php). My first assumption would be that the version of PHP you're running against doesn't have mysqli enabled (if you're running this on a hosted server your host's sys admin may be able to solve this for you. If you're running it on your own server it'll be very much OS-specific, but I might be able to help).


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: chadwickx16 on November 26, 2015, 03:48:18 AM
Thanks! After fiddling with it this morning, I discovered that I am getting an error in the database.php file.
Code:
Cannot instantiate non-existent class:  mysqli 

I'm not anywhere near a development box to test this, so it's possible this is a red herring, but...

There's a compile-time flag for mysqli - PHP needs to be compiled with the flag set. It's also version-dependent (http://php.net/manual/en/mysqli.requirements.php). My first assumption would be that the version of PHP you're running against doesn't have mysqli enabled (if you're running this on a hosted server your host's sys admin may be able to solve this for you. If you're running it on your own server it'll be very much OS-specific, but I might be able to help).

Thanks, I was with a host that didn't support mysqli. I ended up putting it on Pi LAMP server, all is working fine. With the exception of the Swap rates....  :-\


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF on December 19, 2015, 09:03:50 PM
Just a quick update for everyone:

If you are having issues with MarginBot updating your daily returns, its because of change bitfinex made to their API a while ago.  Just change the following and it should start working again:

/inc/ExchangeAPIs/bitfinex.php
LINE 148:
if($l['description'] == 'Swap Payment on wallet deposit'){

change to:
if(strtolower($l['description']) == strtolower('Swap Payment on wallet deposit') || strtolower($l['description'])==strtolower('Margin Funding Payment on wallet Deposit') ){

Should start updating your daily returns again.



Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: striker7334 2.0 on January 01, 2016, 06:53:19 PM
Interesting Project, glad to see its still an active thread and still alive. I'll try it out and send a donation your way if I end up using it!  ;D


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: jonte on January 08, 2016, 12:52:12 PM
I'm getting a 500 server error when I try to install it. Hmm

Edit: Nevermind, I didn't have cURL installed hahahaha! I've set the bot up and it looks good so far. Only issue in when I try to load the "View Overall Returns" page it never loads for me. I'll look into it later.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: junglist.massive on January 26, 2016, 10:11:56 PM
any chance to make it work on poloniex?


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: superresistant on January 27, 2016, 12:46:03 PM
 
I am new to Margin Lending Bots, are the users satisfied of MarginBot or is there a better/well-known alternative ?

EDIT After some research I only found those alternatives :
cascadebot: A simple (but effective) lending bot for Bitfinex
https://bitcointalk.org/index.php?topic=867103
[ANN] BitfinexLendingBot - A bot for automated lending at Bitfinex
https://bitcointalk.org/index.php?topic=938362.0
BFX Swapmaster - BitFinex lending automation
https://bitcointalk.org/index.php?topic=1207664.0

But it either looks scammy or dead.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: PesiiHUN on January 27, 2016, 09:06:38 PM

I am new to Margin Lending Bots, are the users satisfied of MarginBot or is there a better/well-known alternative ?

EDIT After some research I only found those alternatives :
cascadebot: A simple (but effective) lending bot for Bitfinex
https://bitcointalk.org/index.php?topic=867103
[ANN] BitfinexLendingBot - A bot for automated lending at Bitfinex
https://bitcointalk.org/index.php?topic=938362.0
BFX Swapmaster - BitFinex lending automation
https://bitcointalk.org/index.php?topic=1207664.0

But it either looks scammy or dead.

do you use any of them and btw this margin bot is do the same as autorenew option at bitfinex?


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: SebastianJu on January 27, 2016, 11:50:22 PM

I am new to Margin Lending Bots, are the users satisfied of MarginBot or is there a better/well-known alternative ?

EDIT After some research I only found those alternatives :
cascadebot: A simple (but effective) lending bot for Bitfinex
https://bitcointalk.org/index.php?topic=867103
[ANN] BitfinexLendingBot - A bot for automated lending at Bitfinex
https://bitcointalk.org/index.php?topic=938362.0
BFX Swapmaster - BitFinex lending automation
https://bitcointalk.org/index.php?topic=1207664.0

But it either looks scammy or dead.

do you use any of them and btw this margin bot is do the same as autorenew option at bitfinex?

It's not the same as autorenew. With autorenew you might wait a long time until your order gets taken. But margin bot sets your offers so that they are always at places where they will be taken fast and where they will bring the most profit most probably. Try it, it's a nice tool.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: Jope on January 31, 2016, 01:25:47 AM
Hi all, just want to say that it's awesome that this thread it still alive and a big THANK YOU to HowardF and deponzit for your efforts.
After only just learning about margin funding last week I got this up and running in a day. After some cron issues on asmallorange, it's running fantastically for my purposes.  :D

I actually couldn't get the crons to run on the asmallorange cron tool, and sadly they expressly do not offer support for cron jobs.  If anyone is familliar with A Small Orange and how to properly syntax a cron job there I'd love to hear more.  Currently I'm using CronBlaster as EasyCron won't run 2 cron jobs with their free account.

Thanks again!


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: hexital on February 15, 2016, 11:06:56 PM
Another thanks to the developers! I'm running this on a Ubuntu virtual machine running apache2 and php5. Took a bit of messing around to get it to work but now it's running smoothly.

Anyone interested in a tutorial for setting this up?


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: DebitMe on February 16, 2016, 03:48:27 AM
Another thanks to the developers! I'm running this on a Ubuntu virtual machine running apache2 and php5. Took a bit of messing around to get it to work but now it's running smoothly.

Anyone interested in a tutorial for setting this up?

a tutorial would have definitely been helpful. I messed around with it for a while and finally gave up. 


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: crazyivan on February 16, 2016, 07:21:55 AM
Does this still work? I see the last update is from 2014, is the bot still operational?


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: chadwickx16 on February 16, 2016, 03:49:54 PM
Does this still work? I see the last update is from 2014, is the bot still operational?
Yeah, it great. Using it now. Compiled mine in November.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: CB_project on February 17, 2016, 04:24:36 PM
Bot still work?


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: Barnabe on February 17, 2016, 07:02:08 PM
What kind of return could I expect from it ?
Is it really worth to use it compared to bitfinex platform only ?


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: InceptionCoin on February 17, 2016, 08:02:39 PM
What kind of return could I expect from it ?
Is it really worth to use it compared to bitfinex platform only ?
I don't know how about BitFinex, but i'm using self-written bot for Poloniex and it is 1.5-5x more profitable. But on poloniex loan rate can change between 0.03% and 0.25%, so automatic system is much more critical.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: Antek on April 20, 2016, 12:04:46 PM
Hi there,

I just want to say thank you to HowardF for this nice piece of software. I am running the bot for several days now and it works fine.

@HowardF: Do you plan to get back to the development of MarginBot, for example to add more features?

Kind regards from Germany
Andreas


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: Antek on April 20, 2016, 02:19:42 PM
What kind of return could I expect from it ?
Is it really worth to use it compared to bitfinex platform only ?
I don't know how about BitFinex, but i'm using self-written bot for Poloniex and it is 1.5-5x more profitable. But on poloniex loan rate can change between 0.03% and 0.25%, so automatic system is much more critical.

Would you mind to share some information about your Lending Bot?

Regards
Andreas


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: jabetizo on May 18, 2016, 02:28:15 PM
Is there any bot that supports ETH?


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: dehhh on May 30, 2016, 07:31:24 AM
Awesome project, I was looking exactly for this! Thanks a lot for creating it!

I have no experience with php, nor setting up a server for this purpose. Can someone give me a quick help installing marginbot?
I saw some people mentioning 000webhost.com. I tried it but got stuck, couldn't figure out how to upload files and setup what I needed (kept getting an ftp error). If you have other suggestions of low-cost web servers to host it, I'm also up for it.

Best,
Andre


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: crazyivan on May 30, 2016, 01:04:29 PM
Is this Bitfinex lending profitable at all anymore? I see Polo,which s offered higher lending rates in the last 6 months, hasnt been profitable anymore.

So, is there any point using this?


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: dehhh on May 30, 2016, 04:39:24 PM
Is this Bitfinex lending profitable at all anymore? I see Polo,which s offered higher lending rates in the last 6 months, hasnt been profitable anymore.

So, is there any point using this?

When you say profitable, what exactly do you mean?

I ask that because if you plan to only lend USD, I don't see many ways in which you lose money in this investment (except for credit risk and failure to repay the loan by the exchange). On top of that, lending rates are higher than a lot of other fixed-rate investments in USD.

So as long as you're comfortable with the credit risk, I believe it is still worth it.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: anyone22 on June 18, 2016, 12:36:53 AM
Good job HowardF, thanks for this amazing tool.

However, I'm having some difficulties, so if anyone can help, I would appreciate.

I was able to make the bot work for a couple of days. (Running on a VM) Earlier today, I had to shutdown all my systems for some maintenance. Now when I turn everything on back again, (the VM included, of course)  I can't connect to the web interface anymore, it show me like it were down.

I'm not sure if I should run a script to make it work, or start a service. I'm using Ubuntu 14.04, apache and mysql are running ok, all the cron jobs were running too.

I'm pretty sure that is something very obvious, or basic. The problem is that everything I know from I.T, I learned from curiosity, never had any formal lesson. So my knowledge on Linux/Apache/Mysql is very limited.

Thank you for the attention.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: Sukrim on June 18, 2016, 10:44:20 AM
Since you were already able to make it work once, just start with a fresh VM and from scratch, if it is only a hobby project?

A possible issue could be that the clock in your VM is off, read up on "NTP" how to fix that.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: anyone22 on June 19, 2016, 07:09:04 PM
Since you were already able to make it work once, just start with a fresh VM and from scratch, if it is only a hobby project?

A possible issue could be that the clock in your VM is off, read up on "NTP" how to fix that.
I could start a fresh VM, but then I would have to do that everytime I shutdown the system, assuming that's not how it supposed to work.

I didn't checked the clock yet, will do it tomorrow and return here. However I don't think that is the issue. I just checked my account and the bot is continously lending funds, if the BOT is doing his job the only problem is the web interface which doesn't work after the shutdown. Considering that no changes were made into the system, and it worked the first time, I'm still assuming that a service should be running, but it didn't autostart in boot.

Thank you for the attention.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: aidan258 on July 23, 2016, 12:09:37 AM
I have been trying to set this up and its been having some issues. Does anyone know if this is still working/updated?

If not does anyone have a good suggestion for an alternative?


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: chadwickx16 on July 23, 2016, 01:02:02 AM
I have been trying to set this up and its been having some issues. Does anyone know if this is still working/updated?

If not does anyone have a good suggestion for an alternative?

Should still be working, although I had issues setting it up on a website initially. So I just set it up on a RasbPi LAMP server I had laying around.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: aidan258 on July 23, 2016, 07:37:58 AM
I have been trying to set this up and its been having some issues. Does anyone know if this is still working/updated?

If not does anyone have a good suggestion for an alternative?

Should still be working, although I had issues setting it up on a website initially. So I just set it up on a RasbPi LAMP server I had laying around.

Hey,

Since you mentioned that the Margin Bot is still working I was wondering if you had any advice for me. I have tried installing the bot twice first on a Centos Vps and then again on shared hosting through godaddy. Both times I made sure short tags were enabled and that the server/shared hosting had php 5.3+ and I double checked that curl was enabled and working. + I made sure to 777 chmod the config file.

I would then run into the same problem on both setups. After the second page of the install where you click something like "finish install" I would click it and it would basically just refresh the page and stay on the second page of the install process.

After that I would go to the index and try to login and my login would not work. So I checked the mysql db and the tables were created for users ect... but they were left completely blank leading me to believe there is some kind of problem with the connection to the mysql database.

If you have any advice or suggestions it would be greatly appreciated I have been trying to fix this for two days now.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: aidan258 on July 24, 2016, 01:00:39 AM
So I finally managed to get the install.php to run correctly.

However I am now having issues with the bot itself.

http://puu.sh/qccTS/31f7c4f2a8.png

It is displaying that I have $0 available balance, and Deposit even though there are available funds.



If I manually place an offer to lend out

http://puu.sh/qcd6D/888db76a26.png

It will show up in the loans pending. But the second the cron job runs it will cancel the offer. And just put all the funds back into available without putting in anymore offers to lend the funds out.


Has anyone else had this problem? Or have any suggestions how to fix it?


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: chadwickx16 on July 24, 2016, 01:04:52 AM
So I finally managed to get the install.php to run correctly.

However I am now having issues with the bot itself.

http://puu.sh/qccTS/31f7c4f2a8.png

It is displaying that I have $0 available balance, and Deposit even though there are available funds.



If I manually place an offer to lend out

http://puu.sh/qcd6D/888db76a26.png

It will show up in the loans pending. But the second the cron job runs it will cancel the offer. And just put all the funds back into available.


Has anyone else had this problem? Or have any suggestions how to fix it?

Glad you got it working! Does your API code have the correct API authorizations for the bot? That's really all I can think of...


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: aidan258 on July 24, 2016, 01:08:37 AM
So I finally managed to get the install.php to run correctly.

However I am now having issues with the bot itself.

http://puu.sh/qccTS/31f7c4f2a8.png

It is displaying that I have $0 available balance, and Deposit even though there are available funds.



If I manually place an offer to lend out

http://puu.sh/qcd6D/888db76a26.png

It will show up in the loans pending. But the second the cron job runs it will cancel the offer. And just put all the funds back into available.


Has anyone else had this problem? Or have any suggestions how to fix it?

Glad you got it working! Does your API code have the correct API authorizations for the bot? That's really all I can think of...

I only gave the api key access to read and write for Margin Funding. Do I need to give it more access?

I wish it was that simple but seeing as it can cancel my offers I would assume that's not the problem.

Which fork/version are you using?


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: chadwickx16 on July 24, 2016, 01:16:35 AM
So I finally managed to get the install.php to run correctly.

However I am now having issues with the bot itself.

http://puu.sh/qccTS/31f7c4f2a8.png

It is displaying that I have $0 available balance, and Deposit even though there are available funds.



If I manually place an offer to lend out

http://puu.sh/qcd6D/888db76a26.png

It will show up in the loans pending. But the second the cron job runs it will cancel the offer. And just put all the funds back into available.


Has anyone else had this problem? Or have any suggestions how to fix it?

Glad you got it working! Does your API code have the correct API authorizations for the bot? That's really all I can think of...

I only gave the api key access to read and write for Margin Funding. Do I need to give it more access?

I wish it was that simple but seeing as it can cancel my offers I would assume that's not the problem.

Which fork/version are you using?
I'm using this one:

https://github.com/deponzit/MarginBot


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: aidan258 on July 24, 2016, 09:00:44 PM
So I finally managed to get the install.php to run correctly.

However I am now having issues with the bot itself.

http://puu.sh/qccTS/31f7c4f2a8.png

It is displaying that I have $0 available balance, and Deposit even though there are available funds.



If I manually place an offer to lend out

http://puu.sh/qcd6D/888db76a26.png

It will show up in the loans pending. But the second the cron job runs it will cancel the offer. And just put all the funds back into available.


Has anyone else had this problem? Or have any suggestions how to fix it?

Glad you got it working! Does your API code have the correct API authorizations for the bot? That's really all I can think of...

I only gave the api key access to read and write for Margin Funding. Do I need to give it more access?

I wish it was that simple but seeing as it can cancel my offers I would assume that's not the problem.

Which fork/version are you using?
I'm using this one:

https://github.com/deponzit/MarginBot

Finally got it working. You were right it was a problem with the API access. To fix it I simply gave it read access to everything, and write access to margin funding only for security purposes. Now it seems to be running well.

The only issue left is that the website still shows me "It appears the hourly cron hasn't been running. The last time it ran was 1:00:03 pm, July 24th, 2016. Check to make sure your cronjob contains a job similar to:  ect..." for both cron jobs. Even though it updates the time and they are 100% running. Whatever that's simply cosmetic.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: kellogsblocks on December 11, 2016, 04:28:03 PM
Hello everyone,

thank you very much for this piece of software. I want to use it, cause I wanna split my lending positions half and half between poloniex and bitfinex. When I get it up and running, expect my earnings from the first month as donation. :)

I think I am just one step away from a proper setup. My cron jobs are scheduled and I executed them manually too. But there is always the message "It appears you have not set up the 10 minute cron, or it hasn't been running."
The hourly job seems to be fine.

When I run the TenMinuteCron.php directly in a browser I get the following message:
Code:
THERE HAS BEEN A DATABASE ERROR
Please Contact Support If this error persists.
1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'database name.BFXLendBot_CronRuns.lastrun' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
I granted read access for everything and write access for funding to the API. I'm able to set funding offers manually via website. My deposited BTC amount is not much right now, but enough for testing.

Could anyone help me out? Am running Ubuntu 16.04 with the current MySQL, Apache, PHP from sources.

Thank you very much :)


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: kellogsblocks on December 11, 2016, 04:56:00 PM
Okay, solved it. Had to add
Code:
[mysqld]
sql-mode="STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION"
to my.cnf

... but offers are still not made.. :(


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: Jope on January 17, 2017, 04:30:34 AM
Evening gents,
Just wondering, I got an email from Bitfinex today stating that they will be updating their API on Jan 18. I've been running MarginBot for 1 full year now, flawlessly. Will this API update break MarginBot? I'm not very proficient in the ways of the code.

Much thanks for any replies.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: TOMOAKI12345 on January 19, 2017, 08:47:04 AM
cool !


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: Wassupia on January 20, 2017, 01:50:49 AM
Quote
Lifetime Return
How much your Margin Swaps earned in interest over the life of using MarginBot, after fees ( % / Day ) Note that your if your BFX account existed before you began using MarginBot, those returns will not be included here

I there any way I could make it graph older data?
Tbh I"ve been using "bitfinex-auto-lend-master" but I'd like to see some graphs.

I installed it today and it shows data from last 10 days, so older data could maybe be graphed too?

EDIT: seems like I should have searched the code before asking.
it probably in here:
MarginBot\inc\ExchangeAPIs\bitfinex.php

   Line 128:    function bitfinex_updateHistory($numDays=10,  $sinceLast=0){
   Line 136:             /* No Entries, Go Back 10 Days */

Only the "All" selection  for graphing works though, in my browser console i get this error:
"Highcharts error #15: www.highcharts.com/errors/15"


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF3 on July 18, 2017, 06:11:42 PM
Hello everyone,

I've been away from this forum and MarginBot for a bit, and am finally available to come back and start working on the project again.  Looks like things were busy here while I was gone!

1. First, let me get this out of the way.  I am HowardF, the original creator of MarginBot.  While I was away from this forum, it apparently got hacked, and they locked down all the accounts and sent out a change password thing.  Well, that change password thing isn't working, I can't request a new password from my old account, and I can't figure out any way around it.  So, I created this new account to use from now on.  If there's any concern whether its really me or not, I'm happy to prove it by changing either the old website at fuckedgox.com or I can make a little change in the Github repo or whatever (just tell me what you guys want, and I'll do it).  Also, if anyone has a better contact for an admin here that could reset the HowardF account for me so I can get back in, that would be awesome as well.  I'd love to get access back to that account, would save some trouble.

2. Why have I been gone for so long?  Basically, I got hired to build some software for a company, and as part of the deal I couldn't really work on any competing crypto based applications.  The company was really cool, and I probably could have gotten around this to work on MarginBot a bit, but honestly it was just easier to focus there at the time.  That project is done now though, and I'm ready to get back into working on MarginBot.  Plus that project gave me a ton of ideas for improvements / new features for MarginBot.

3. What's the future for MarginBot?  Well, in the current environment, MarginBot has been performing exceedingly well, and this seems like a particularly good time to come back to work on it.  Honestly, MarginBot has always been a simple tool, and it always will be.  So to that end, there's not really all that much that needs to be added to the tool.  But there are a ton of small bug fixes, performance improvements, minor features, enhancements, etc. that I would really like to make.  Plus, I've been running MarginBot for more than 3 years now, so I have a LOT of data that I've been able to run things against to see what is working well and what isn't.  Hopefully I'll be able to use some of that information to make some minor tweaks to the overall algorithms I use (while still keeping things simple, it is after all primarily a tool to beat FRR).

4. I have questions, need support, or want something custom.  Get in touch with me at marginbot@fuckedgox.com, or send me a message here.  I'll try to check in a lot more often.  Also, I'm on reddit a lot: https://www.reddit.com/user/FuckedGox/



Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: scox on July 20, 2017, 07:39:05 AM
Amazing OP.
Great to have you back, your project has most definitely passed a few hands since you've been gone.

I can't wait for the next release!


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: Jope on July 21, 2017, 03:46:42 AM
Very happy to see you back HowardF! As a MarginBot user since 2015 I'm extremely excited to see what you have in store for us!

Welcome back!


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: mike4001 on August 04, 2017, 04:47:29 AM
Hi,

Since Bitfinex now supports Bitcoin Cash Lending

Can or will your bot support it?


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF3 on August 15, 2017, 05:24:13 PM
Hi,

Since Bitfinex now supports Bitcoin Cash Lending

Can or will your bot support it?

I am currently working on adding back in Crypto Margin Lending.  I hope to have a new build up in the next day or so with this built in.  It should allow all types of crypto bitfinx supports for margin.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: Rakeau on August 16, 2017, 04:21:53 AM
1. First, let me get this out of the way.  I am HowardF, the original creator of MarginBot.  While I was away from this forum, it apparently got hacked, and they locked down all the accounts and sent out a change password thing.  Well, that change password thing isn't working, I can't request a new password from my old account, and I can't figure out any way around it.  So, I created this new account to use from now on.  If there's any concern whether its really me or not, I'm happy to prove it by changing either the old website at fuckedgox.com or I can make a little change in the Github repo or whatever (just tell me what you guys want, and I'll do it).  Also, if anyone has a better contact for an admin here that could reset the HowardF account for me so I can get back in, that would be awesome as well.  I'd love to get access back to that account, would save some trouble.

Just checking that account, it had made 2 posts in a thread in May of this year. Doesn't seem characteristic. I'd look into that.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF3 on August 17, 2017, 09:09:33 PM
1. First, let me get this out of the way.  I am HowardF, the original creator of MarginBot.  While I was away from this forum, it apparently got hacked, and they locked down all the accounts and sent out a change password thing.  Well, that change password thing isn't working, I can't request a new password from my old account, and I can't figure out any way around it.  So, I created this new account to use from now on.  If there's any concern whether its really me or not, I'm happy to prove it by changing either the old website at fuckedgox.com or I can make a little change in the Github repo or whatever (just tell me what you guys want, and I'll do it).  Also, if anyone has a better contact for an admin here that could reset the HowardF account for me so I can get back in, that would be awesome as well.  I'd love to get access back to that account, would save some trouble.

Just checking that account, it had made 2 posts in a thread in May of this year. Doesn't seem characteristic. I'd look into that.

Yeah, I'd noticed.  Already reported it.  Those 2 posts were not me.  At this point I'm pretty much considering that account gone.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF3 on August 17, 2017, 09:17:28 PM
Ok, its ready!  MarginBot v0.1.07 is now live on github!  Full Crypto Margin lending!  Currently it supports all currencies that Bitfinex supports for margin.

You can get it here:
https://github.com/HFenter/MarginBot


Full install instructions are there, but here's a quick Update instruction:


Update from an older Version

Important - Make sure to backup your existing inc/config.php file FIRST

To update, make a backup of your inc/config.php file, then download the most current version. Unzip the files and overwrite your existing install.

Then overwrite the default config.php file with your backed up version.
Visit the site, and you'll be redirected to an update system.
If you are not correctly redirected, just visit /MarginBot/update.php

If there are any issues feel free to contact me here or via the built in contact email.

(I'm wondering if I should start a new thread on this, since I can't update the original post anymore....  What do you guys think?)



Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: prototype_nsx on August 19, 2017, 05:31:09 AM
Hi,

First time trying to set up this, is it possible to create how to for beginners?

I am stuck at "failed to connect to MYSQL"

Any help would be much appreciated.






Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF3 on August 19, 2017, 05:48:17 PM
Hi,

First time trying to set up this, is it possible to create how to for beginners?

I am stuck at "failed to connect to MYSQL"

Any help would be much appreciated.


Oops, actually it looks like 1.07 broke the installer.  I just uploaded a quick fix that should address the issue.  Just download the newest version, 1.07a and try running it again.  It should correctly redirect you to the installer and allow you to set up the mysql database this time.  Sorry about that.  

*EDIT* If you have any more issues installing just post here and I'll be happy to help however I can.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: prototype_nsx on August 20, 2017, 04:16:16 AM
Thanks for replying but I must be doing something wrong

http://imgur.com/a/Eq4IQ

from console

/var/www/html$ php -f install.php
PHP Notice:  Undefined index: doInstall in /var/www/html/install.php on line 9
PHP Notice:  Undefined index: doInstall in /var/www/html/install.php on line 151
PHP Notice:  Undefined index: SCRIPT_URL in /var/www/html/inc/General.php on line 14
PHP Notice:  Undefined index: SCRIPT_URL in /var/www/html/inc/General.php on line 14
PHP Fatal error:  Uncaught Error: Call to a member function query() on null in /var/www/html/inc/General.php:15
Stack trace:
#0 /var/www/html/install.php(246): General->__construct()
#1 {main}
  thrown in /var/www/html/inc/General.php on line 15



Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF3 on August 20, 2017, 06:05:55 PM
Thanks for replying but I must be doing something wrong

http://imgur.com/a/Eq4IQ

from console

/var/www/html$ php -f install.php
PHP Notice:  Undefined index: doInstall in /var/www/html/install.php on line 9
PHP Notice:  Undefined index: doInstall in /var/www/html/install.php on line 151
PHP Notice:  Undefined index: SCRIPT_URL in /var/www/html/inc/General.php on line 14
PHP Notice:  Undefined index: SCRIPT_URL in /var/www/html/inc/General.php on line 14
PHP Fatal error:  Uncaught Error: Call to a member function query() on null in /var/www/html/inc/General.php:15
Stack trace:
#0 /var/www/html/install.php(246): General->__construct()
#1 {main}
  thrown in /var/www/html/inc/General.php on line 15

2 things:
1. I just uploaded another quick hotfix because I forgot to add something to the installer for the new version.  The hotfix isn't your issue though (but you will want to download it). 

2.  For some reason your server isn't correctly loading $_SERVER['SCRIPT_URL'] (PHP Notice:  Undefined index: SCRIPT_URL in /var/www/html/inc/General.php on line 14).
This is strange.  Never run into that issue before, but I changed it to $_SERVER['PHP_SELF'] which is a little more universal in the latest update.  If that still isn't working for you, I'll need to figure out another way to trap for what script is running.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: prototype_nsx on August 21, 2017, 08:11:57 AM
Downloaded the fix but this time the installer.php prints the script and some error to the console

/var/www/html/MarginBot-master$ php -f install.php

PHP Notice:  Undefined index: doInstall in /var/www/html/MarginBot-master/install.php on line 9

PHP Notice:  Undefined index: doInstall in /var/www/html/MarginBot-master/install.php on line 167

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>


PHP Notice:  Undefined variable: config in /var/www/html/MarginBot-master/inc/General.php on line 536

PHP Notice:  Undefined variable: config in /var/www/html/MarginBot-master/inc/General.php on line 536

PHP Notice:  Undefined variable: config in /var/www/html/MarginBot-master/inc/General.php on line 536

PHP Notice:  Undefined variable: config in /var/www/html/MarginBot-master/inc/General.php on line 541






PHP Notice:  Undefined index: doInstall in /var/www/html/MarginBot-master/install.php on line 334

PHP Notice:  Undefined index: installDBHost in /var/www/html/MarginBot-master/install.php on line 336

PHP Notice:  Undefined index: installDBPrefix in /var/www/html/MarginBot-master/install.php on line 337

PHP Notice:  Undefined index: installDBName in /var/www/html/MarginBot-master/install.php on line 395

PHP Notice:  Undefined index: installDBUser in /var/www/html/MarginBot-master/install.php on line 398

PHP Notice:  Undefined index: installDBPassword in /var/www/html/MarginBot-master/install.php on line 401

PHP Notice:  Undefined index: installEmail in /var/www/html/MarginBot-master/install.php on line 427

Background on my setup, it is a new VM with Ubuntu 16.04 LAMP stack



Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF3 on August 21, 2017, 03:05:39 PM
Downloaded the fix but this time the installer.php prints the script and some error to the console

/var/www/html/MarginBot-master$ php -f install.php

PHP Notice:  Undefined index: doInstall in /var/www/html/MarginBot-master/install.php on line 9

PHP Notice:  Undefined index: doInstall in /var/www/html/MarginBot-master/install.php on line 167

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>


PHP Notice:  Undefined variable: config in /var/www/html/MarginBot-master/inc/General.php on line 536

PHP Notice:  Undefined variable: config in /var/www/html/MarginBot-master/inc/General.php on line 536

PHP Notice:  Undefined variable: config in /var/www/html/MarginBot-master/inc/General.php on line 536

PHP Notice:  Undefined variable: config in /var/www/html/MarginBot-master/inc/General.php on line 541






PHP Notice:  Undefined index: doInstall in /var/www/html/MarginBot-master/install.php on line 334

PHP Notice:  Undefined index: installDBHost in /var/www/html/MarginBot-master/install.php on line 336

PHP Notice:  Undefined index: installDBPrefix in /var/www/html/MarginBot-master/install.php on line 337

PHP Notice:  Undefined index: installDBName in /var/www/html/MarginBot-master/install.php on line 395

PHP Notice:  Undefined index: installDBUser in /var/www/html/MarginBot-master/install.php on line 398

PHP Notice:  Undefined index: installDBPassword in /var/www/html/MarginBot-master/install.php on line 401

PHP Notice:  Undefined index: installEmail in /var/www/html/MarginBot-master/install.php on line 427

Background on my setup, it is a new VM with Ubuntu 16.04 LAMP stack



Do you have error settings particularly high on your php setup?  These are all notices, and shouldn't cause the script to stop executing.  There's no actual errors in this list.

A quick fix would be to add this to the top line of install.php:

error_reporting(E_ALL & ~E_NOTICE);



Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: prototype_nsx on August 22, 2017, 06:21:25 AM
I am not sure, is there anything I can run to check that? could it be related to permission? 

I will be able to test the quick fix in 2 hours also I will create another VM on the side to document the steps of the build and post here for reference


 


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: prototype_nsx on August 22, 2017, 11:08:08 AM
Tired the quickfix, here is the output


@bot:/var/www/html/MarginBot-master$ php -f install.php
error_reporting(E_ALL&~E_NOTICE);
PHP Warning:  session_start(): Cannot send session cookie - headers already sent by (output started at /var/www/html/MarginBot-master/install.php:1) in /var/www/html/MarginBot-master/inc/config.php on line 4
PHP Warning:  session_start(): Cannot send session cache limiter - headers already sent (output started at /var/www/html/MarginBot-master/install.php:1) in /var/www/html/MarginBot-master/inc/config.php on line 4
PHP Notice:  Undefined index: doInstall in /var/www/html/MarginBot-master/install.php on line 10
PHP Notice:  Undefined index: doInstall in /var/www/html/MarginBot-master/install.php on line 168




Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF3 on August 22, 2017, 02:26:22 PM
Tired the quickfix, here is the output


@bot:/var/www/html/MarginBot-master$ php -f install.php
error_reporting(E_ALL&~E_NOTICE);
PHP Warning:  session_start(): Cannot send session cookie - headers already sent by (output started at /var/www/html/MarginBot-master/install.php:1) in /var/www/html/MarginBot-master/inc/config.php on line 4
PHP Warning:  session_start(): Cannot send session cache limiter - headers already sent (output started at /var/www/html/MarginBot-master/install.php:1) in /var/www/html/MarginBot-master/inc/config.php on line 4
PHP Notice:  Undefined index: doInstall in /var/www/html/MarginBot-master/install.php on line 10
PHP Notice:  Undefined index: doInstall in /var/www/html/MarginBot-master/install.php on line 168

You have been trying to run this from a web browser, not just the terminal, right?  It is a form you'll need to put information into.  Running it from a browser, it should ignore those warnings and notices and show the page without a problem.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: prototype_nsx on August 23, 2017, 08:36:22 AM
Right, when I try to run from the browser the page appears messy like the previous screenshot, i am not sure if you can see that?

http://imgur.com/a/umbny


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF3 on August 25, 2017, 05:27:20 PM
Right, when I try to run from the browser the page appears messy like the previous screenshot, i am not sure if you can see that?

http://imgur.com/a/umbny

Hmm.  something is seriously not right with your server setup.  From that screenshot it looks like its dumping raw code rather than executing it, which shouldn't even be possible, unless its not actually being parsed by PHP.  have you been able to correctly run any other PHP code on the server?


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: BeastOfBodmin on September 03, 2017, 06:15:00 PM
Ok, its ready!  MarginBot v0.1.07 is now live on github!  Full Crypto Margin lending!  Currently it supports all currencies that Bitfinex supports for margin.
For a few weeks now, my marginbot setup has not been picking up account history, nor unused funding, but the cron job runs were being added to the BFXLendBot_CronRuns table.

I spent some time on it yesterday, and didn't get any ideas as to what might be wrong. Not least because my php binary will not execute a .php file.

But the problem shows up as a lack of history on http://.../marginbot/index.php

and a lack of entries in the table BFXLendBot_Tracking. The last entry was 2017-08-19.

So I noticed this morning 1.07b was available on the master branch.

I followed the update instructions, and the following occurred:

A new table BFXLendBot_CurPairs is created, and the 4 existing tables are backed up to copies with the suffix _BACKUP_v17

But I get this error on the screen http://.../marginbot/update.php?doUpdate=2

Quote
THERE HAS BEEN A DATABASE ERROR
Please Contact Support If this error persists.
1264 - Out of range value for column 'dep_balance' at row 7

I am using

5.7.16
MySQL Community Server (GPL)


Poking around the MySQL tables, it seems the table definitions are still the same: decimal(12,2). But I can see some ALTER TABLE statements in update.php, that switch to decimal(12,8).
When I paste the ALTER TABLE for the Tracking table into MySQLWorkbench it thinks there is a syntax error in both MODIFY COLUMN parts of the SQL statement.

Code:
ALTER TABLE `BFXLendBot_Tracking`
ADD COLUMN `trans_cur`  varchar(10) NULL AFTER `user_id`,
MODIFY COLUMN `dep_balance`  decimal(12,8) NULL DEFAULT NULL AFTER `date`,
MODIFY COLUMN `swap_payment`  decimal(12,8) NULL DEFAULT NULL AFTER `dep_balance`,
DROP INDEX `uniquieKeys` ,
ADD UNIQUE INDEX `uniquieKeys` (`user_id`, `trans_id`, `trans_cur`) USING BTREE;

Code:
CREATE TABLE `BFXLendBot_Tracking` (
  `id` int(12) NOT NULL AUTO_INCREMENT,
  `user_id` smallint(4) DEFAULT NULL,
  `trans_id` int(12) DEFAULT NULL,
  `date` date DEFAULT NULL,
  `dep_balance` decimal(12,2) DEFAULT NULL,
  `swap_payment` decimal(12,2) DEFAULT NULL,
  `average_return` decimal(8,6) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `uniquieKeys` (`user_id`,`trans_id`)
) ENGINE=MyISAM AUTO_INCREMENT=171 DEFAULT CHARSET=latin1;

CREATE TABLE `BFXLendBot_Tracking_BACKUP_v17` (
  `id` int(12) NOT NULL AUTO_INCREMENT,
  `user_id` smallint(4) DEFAULT NULL,
  `trans_id` int(12) DEFAULT NULL,
  `date` date DEFAULT NULL,
  `dep_balance` decimal(12,2) DEFAULT NULL,
  `swap_payment` decimal(12,2) DEFAULT NULL,
  `average_return` decimal(8,6) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `uniquieKeys` (`user_id`,`trans_id`)
) ENGINE=MyISAM AUTO_INCREMENT=171 DEFAULT CHARSET=latin1;

I am also wondering it it makes more sense to use decimal(16,8), as that way you can still support numbers up to 999,999,999. decimal(12,8) only goes up to 9,999.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF3 on September 03, 2017, 06:35:49 PM
Ok, its ready!  MarginBot v0.1.07 is now live on github!  Full Crypto Margin lending!  Currently it supports all currencies that Bitfinex supports for margin.
For a few weeks now, my marginbot setup has not been picking up account history, nor unused funding, but the cron job runs were being added to the BFXLendBot_CronRuns table.

I spent some time on it yesterday, and didn't get any ideas as to what might be wrong. Not least because my php binary will not execute a .php file.

But the problem shows up as a lack of history on http://.../marginbot/index.php

and a lack of entries in the table BFXLendBot_Tracking. The last entry was 2017-08-19.

So I noticed this morning 1.07b was available on the master branch.

I followed the update instructions, and the following occurred:

A new table BFXLendBot_CurPairs is created, and the 4 existing tables are backed up to copies with the suffix _BACKUP_v17

But I get this error on the screen http://.../marginbot/update.php?doUpdate=2

Quote
THERE HAS BEEN A DATABASE ERROR
Please Contact Support If this error persists.
1264 - Out of range value for column 'dep_balance' at row 7

I am using

5.7.16
MySQL Community Server (GPL)


Poking around the MySQL tables, it seems the table definitions are still the same: decimal(12,2). But I can see some ALTER TABLE statements in update.php, that switch to decimal(12,8).
When I paste the ALTER TABLE for the Tracking table into MySQLWorkbench it thinks there is a syntax error in both MODIFY COLUMN parts of the SQL statement.


I am also wondering it it makes more sense to use decimal(16,8), as that way you can still support numbers up to 999,999,999. decimal(12,8) only goes up to 9,999.

Aye, good catch, that should definitely be at least decimal(16,8).   I was building the updater on a relatively new install that didn't have much data in it, and 12,8 worked for me (only a few thousand $ in the test account), but it will fail for anyone with > $9,999 in their account.  I will update this in github.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF3 on September 03, 2017, 06:52:21 PM
Just updated github to 1.07c.  Fixed the above update.php issue (i used decimal(18,8), which should cover even the largest of investors), and made a quick fix to balances updating after loans are canceled ( Thanks jbhuang ! ).

The only 3 files that changed from v1.07b are:
/update.php
/inc/version_info.php
/inc/ExchangeAPIs/bitfinex.php

if updating from that version, you should only need to copy over those three files.  If updating from an older version, or doing a new install, follow the standard procedures.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: BeastOfBodmin on September 03, 2017, 07:08:09 PM
Any chance of adding Litecoin (LTC)?

It's fantastic that you've generalised to more currencies.

I was seriously thinking about hacking your bot myself to get multi-currency support in.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: prototype_nsx on September 05, 2017, 03:06:14 PM
Right, when I try to run from the browser the page appears messy like the previous screenshot, i am not sure if you can see that?

http://imgur.com/a/umbny

Hmm.  something is seriously not right with your server setup.  From that screenshot it looks like its dumping raw code rather than executing it, which shouldn't even be possible, unless its not actually being parsed by PHP.  have you been able to correctly run any other PHP code on the server?

I build a new VM and the issue went away so it's all good thanks to you

Can you or anyone recommend settings for 1k usd lending?

Many thanks





Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: BeastOfBodmin on September 05, 2017, 08:02:38 PM
Ok, its ready!  MarginBot v0.1.07 is now live on github!  Full Crypto Margin lending!  Currently it supports all currencies that Bitfinex supports for margin.
For a few weeks now, my marginbot setup has not been picking up account history, nor unused funding, but the cron job runs were being added to the BFXLendBot_CronRuns table.

I spent some time on it yesterday, and didn't get any ideas as to what might be wrong. Not least because my php binary will not execute a .php file.

But the problem shows up as a lack of history on http://.../marginbot/index.php

and a lack of entries in the table BFXLendBot_Tracking. The last entry was 2017-08-19.
I solved the lack of updates problem.

I put in a print_r statement that told me my nonce was too small.

That made me think maybe I was reusing some keys (1 iMac, 2 android devices, two BFX accounts).

I was right!


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF3 on September 07, 2017, 05:50:24 PM
I solved the lack of updates problem.

I put in a print_r statement that told me my nonce was too small.

That made me think maybe I was reusing some keys (1 iMac, 2 android devices, two BFX accounts).

I was right!

Yeah, the way the bitfinex API enforces nonce is strange.  I usually just use microtime on just about every other API in the world and it works fine, but on really busy BFX keys, there seems to always be lots of conflicts.  Easiest way around it is to generate a new API key for every device / bot / app.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF3 on September 07, 2017, 06:02:38 PM
Any chance of adding Litecoin (LTC)?

It's fantastic that you've generalised to more currencies.

I was seriously thinking about hacking your bot myself to get multi-currency support in.

Well that's awkward... Not sure how I managed to miss that one...  I added it to to the newest build, just uploaded to github.  However, for anyone who already has v1.07b or higher, you'll need to manually run a sql query to add it to your database:

Code:
INSERT INTO `[YOURDBPREFIX]CurPairs` VALUES ('13', 'LTC', 'Litecoin', '1');

make sure to change [YOURDBPREFIX] to the correct prefix ( BFXLendBot_ if you used the default setting ).

I also made a few other updates to the newest version just uploaded (1.07e).  Mainly it allows pausing lending for a single coin or currency, rather than pausing the entire account....


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF3 on September 07, 2017, 06:40:07 PM
Also, if Bitfinex starts supporting margin for a new currency in the future, and you don't want to wait for me to add support to it, all you'd need to do is add it to the CurPairs table.  Just need to add the currency code to curSym, the name of the coin to the curName row, and set status to 1 (leave the id blank and it will auto increment).  After that is should be an option in the dropdown menu.  Its also possible to hide currency that you don't care about, just set the status to 0 on any you want to hide.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: prototype_nsx on September 11, 2017, 02:29:17 AM
Update on my setup :) I have started with small amounts and my earnings below so far

USD

http://imgur.com/a/l6G47

http://imgur.com/a/6DNSe

BTC

http://imgur.com/a/4e9xY

I have a question, how do I find View Overall Returns for other currencies besides USD?

Thanks again HowardF3


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF3 on September 11, 2017, 05:31:15 PM
Update on my setup :) I have started with small amounts and my earnings below so far

The earnings are slow, but they add up over time.  Better than just about any other investment you'll find...  ;D


I have a question, how do I find View Overall Returns for other currencies besides USD?

I haven't put it in yet.  Making those charts is a bit of a pain, but I'm working to get it into the next build, and clean up the charts overall...


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: prototype_nsx on September 12, 2017, 06:39:42 AM
Agreed, I find it less stressful than day trading.

No worries, will wait for the next release :)

Cheers


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: BeastOfBodmin on September 18, 2017, 07:14:09 PM
Update on my setup :) I have started with small amounts and my earnings below so far

The earnings are slow, but they add up over time.  Better than just about any other investment you'll find...  ;D
I think of it as being akin to selling picks and shovels during a gold rush. Apart from the currency risk (if USD is not your home currency), the only volatility is in the daily interest rate.

You don't lose money, you just make it at different rates.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF3 on September 19, 2017, 04:47:06 PM

I think of it as being akin to selling picks and shovels during a gold rush. Apart from the currency risk (if USD is not your home currency), the only volatility is in the daily interest rate.

You don't lose money, you just make it at different rates.

Exactly.  I've always said don't be the gold miner, be the store that supplies the gold miner.  Let others take the big risks.  Some will make a fortune, lots more will lose their asses.  But either way, the suppliers (or in this case margin providers) make money.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF3 on September 19, 2017, 05:21:22 PM
I have a question, how do I find View Overall Returns for other currencies besides USD?


Just posted an update to github, v1.08.  This is a small update that primarily addresses the "View Overall Returns" page.  It is now tabbed to show all available Crypto returns.  I also added a function (at the bottom of this dropdown menu) to import older return History, in case you want to import your older return history from Bitfinex for tracking / stats reasons.

http://therovegroup.com/MBot/MarginBotUpdate1.08.PNG


For the new Import function, just go to View Overall Returns -> Grab Return History From Bitfinex.  Then select the currency you want to import and select the date you want to use as the start date for your historical data.  Make sure to enter the start date in the format of YYYY-MM-DD EXACTLY (ex: 2017-09-19 for the date I'm posting this).  If you enter a long period of time, be prepared for this to take several minutes to run.  While its running, it will probably look like its stuck, but its not.  I ran mine from 2014-01-01 to stress test it and it took about 2 minutes to run, but this could vary a lot base on your server, how busy Bitfinex is, etc.  I'd suggest not going back too much earlier than that, as it may time out the script, but honestly Bitfinex isn't too much older than that, so it shouldn't be an issue...

http://therovegroup.com/MBot/MarginBotUpdate108-2.jpg

To install this update, just back up your /inc/config.php, download the latest version from github, unzip and overwrite the existing files.  Then copy back your /inc/config.php and everything should work.  If you're updating from a version older than 1.07, you should be directed to an update process when you access the site.  If you were already on 1.07d+ you shouldn't need to go through the update process.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF on September 20, 2017, 04:57:22 PM

1. First, let me get this out of the way.  I am HowardF, the original creator of MarginBot.  While I was away from this forum, it apparently got hacked, and they locked down all the accounts and sent out a change password thing.  Well, that change password thing isn't working, I can't request a new password from my old account, and I can't figure out any way around it.  So, I created this new account to use from now on.  If there's any concern whether its really me or not, I'm happy to prove it by changing either the old website at fuckedgox.com or I can make a little change in the Github repo or whatever (just tell me what you guys want, and I'll do it).  Also, if anyone has a better contact for an admin here that could reset the HowardF account for me so I can get back in, that would be awesome as well.  I'd love to get access back to that account, would save some trouble.

So, I finally got in touch with an admin here and was able to get the original account back!   Looks like I'll be posting from this account again, and this will allow me to update the original post when things get updated around here.  I'm going to post all the latest updates to that original message now.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF on September 20, 2017, 06:23:03 PM
It seems there are too many people interested in giving borrow their bitcoin and not enough people interested in doing business with it. okey

Bitcoin margin lending rates have always been MUCH lower than USD.  All crypto for that matter has much lower rates. I was in a fairly long discussion about crypto vs USD lending several years ago, in which I advocated always converting crypto to USD to lend ( https://bitcointalk.org/index.php?topic=229438.msg9739115#msg9739115 (https://bitcointalk.org/index.php?topic=229438.msg9739115#msg9739115) ), but with prices where they are right now, turns out depending on when you got your BTC, I may have been wrong in my analysis ( honestly didn't see $4k bitcoin coming this quickly.... ).  That said, I still believe it is much safer and a far more reliable investment to lend USD.  Lending USD gives MUCH higher returns than crypto, and its fairly reliable, daily income.

But, I also do have some coin that I hold, just in case.  And I know a lot of other people do as well.  And having that coin sitting there doing nothing doesn't really make sense to me, so I added back in crypto lending.  Getting 0.01% daily returns on those coins is better than nothing, and the bot can still focus on my USD returns, where my real income is.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: prototype_nsx on September 22, 2017, 04:26:05 AM
I have a question, how do I find View Overall Returns for other currencies besides USD?


Just posted an update to github, v1.08.  This is a small update that primarily addresses the "View Overall Returns" page.  It is now tabbed to show all available Crypto returns.  I also added a function (at the bottom of this dropdown menu) to import older return History, in case you want to import your older return history from Bitfinex for tracking / stats reasons.

http://therovegroup.com/MBot/MarginBotUpdate1.08.PNG


For the new Import function, just go to View Overall Returns -> Grab Return History From Bitfinex.  Then select the currency you want to import and select the date you want to use as the start date for your historical data.  Make sure to enter the start date in the format of YYYY-MM-DD EXACTLY (ex: 2017-09-19 for the date I'm posting this).  If you enter a long period of time, be prepared for this to take several minutes to run.  While its running, it will probably look like its stuck, but its not.  I ran mine from 2014-01-01 to stress test it and it took about 2 minutes to run, but this could vary a lot base on your server, how busy Bitfinex is, etc.  I'd suggest not going back too much earlier than that, as it may time out the script, but honestly Bitfinex isn't too much older than that, so it shouldn't be an issue...

http://therovegroup.com/MBot/MarginBotUpdate108-2.jpg

To install this update, just back up your /inc/config.php, download the latest version from github, unzip and overwrite the existing files.  Then copy back your /inc/config.php and everything should work.  If you're updating from a version older than 1.07, you should be directed to an update process when you access the site.  If you were already on 1.07d+ you shouldn't need to go through the update process.


EDIT

Just checked again and the charts are loading fine :)

BTC
https://imgur.com/a/qPQZh

USD

https://imgur.com/a/SII6w



Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: prototype_nsx on September 22, 2017, 04:30:58 AM
It seems there are too many people interested in giving borrow their bitcoin and not enough people interested in doing business with it. okey

Bitcoin margin lending rates have always been MUCH lower than USD.  All crypto for that matter has much lower rates. I was in a fairly long discussion about crypto vs USD lending several years ago, in which I advocated always converting crypto to USD to lend ( https://bitcointalk.org/index.php?topic=229438.msg9739115#msg9739115 (https://bitcointalk.org/index.php?topic=229438.msg9739115#msg9739115) ), but with prices where they are right now, turns out depending on when you got your BTC, I may have been wrong in my analysis ( honestly didn't see $4k bitcoin coming this quickly.... ).  That said, I still believe it is much safer and a far more reliable investment to lend USD.  Lending USD gives MUCH higher returns than crypto, and its fairly reliable, daily income.

But, I also do have some coin that I hold, just in case.  And I know a lot of other people do as well.  And having that coin sitting there doing nothing doesn't really make sense to me, so I added back in crypto lending.  Getting 0.01% daily returns on those coins is better than nothing, and the bot can still focus on my USD returns, where my real income is.

Update on my earnings :)

Started with 1.67 BTC

BTC   0.00064869   9/21/2017 1:34
BTC   0.00084992   9/20/2017 1:34
BTC   0.00065268   9/19/2017 1:34
BTC   0.00028963   9/18/2017 1:33
BTC   0.00009418   9/17/2017 1:34
BTC   0.00038094   9/16/2017 1:33
BTC   0.00001963   9/15/2017 1:35
BTC   0.00020636   9/14/2017 1:33
BTC   0.00030252   9/13/2017 1:34
BTC   0.00022353   9/12/2017 1:33
BTC   0.00029864   9/11/2017 1:33
BTC   0.00027561   9/10/2017 1:33

Total   0.00424233   
---------------------------------------------------
Started with 52.48 USD

USD   0.01138437   9/19/2017 1:34
USD   0.02645962   9/18/2017 1:33
USD   0.02068842   9/17/2017 1:34
USD   0.03058716   9/16/2017 1:34
USD   0.03076744   9/15/2017 1:35
USD   0.03093932   9/14/2017 1:33
USD   0.03085982   9/13/2017 1:34
USD   0.0299652   9/12/2017 1:33
USD   0.03008847   9/11/2017 1:33
USD   0.0235216   9/10/2017 1:33
USD   0.03226006   9/9/2017 1:34
USD   0.03385569   9/8/2017 1:33
USD   0.03531509   9/7/2017 1:34
USD   0.01338319   9/6/2017 1:37

Total   0.38007545   


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: BeastOfBodmin on October 01, 2017, 06:00:25 PM
It seems there are too many people interested in giving borrow their bitcoin and not enough people interested in doing business with it. okey

Bitcoin margin lending rates have always been MUCH lower than USD.  All crypto for that matter has much lower rates. I was in a fairly long discussion about crypto vs USD lending several years ago, in which I advocated always converting crypto to USD to lend ( https://bitcointalk.org/index.php?topic=229438.msg9739115#msg9739115 (https://bitcointalk.org/index.php?topic=229438.msg9739115#msg9739115) ), but with prices where they are right now, turns out depending on when you got your BTC, I may have been wrong in my analysis ( honestly didn't see $4k bitcoin coming this quickly.... ).  That said, I still believe it is much safer and a far more reliable investment to lend USD.  Lending USD gives MUCH higher returns than crypto, and its fairly reliable, daily income.

But, I also do have some coin that I hold, just in case.  And I know a lot of other people do as well.  And having that coin sitting there doing nothing doesn't really make sense to me, so I added back in crypto lending.  Getting 0.01% daily returns on those coins is better than nothing, and the bot can still focus on my USD returns, where my real income is.

I hold some crypto, as well as gold. I buy into an asset as the price falls using pre-allocated fiat at various price points. As the price rises, I sell out at predetermined price points, but for a new buy, I always retain 33% of the asset as a core position which I will "never sell". My target for BTC is USD 10000, at which point I might sell my core position (accumulated when the price was BTC 1 was less than USD 1000).

I therefore have no problem lending out my core crypto positions, as well as the USD that are allocated for rebuys when BTC, etc. crash much, much lower.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: Jope on October 07, 2017, 04:12:12 AM
Hi HowardF,
I've run into some trouble when upgrading, as in the upgrade button didn't too anything that I could see, the page just refreshed quickly. It may be due to me coming from the deponzit fork (was usinh it for the last 2 years but it just mysteriously stopped working). Thus I decided a clean install from your repo was necessary. I deleted everything, started with new everything. I put in my DB info and on the next page and after I put in my API info and hit next I get:

THERE HAS BEEN A DATABASE ERROR
Please Contact Support If this error persists.
1054 - Unknown column 'currency' in 'field list'

I'm on PHP 7.0 and haven't the foggiest why this is coming up. Same thing happens after I try logging in normally. Any idea what I should do/it could be?



Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: Bountymaker on October 07, 2017, 01:39:35 PM
 Could you tell me, does it works? Is it safety to use it?


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: Jope on October 07, 2017, 09:28:17 PM
Could you tell me, does it works? Is it safety to use it?

Yes, I can tell you that is works. I've been using a previous version for 2 years and it has performed extremely well.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF on October 08, 2017, 04:54:43 PM
Hi HowardF,
I've run into some trouble when upgrading, as in the upgrade button didn't too anything that I could see, the page just refreshed quickly. It may be due to me coming from the deponzit fork (was usinh it for the last 2 years but it just mysteriously stopped working). Thus I decided a clean install from your repo was necessary. I deleted everything, started with new everything. I put in my DB info and on the next page and after I put in my API info and hit next I get:

THERE HAS BEEN A DATABASE ERROR
Please Contact Support If this error persists.
1054 - Unknown column 'currency' in 'field list'

I'm on PHP 7.0 and haven't the foggiest why this is coming up. Same thing happens after I try logging in normally. Any idea what I should do/it could be?



Hmm...  I'm definitely at a bit of a loss here.  I don't use the column 'currency' anywhere.   Are you installing over a build of the deponzit fork?  I know he used a 'currency' row, and leaving any code from that fork in the folder when you install the base MarginBot would definitely break things.  He made changes to the core database layout that would not be compatible.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: Jope on October 09, 2017, 03:54:23 AM
Wow, just noticed that even though I replaced all the folders from your master, my bot folder files were the old deponzit ones, not yours! Sorry for the user error! Everything is all set up, thanks anyway for the reply!


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: SnelleGeld on October 13, 2017, 07:32:06 PM
Note/disclaimer: I have little experience with php programming

I have a domain hosted on which has one subdomain.
On this subdomain i installed MarginBot. When i got to the correct address i noticed the webpage just kept on loading. I checked the server logs and found out they where being flooded with the message:


[Fri Oct 13 20:26:06.405827 2017] [proxy_fcgi:error] [pid XXXXX:tid XXXXXXXXXXXXXXXXXX] [client xx:xx:xx:xx:XXXXXX] AH01071: Got error 'e/XXXX/domains/XXXXX.XX/public_html/marginbot/inc/ExchangeAPIs/bitfinex.php on line 78\nPHP message: PHP Notice: Undefined index: price in /home/XXXXX/domains/XXXXXX.XX/public_html/marginbot/inc/ExchangeAPIs/bitfinex.php on line 78\nPHP

I looked up the file bitfinex.php and went to line 78. Here below is the function that line 78 belongs to:

`    /* Data posting query, for detailed API calls */
    function bitfinex_query($method, array $req = array()) {
        // API settings
      
        $req['request'] = '/v1/'.$method;
        $this->nonceInc += 1;
      $req['nonce'] = (string)$this->nonceInc;
      if($req['price']){$req['price'] = (string)$req['price'];}
      
        // generate the POST data string
        $reqData = base64_encode(json_encode($req, true));
      $post_data = http_build_query($req, '', '&');
      //print_r($post_data);
        $sign = hash_hmac('sha384', $reqData, $this->apiSec);
 
        // generate the extra headers
        $headers = array(
         'X-BFX-APIKEY: '.$this->apiKey,
         'X-BFX-PAYLOAD: '.$reqData,
         'X-BFX-SIGNATURE: '.$sign
        );`


Further information:
-When installed MarginBot i then configured my bitfenix account using the MarginBot webpage gui. (I could still access and use the webpage
-I made a second user account

After the things mentioned above the webpage became unaccesable. I'm guessing i'm making an obvious mistake here which i am sure one of you can assist me with.

Further more an other error popped up in the server logs:

[Fri Oct 13 20:26:23 2017] [proxy_fcgi:error] [pid XXXXX:tid XXXXXXXXXXXXXX] (70007)The timeout specified has expired: [client XX.XXX.XX.XXX:XXXXX] AH01075: Error dispatching request to : (polling)

However i'm betting this is merely the result of endless loading due to timeout

And after a long while it will display :


THERE HAS BEEN A DATABASE ERROR
Please Contact Support If this error persists.
1021 - Disk full (/tmp/#sql_16ed_0.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF on October 14, 2017, 05:14:44 PM

THERE HAS BEEN A DATABASE ERROR
Please Contact Support If this error persists.
1021 - Disk full (/tmp/#sql_16ed_0.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")


Hmm.. this is making me think your sql server doesn't have enough space for queries to run correctly.  I can't imagine marginbot making any queries that would cause this though, all the marginbot tables are relatively tiny.   Are you running something else on this server that does a lot of work on your MySQL server?


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF on October 16, 2017, 02:29:33 PM


[Fri Oct 13 20:26:06.405827 2017] [proxy_fcgi:error] [pid XXXXX:tid XXXXXXXXXXXXXXXXXX] [client xx:xx:xx:xx:XXXXXX] AH01071: Got error 'e/XXXX/domains/XXXXX.XX/public_html/marginbot/inc/ExchangeAPIs/bitfinex.php on line 78\nPHP message: PHP Notice: Undefined index: price in /home/XXXXX/domains/XXXXXX.XX/public_html/marginbot/inc/ExchangeAPIs/bitfinex.php on line 78\nPHP


One other thing, this is just a Notice, so it shouldn't prevent the script from continuing to run.  It actually should be suppressed from hitting the logs, but you probably have error reporting set pretty high in your php configuration.  Still shouldn't cause any issues, its just going to write a lot of notices to the logs.

( I will tweak that line in future builds so that it won't throw a notice even on high error settings. )


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: mt717 on October 16, 2017, 08:20:26 PM
I'm a new user of the MarginBot. So far so good. Many Thanks to HowardF

I need help with some error messages.

I downloaded the latest and set it up again yesterday on 10/15. It shows version 1.08. I'm running on PHP5.6 and MySQL 5.5 on AWS Linux on an EC2 server. I did modify the DB to add NEO as my 14th currency pair and I only left USD, BTC, ETH and NEO as active. The rest I set to zero. Then I set my cron jobs and everything appears to be running. I saw it post two NEO orders, so it is working.

However, I see the following errors over and over in the httpd error_log. Should I be concerned? (not my real IP, obviously).

Every 10 Min Job:
[Mon Oct 16 14:01:08.357984 2017] [:error] [pid 3330] [client 53.2.210.52:34042] PHP Notice:  Undefined property: Bitfinex::$cryptoPendingVal in /var/www/html/bitbot/inc/ExchangeAPIs/bitfinex.php on line 481
[Mon Oct 16 14:01:10.847006 2017] [:error] [pid 3330] [client 53.2.210.52:34042] PHP Notice:  Undefined index: ETH in /var/www/html/bitbot/inc/ExchangeAPIs/bitfinex.php on line 445
[Mon Oct 16 14:01:10.847040 2017] [:error] [pid 3330] [client 53.2.210.52:34042] PHP Notice:  Undefined variable: intReturn in /var/www/html/bitbot/inc/ExchangeAPIs/bitfinex.php on line 446
[Mon Oct 16 14:01:10.847045 2017] [:error] [pid 3330] [client 53.2.210.52:34042] PHP Notice:  Undefined index: ETH in /var/www/html/bitbot/inc/ExchangeAPIs/bitfinex.php on line 446
[Mon Oct 16 14:01:10.847061 2017] [:error] [pid 3330] [client 53.2.210.52:34042] PHP Notice:  Undefined index: BTC in /var/www/html/bitbot/inc/ExchangeAPIs/bitfinex.php on line 445
[Mon Oct 16 14:01:10.847065 2017] [:error] [pid 3330] [client 53.2.210.52:34042] PHP Notice:  Undefined index: BTC in /var/www/html/bitbot/inc/ExchangeAPIs/bitfinex.php on line 446
[Mon Oct 16 14:01:10.847070 2017] [:error] [pid 3330] [client 53.2.210.52:34042] PHP Notice:  Undefined index: USD in /var/www/html/bitbot/inc/ExchangeAPIs/bitfinex.php on line 445
[Mon Oct 16 14:01:10.847073 2017] [:error] [pid 3330] [client 53.2.210.52:34042] PHP Notice:  Undefined index: USD in /var/www/html/bitbot/inc/ExchangeAPIs/bitfinex.php on line 446
[Mon Oct 16 14:01:10.847082 2017] [:error] [pid 3330] [client 53.2.210.52:34042] PHP Notice:  Undefined index: NEO in /var/www/html/bitbot/inc/ExchangeAPIs/bitfinex.php on line 445
[Mon Oct 16 14:01:10.847086 2017] [:error] [pid 3330] [client 53.2.210.52:34042] PHP Notice:  Undefined index: NEO in /var/www/html/bitbot/inc/ExchangeAPIs/bitfinex.php on line 446
[Mon Oct 16 14:01:10.847401 2017] [:error] [pid 3330] [client 53.2.210.52:34042] PHP Notice:  Undefined property: Bitfinex::$cryptoPendingIDS in /var/www/html/bitbot/inc/ExchangeAPIs/bitfinex.php on line 336

Every Hourly Job:
[Mon Oct 16 14:05:02.646020 2017] [:error] [pid 3194] [client 53.2.210.52:34056] PHP Notice:  Undefined property: Bitfinex::$cryptoPendingVal in /var/www/html/bitbot/inc/ExchangeAPIs/bitfinex.php on line 481
[Mon Oct 16 14:05:04.142334 2017] [:error] [pid 3194] [client 53.2.210.52:34056] PHP Notice:  Undefined index: ETH in /var/www/html/bitbot/inc/ExchangeAPIs/bitfinex.php on line 445
[Mon Oct 16 14:05:04.142368 2017] [:error] [pid 3194] [client 53.2.210.52:34056] PHP Notice:  Undefined variable: intReturn in /var/www/html/bitbot/inc/ExchangeAPIs/bitfinex.php on line 446
[Mon Oct 16 14:05:04.142373 2017] [:error] [pid 3194] [client 53.2.210.52:34056] PHP Notice:  Undefined index: ETH in /var/www/html/bitbot/inc/ExchangeAPIs/bitfinex.php on line 446
[Mon Oct 16 14:05:04.142378 2017] [:error] [pid 3194] [client 53.2.210.52:34056] PHP Notice:  Undefined index: BTC in /var/www/html/bitbot/inc/ExchangeAPIs/bitfinex.php on line 445
[Mon Oct 16 14:05:04.142383 2017] [:error] [pid 3194] [client 53.2.210.52:34056] PHP Notice:  Undefined index: BTC in /var/www/html/bitbot/inc/ExchangeAPIs/bitfinex.php on line 446
[Mon Oct 16 14:05:04.142387 2017] [:error] [pid 3194] [client 53.2.210.52:34056] PHP Notice:  Undefined index: USD in /var/www/html/bitbot/inc/ExchangeAPIs/bitfinex.php on line 445
[Mon Oct 16 14:05:04.142391 2017] [:error] [pid 3194] [client 53.2.210.52:34056] PHP Notice:  Undefined index: USD in /var/www/html/bitbot/inc/ExchangeAPIs/bitfinex.php on line 446
[Mon Oct 16 14:05:04.142401 2017] [:error] [pid 3194] [client 53.2.210.52:34056] PHP Notice:  Undefined index: NEO in /var/www/html/bitbot/inc/ExchangeAPIs/bitfinex.php on line 445
[Mon Oct 16 14:05:04.142405 2017] [:error] [pid 3194] [client 53.2.210.52:34056] PHP Notice:  Undefined index: NEO in /var/www/html/bitbot/inc/ExchangeAPIs/bitfinex.php on line 446
[Mon Oct 16 14:05:04.143075 2017] [:error] [pid 3194] [client 53.2.210.52:34056] PHP Notice:  Undefined index: id in /var/www/html/bitbot/inc/ExchangeAPIs/bitfinex.php on line 169
[Mon Oct 16 14:05:04.143163 2017] [:error] [pid 3194] [client 53.2.210.52:34056] PHP Notice:  Undefined index: price in /var/www/html/bitbot/inc/ExchangeAPIs/bitfinex.php on line 78
[Mon Oct 16 14:05:09.563742 2017] [:error] [pid 3194] [client 53.2.210.52:34056] PHP Notice:  Undefined index: price in /var/www/html/bitbot/inc/ExchangeAPIs/bitfinex.php on line 78
[Mon Oct 16 14:05:10.626413 2017] [:error] [pid 3194] [client 53.2.210.52:34056] PHP Notice:  Undefined index: price in /var/www/html/bitbot/inc/ExchangeAPIs/bitfinex.php on line 78
[Mon Oct 16 14:05:15.362886 2017] [:error] [pid 3194] [client 53.2.210.52:34056] PHP Notice:  Undefined index: price in /var/www/html/bitbot/inc/ExchangeAPIs/bitfinex.php on line 78

Thanks in advance for any advice. MT


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF on October 17, 2017, 09:27:33 PM
However, I see the following errors over and over in the httpd error_log. Should I be concerned? (not my real IP, obviously).

Every 10 Min Job:
[Mon Oct 16 14:01:08.357984 2017] [:error] [pid 3330] [client 53.2.210.52:34042] PHP Notice:  Undefined property: Bitfinex::$cryptoPendingVal in /var/www/html/bitbot/inc/ExchangeAPIs/bitfinex.php on line 481
.............

Thanks in advance for any advice. MT


Nothing to be concerned about.  When I added back in Crypto Pairs, I check against a variable that doesn't always have all the possible pairs in an array.  In the next build I will update the check so that it makes sure the pair exists, and if it doesn't it'll fail silently (as it should do now) so that nothing gets logged.  Other than making your logs a bit longer than they should be though, this won't effect the bot at all as it is.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: mt717 on October 19, 2017, 01:41:34 AM
However, I see the following errors over and over in the httpd error_log. Should I be concerned? (not my real IP, obviously).

Every 10 Min Job:
[Mon Oct 16 14:01:08.357984 2017] [:error] [pid 3330] [client 53.2.210.52:34042] PHP Notice:  Undefined property: Bitfinex::$cryptoPendingVal in /var/www/html/bitbot/inc/ExchangeAPIs/bitfinex.php on line 481
.............

Thanks in advance for any advice. MT


Nothing to be concerned about.  When I added back in Crypto Pairs, I check against a variable that doesn't always have all the possible pairs in an array.  In the next build I will update the check so that it makes sure the pair exists, and if it doesn't it'll fail silently (as it should do now) so that nothing gets logged.  Other than making your logs a bit longer than they should be though, this won't effect the bot at all as it is.


Awesome. Thanks so much for the quick response.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: mitao on October 30, 2017, 01:17:42 AM
Thanks for the awsome bot, it forces me to learn web server and linux from almost 0. And after a few hours, I got my bot running! The only thing I am missing is that I can't get my hourly cron job working somehow. The 10-min cron is working well.

In my "crontab - e", I got one line for the 10-min cron job copied from installation, and next line for the 1-h cron job. But the web server kept giving me "It appears you have not set up the hourly cron, or it hasn't been running. Check to make sure your cronjob contains a job similar to:
5 * * * * wget -qO- xxxxxxxxx/bot/crons/HourlyCron.php >/dev/null 2>&1". xxxxx is my address. It seems all correctly copied as instructed. Any suggestion for a noob?

I think the 10-min cron is doing all the lending, and 1-h cron only for the statistics, right? I think I can live without it.

Thanks,


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: altOWL on October 30, 2017, 02:45:47 AM
The altOWL Project
INVEST & WATCH
You can use your POLONIEX OR BITTREX API KEYS
to watch NEWS on BTC and altcoins
manage your Poloniex & Bittrex accounts
trade and see the analytics of your investment.
also you could have a look at our forum.
https://altowl.com


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: BeastOfBodmin on October 30, 2017, 04:48:16 AM
Any suggestion for a noob?

I think the 10-min cron is doing all the lending, and 1-h cron only for the statistics, right? I think I can live without it.

Thanks,

There is a trailing " on the end of the crontab entry you posted. Should it be there?

Try using the full path to the wget command. The $PATH used by cron can be different than the $PATH you have when logged in.

Look in /var/log/cron to check what is happening.

You should also try running the command on the command line.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: mt717 on October 31, 2017, 01:38:54 AM
I think the new coin BTG may have broken something. Starting on 10/24 my error logs on v1.08 filled up due to an infinite loop.

[Tue Oct 31 01:04:42.359979 2017] [:error] [pid 3349] [client 52.6.250.144:60840] PHP Warning:  Division by zero in /var/www/html/bitbot/inc/ExchangeAPIs/bitfinex.php on line 374
[Tue Oct 31 01:04:42.360010 2017] [:error] [pid 3349] [client 52.6.250.144:60840] PHP Warning:  Division by zero in /var/www/html/bitbot/inc/ExchangeAPIs/bitfinex.php on line 380

It seems to all start with this issue:
[Tue Oct 31 01:04:42.359667 2017] [:error] [pid 3349] [client 52.6.250.144:60840] PHP Warning:  file_get_contents(https://api.bitfinex.com/v1/lendbook/btg/?limit_asks=500&amp;limit_bids=0): failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request\r\n in /var/www/html/bitbot/inc/ExchangeAPIs/bitfinex.php on line 229


Notice the "BTG" in the URL.
https://api.bitfinex.com/v1/lendbook/btg/?limit_asks=500&limit_bids=0

This returns {"message":"Unknown currency"}

Change "btg" to any other coin code and it works fine. It seems the code is pulling back all coins and trying to get the lending book, so when BTG started coming back as a valid coin, it tries to get the ending info and fails.

Any suggestions on a quick fix or maybe a code update?


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF on November 01, 2017, 02:46:12 PM
I think the new coin BTG may have broken something. Starting on 10/24 my error logs on v1.08 filled up due to an infinite loop.
Any suggestions on a quick fix or maybe a code update?

The problem is bitfinex isn't allowing Margin Funding for BitcoinGold yet, only exchange trading.  You can always check the "Funding" dropdown menu for available coins to lend on margin.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: mt717 on November 01, 2017, 03:40:36 PM
I think the new coin BTG may have broken something. Starting on 10/24 my error logs on v1.08 filled up due to an infinite loop.
Any suggestions on a quick fix or maybe a code update?

The problem is bitfinex isn't allowing Margin Funding for BitcoinGold yet, only exchange trading.  You can always check the "Funding" dropdown menu for available coins to lend on margin.

Thanks for the quick response. Based on your reply, I just realized that the code is trying to get the lendbook on BTG because I have a positive value in my Funding Wallet for BTG. This happened automatically as part of the bitcoin fork. Bitfinex put the BTG coins into the funding wallet automatically because that is where my BTC was I guess. I moved the BTG out of my BTG Funding Wallet to my BTG Exchange Wallet and that made the Bot code stop trying to get the lendbook data for BTG. It seems to be running correctly again. Hopefully this post will help anyone else that hits this problem. Thanks.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: HowardF on November 01, 2017, 03:43:36 PM
I think the new coin BTG may have broken something. Starting on 10/24 my error logs on v1.08 filled up due to an infinite loop.
Any suggestions on a quick fix or maybe a code update?

The problem is bitfinex isn't allowing Margin Funding for BitcoinGold yet, only exchange trading.  You can always check the "Funding" dropdown menu for available coins to lend on margin.

Thanks for the quick response. Based on your reply, I just realized that the code is trying to get the lendbook on BTG because I have a positive value in my Funding Wallet for BTG. This happened automatically as part of the bitcoin fork. Bitfinex put the BTG coins into the funding wallet automatically because that is where my BTC was I guess. I moved the BTG out of my BTG Funding Wallet to my BTG Exchange Wallet and that made the Bot code stop trying to get the lendbook data for BTG. It seems to be running correctly again. Hopefully this post will help anyone else that hits this problem. Thanks.

Ahh, yeah that would make sense.  Never considered the funding wallet would have a coin in it that can't be lent.  I'll try to trap for that better in a future build, but for now, just transferring those coins to another wallet will fix it.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: cryptoassetmgmt on November 02, 2017, 01:18:07 PM
Hello, I just installed last version and I found a strange thing in the graphical view of USD return.
My USD balance is more than 10k ( in the funding settings page it shows correct amount) but in the graph it stop right axis to 10k.
is there a way to fix it?

thanks !



M.

link to screenshot :
https://ibb.co/iWEGYG



Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: rxone on November 02, 2017, 05:10:09 PM
Very interesting project!

Can you elaborate a bit on what algorithm the bot uses to determine the lending rate at which it will put the offer?


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: Jope on November 09, 2017, 02:31:13 PM
Hello, I just installed last version and I found a strange thing in the graphical view of USD return.
My USD balance is more than 10k ( in the funding settings page it shows correct amount) but in the graph it stop right axis to 10k.
is there a way to fix it?

thanks !



M.

link to screenshot :
https://ibb.co/iWEGYG



Wondering the same thing as I'm in the same boat.  It's not a critical issue but the reports from Bitfinex show the correct amount. The graph seems to have a maximum value set on the USD balance axis.


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: bons on December 11, 2017, 03:59:35 AM
Since you were already able to make it work once, just start with a fresh VM and from scratch, if it is only a hobby project?

A possible issue could be that the clock in your VM is off, read up on "NTP" how to fix that.
 :'( :'(


Title: Re: [ANN] MarginBot - A Bitfinex Margin Lending Management Bot
Post by: saikou999 on July 08, 2021, 05:26:00 PM
Hello,

Does this bot work well with currencies other than USD? For example, does it work with ETH or BTC? If so, is there any settings I need to manual change for ETH or BTC?

Thanks