BitBotFactory / MikaLendingBot

Automated lending on Cryptocurrency exchanges Poloniex and Bitfinex
http://poloniexlendingbot.readthedocs.io/en/latest/index.html
MIT License
1.11k stars 344 forks source link

HTTP Error 429 #334

Closed hax0n closed 7 years ago

hax0n commented 7 years ago

In the last few days I've been getting these errors while using the bot on PythonAnywhere

Log (Reversed ordered):
2017-05-11 02:35:46 Error: HTTP Error 429: Too Many Requests Requesting returnOpenLoanOffers
2017-05-11 02:34:45 Error: HTTP Error 429: Too Many Requests Requesting returnActiveLoans
2017-05-11 02:33:45 Error: HTTP Error 429: Too Many Requests Requesting returnAvailableAccountBalances
2017-05-11 02:32:44 Error: HTTP Error 429: Too Many Requests Requesting returnActiveLoans
2017-05-11 02:31:44 Error: HTTP Error 429: Too Many Requests Requesting returnOpenLoanOffers
2017-05-11 02:30:21 Error: HTTP Error 429: Too Many Requests Requesting returnActiveLoans
2017-05-11 02:29:21 Error: HTTP Error 429: Too Many Requests Requesting returnActiveLoans
2017-05-11 02:28:21 Error: HTTP Error 429: Too Many Requests Requesting returnActiveLoans

Started right after the recent DDoS/Lag issues over the last few days. I've also tried changing sleeptimeactive and sleeptimeinactive to longer time frames and the errors persist.

When I start the bot if there are any available funds a loan is generated but after that it seems the bot ceases to work and only spits out these errors.

<< My config file without the private stuff >>

[BOT]
#Sleeps between active iterations, time in seconds (1-3600)
sleeptimeactive = 60

#Sleeps between inactive iterations, time in seconds (1-3600)
#Set to the same value as sleeptimeactive to disable
sleeptimeinactive = 300

#Minimum daily lend rate in percent (0.0031-5)
#Setting to 0.0031 is about 1% a year, not worth it.
mindailyrate = 0.075

#Maximum lending rate. 2% is good choice because it's default at margin trader interface.
#5% is the maximum rate accepted by the exchange (0.003-5)
maxdailyrate = 5

#The number of offers to split the available balance across the [gaptop, gapbottom] range. (1-20)
spreadlend = 3

#The depth of lendbook (in percent of lendable balance) to move through
#before placing the first (gapbottom) and last (gaptop) offer.
#If gapbottom is set to 0, the first offer will be at the lowest possible rate.
#However some low value is recommended (say 10%) to skip dust offers.
gapbottom = 15
gaptop = 200

#Daily lend rate threshold after which we offer lends for x days as opposed to 2.
#If set to 0 all offers will be placed for a 2 day period (0.003-5)
xdaythreshold = 0.25
xdays = 2

#Auto-transfer of funds from exchange to lending balance.
#Enter ALL to transfer all coins, enter ACTIVE to transfer any coins you have in your lending account when the bot starts, these can be mixed.
#The currencies you enter below (comment it out to disable entirely, just leaving empty will result in an error) will be automatically transferred from your exchange balance to your lending balance whenever you deposit them.
#transferableCurrencies = STR,BTC,BTS,CLAM,DOGE,DASH,LTC,MAID,XMR,XRP,ETH,FCT

#Minimum loan size, the minimum size of offers to make, bigger values prevent the bot from loaning small available amounts but reduce loan fragmentation.
minloansize = 0.01

#Keep Stuck Orders - Sometimes an order gets partially filled. When this happens it may leave the remainder of your coin under the set minloansize.
#If this happens, KeepStuckOrders will keep your order where it is so maybe it can be filled. Otherwise it will be canceled and held until orders expire.
keepstuckorders = True

#Hide coins - Instead of keeping your coins lent out at minlendrate when it is not met, the bot will hold them and wait for the rate to surpass it.
hideCoins = True

#End date for lending, bot will try to make sure all your loans are done by this date so you can withdraw or do whatever you need.
#Uncomment to enable.
#Format: YEAR,MONTH,DAY
#endDate = 2016,12,25

#Raw maximum amount to lend if under maxtolendrate.
#If set to 0 or commented: the bot will check for maxpercenttolend.(0+)
#maxtolend = 0

#Maximum percent to lend if under maxtolendrate.
#If set to 0 or commented: the bot will lend 100% of your balance regardless of rate. (0-100)
#maxpercenttolend = 0

#Max to lend conditional rate.
#If set to more than 0: the maxtolend or maxpercenttolend will be used when the rate is less than or equal to the maxtolendrate.
#If set to 0 or commented: the bot will use the maxtolend or maxpercenttolend all the time. (0.0031-5)
#maxtolendrate = 0

# Local Market Analysis: Choose which coins to record the market of in order to analyse them and compute a recommended lending rate.
# Enter ALL to analyse all coins, enter ACTIVE to analyse the markets of any coins you have in your lending account when the bot starts, these can be mixed.
#analyseCurrencies = STR,BTC,BTS,CLAM,DOGE,DASH,LTC,MAID,XMR,XRP,ETH,FCT
# Choose how long to keep market data. (In days) (1-365)
#analyseMaxAge = 30
# Choose how often to record a market's rate. (In seconds.) (10-3600)
#analyseUpdateInterval = 60
# Choose how aggressive to lend at based on a market's performance. (As a percentile of the market's rate.) (1-99)
# Recommendations: Conservative = 50, Moderate = 75, Aggressive = 90, Very Aggressive = 99
#lendingStyle = 75

#Syntax: ["COIN:mindailyrate:maxactiveamount:maxtolend:maxpercenttolend:maxtolendrate",...]
#If maxactive amount is 0: stop lending this coin. in the future you'll be able to limit amount to be lent.
#If maxtolend is 0: check for maxpercenttolend.
#If maxpercenttolend is 0: 100% is going to be lent.
#If maxtolendrate is set to more than 0: the maxtolend or maxpercenttolend will be used when then rate is less or equal to the maxtolendrate. if set to 0 the bot will use the maxtolend or maxpercenttolend all the time.
# Please configure via the coinconfig line below OR individual coins in the [BTC], [CLAM], etc section. NOT both.
# coinconfig takes precedence
#coinconfig = ["BTC:0.18:1:0:0:0","CLAM:0.6:1:0:0:0"]

#This option creates a json log file instead of console output which includes the most recent status.
#Uncomment both jsonfile and jsonlogsize to enable.
#Keep this in the default location if you want to use the webserver.
jsonfile = www/botlog.json

#Limits the amount of log lines to save.
jsonlogsize = 300

#Enables a webserver for the www folder, in order to easily use the lendingbot.html with the .json log.
#startWebServer = true

#Customize the IP and port that the webserver is hosted on. Defaults to 0.0.0.0:8000
#0.0.0.0 will point to your default IP (Local IP on LAN as well as localhost), set to 127.0.0.1 if you want it to be only accessible by host computer.
#Do not set to a reserved port
#Advanced users only.
#customWebServerAddress = 0.0.0.0:8000

#The currency that the HTML Overview will present the earnings summary in.
#Options are BTC, USDT, ETH or anything as long as it has a direct BTC market. The default is BTC.
outputCurrency = BTC

# Currencies can be configured here, or in the coinconfig. Coinconfig takes precedence.
#[BTC]
#minloansize = 0.01
#mindailyrate = 0.18
#maxactiveamount = 1
#maxtolend = 0
#maxpercenttolend = 0
#maxtolendrate = 0

#[CLAM]
#minloansize = 1
#mindailyrate = 0.6
#maxactiveamount = 1
#maxtolend = 0
#maxpercenttolend = 0
#maxtolendrate = 0

[notifications]
notify_new_loans = True
notify_tx_coins = False
notify_xday_threshold = False
notify_summary_minutes = 0
notify_caught_exception = False

email = False
email_login_address = me@gmail.com
email_login_password = secretPassword
email_smtp_server = smtp.gmail.com
email_smtp_port = 465
email_to_addresses = me@gmail.com,you@gmail.com
rnevet commented 7 years ago

It's an issue on Poloniex side, you can open a support ticket see if they can do something or move your bot out of pythonanywhere so it doesn't share IP with other bots.

Zeek1010 commented 7 years ago

I;m also having the same issue. Have you contacted polo yet? Is anyone else experiencing this?

mike4001 commented 7 years ago

Had the same problem.

It seems in response to the recend DDoS attacks Poloniex has reduced the allowed connections per IP which basically renders pythonanywhere useless.

rnevet commented 7 years ago

I sent an email now to support, lets see when and if they can help.

I personally gave up a long time ago on running the bot on free services and am using Digital Ocean ~5$/month. (I can provide a 10$ referral, it's their standard.)

TVilaboa commented 7 years ago

Any news? I'm currently having the same trouble using PythonAnywhere

Zeek1010 commented 7 years ago

Dont use python anywhere. Im currently using digital ocean. Or you could prob use amazon's cloud servers

On Monday, June 12, 2017 7:21 AM, Tomas Vilaboa <notifications@github.com> wrote:

Any news? I'm currently having the same trouble using PythonAnywhere— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

mike4001 commented 7 years ago

Having the same issues with my raspberry Pi and my own connection/IP.

Poloniex is just being hammered right now ... will work again soon.

kingo55 commented 7 years ago

I think we need some sort of exponential back-off when this occurs.

Bots get stuck even on private IPs...

On Tue, 13 Jun 2017 at 02:00 mike4001 notifications@github.com wrote:

Having the same issues with my raspberry Pi and my own connection/IP.

Poloniex is just being hammered right now ... will work again soon.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/BitBotFactory/poloniexlendingbot/issues/334#issuecomment-307834799, or mute the thread https://github.com/notifications/unsubscribe-auth/ACQILH0RqhIMBW4PSR-pq8-eXrHnojGdks5sDWCpgaJpZM4NXcxm .

tamaskan commented 7 years ago

thats one of the scenarios where auto-switching to bitfinex would be nice ^^

rnevet commented 7 years ago

@tamaskan Would not help, as you won't be able to move funds...

rnevet commented 7 years ago

Should be improved by https://github.com/BitBotFactory/poloniexlendingbot/pull/387 adding an additional sleep in case of 429 errors.