chief-gant / SplinterlandsTraderBot

A trading bot written in Python that makes a profit by buying underpriced cards and quickly reselling them.
18 stars 0 forks source link

API Issues #5

Closed knightblaster closed 2 years ago

knightblaster commented 2 years ago

Getting this:

The Splinterlands API seems to be down or non-responding. We have to wait until its back up.

Might it be because of this: API: deprecating market/for_sale and market/for_rent from https://docs.splinterlands.com/platform/release-notes#2021-12-20 ? If so, maybe a quick fix in the code can help solve this? :)

royruzaini commented 2 years ago

Happen to me too

chief-gant commented 2 years ago

That endpoint is deprecated, and currently there doesn't appear to be another endpoint from which I can get the listings. So until they add a new endpoint the bot won't be working.

I will explore new alternatives in case they don't add a new endpoint, but that will take some time.

knightblaster commented 2 years ago

Would it be possible to use /market/for_sale_grouped ?

chief-gant commented 2 years ago

/market/for_sale_grouped doesn't give you the listings, so it's no good.

However, I'm exploring some alternatives; mainly, using /market/for_sale_by_card. The problem with for_sale_by_card is that the info is for a single card, including whether it's gold and it's edition. So I would have to make ~1000 API calls for every card-regular/gold-#edition to build the listings.

So far it looks solid, but it takes considerably longer (~8-9 mins). It's better than nothing of course, and I might improve it by filtering the cards by some criteria. More on that soon.

chief-gant commented 2 years ago

Alright, I finally pushed the fix. Now it takes longer (~9 min if you use all of the card sets) to fetch the market listings. You can also select which sets (or editions) the bot will take into account, which reduces the amount of time it takes to fetch the data.

Please try it out and let me know how it goes.

chief-gant commented 2 years ago

It seems to be working at some degree for some people. At the very least, I got a couple of commissions these last few minutes, so that's a good sign.

royruzaini commented 2 years ago

it seem to work but take longer time compare to before

chief-gant commented 2 years ago

That's to be expected. If anything changes related to the API endpoints, I'll try to make it work faster.

knightblaster commented 2 years ago

Seems to be working for me as well... cheers for the quick fix! :)