Username: Password:

Author Topic: Preventing 422 Errors  (Read 21961 times)

Snowman418

  • Guest
Preventing 422 Errors
« on: June 20, 2017, 05:10:49 PM »
Gunthy,  you need to address this through software efficiency.

Your program needs a heartbeat where it gets the price of every coin (using api methods returnTicker()  or returnOrderBook()). Your program then uses that data for all pairs. So instead of having each pair making a request every 60 seconds, you make one, and each pair then references the cache in your program. The only additional calls are buys and sells.

Additionally, your software doesn't take advantage of the returnChartData() method to establish moving averages and BB. Which it should do....

Implement these two changes and your users will again have a positive experience using gunbot.

Offline citedjade

  • Rookie
  • *
  • Posts: 3
    • View Profile
Re: Preventing 422 Errors
« Reply #1 on: June 20, 2017, 05:41:29 PM »
hope Gunthy will see that.

Offline OutOfSync

  • Rookie
  • *
  • Posts: 11
    • View Profile
Re: Preventing 422 Errors
« Reply #2 on: June 20, 2017, 06:52:30 PM »
1) one-in-all gunbot version:
The next version will do exactly that, it will run all pairs within one instance of gunbot. So the orderbook and price data etc will all be shared for all paris on one exchange. Gunthy anounced that in the telegram group a few days ago. It is still in testing phase. I am really excited to see the release!

2) there seems to be a proxy solution for Poloniex (also mentioned in the telegram chat). There were some really impressive results with 4s delay without 422 errors. Its 0.1 BTC, though, and the next version of gbot might already have a fix. Overall, I did not find much information about the proxy, if anyone finds something please post it! Would be useful to judge the price tag of the proxy.

3) I already suggested using the chart data to initialize the LP array for BB and the trendwatcher. This would be an awesome improvement I think!
https://gunthy.org/index.php?topic=480.0

Offline evmann86

  • Rookie
  • *
  • Posts: 1
    • View Profile
Re: Preventing 422 Errors
« Reply #3 on: June 20, 2017, 07:00:09 PM »
An idea I had, unsure of the feasibility or difficulty of implementing, but I thought I'd share anyway. Posted this in the Telegram earlier:

I assume that every period, GUNBOT makes a call to Polo for price information and then stores that locally on the machine where GUNBOT is being run. But what if that info was able to be shared, so that not every GUNBOT instance had to always be calling to Polo to get price? They could call to a GUNBOT server instead, to get more reliable and contant price updates?

So, the order would be this: GUNBOT calls to GBServer for price updates. If GBserver's price is not up to date, GUNBOT attempts a call to Polo, and if successful, shares that info w/ GBserver so that the next instance of GUNBOT can take advantage of that info w/o hitting the Polo server again. Buys would still obv. have to be placed directly to Polo but price queries would not always have to be.

So, each GUNBOT instance would be helping to keep the GBServer updated. The GBserver itself could make price calls as well. Someone else (Nibaru) then commented that: "or, probably more efficient is to just subscribe to the websocket ticker. GB server would get pushes automatically."

Anyway, just my two cents, I am a new GUNBOT user and it seems the 422s have really put a damper on the experience. I wasn't here before to see what it was like. I know that Gunthar is working on his own solution to the 422s, so here's to him for all of his hard work.

Cheers,
Evan

Offline allanster

  • Contributor
  • **
  • Posts: 128
  • lux ex tenebris • deuro mea umbra absens
    • View Profile
Re: Preventing 422 Errors
« Reply #4 on: June 30, 2017, 10:42:17 AM »
@evmann86

Wow, I had this identical idea this evening. Great minds must think alike. Crowdsource Polo's data so we can initialize faster to BB.
more human than human

Offline bney

  • Rookie
  • *
  • Posts: 33
    • View Profile
Re: Preventing 422 Errors
« Reply #5 on: July 02, 2017, 05:32:49 PM »
It seems that the push approach to updates might also allow the bot to respond faster to short spikes or drops in price which seem to be missed with the poling every couple minutes method. It could then be basically interrupt driven to buy or sell in shorter windows.

Offline allanster

  • Contributor
  • **
  • Posts: 128
  • lux ex tenebris • deuro mea umbra absens
    • View Profile
Re: Preventing 422 Errors
« Reply #6 on: July 03, 2017, 12:44:18 AM »
I'm curious if Gunbot is using returnTradeHistory or not? If not, why not?

If default BB is 60/120 w/300 then we must wait 5-10 hours after pair start before we can even begin trading. According to Poloniex using the call below we could have 2/3rd of that data to start with OR possibly all of it based off pulling date range.

I'm guessing from their example the date range query is using epoch time, so the question there is if it's available up to real time point or at least up to 200 trades back, Gunbot could (query the 200) + (query the 201-300 by date range) = 300 trades, and then pair could start with BB mode near instantly. See... https://poloniex.com/support/api/

returnTradeHistory
Returns the past 200 trades for a given market, or up to 50,000 trades between a range specified in UNIX timestamps by the "start" and "end" GET parameters. Sample output:

[{"date":"2014-02-10 04:23:23","type":"buy","rate":"0.00007600","amount":"140","total":"0.01064"},{"date":"2014-02-10 01:19:37","type":"buy","rate":"0.00007600","amount":"655","total":"0.04978"}, ... ]

Call: https://poloniex.com/public?command=returnTradeHistory&currencyPair=BTC_NXT&start=1410158341&end=1410499372
« Last Edit: July 03, 2017, 12:46:13 AM by allanster »
more human than human

Offline allanster

  • Contributor
  • **
  • Posts: 128
  • lux ex tenebris • deuro mea umbra absens
    • View Profile
Re: Preventing 422 Errors
« Reply #7 on: July 03, 2017, 06:02:32 PM »
more human than human