get_stakes() needs updating
bitfilms opened this issue · 1 comments
bitfilms commented
Hi -
Trying to call get_stakes() as per the docs with something like this:
napi = numerapi.NumerAPI( PUBLIC_ID, SECRET_KEY)
napi.get_stakes( MODEL_ID)
Throws an error.
2021-02-12 14:40:24,678 ERROR numerapi.base_api: Cannot query field "stakeTxs" on type "Model". Did you mean "stakeBonusPayments" or "v2Stake"?
--------------------
ValueErrorTraceback (most recent call last)
<ipython-input-7-9d5a0bb1c65f> in <module>
----> 1 napi.get_stakes()
~/.pyenv/versions/3.7.9/envs/dev/lib/python3.7/site-packages/numerapi/numerapi.py in get_stakes(self, model_id)
881 """
882 arguments = {'modelId': model_id}
--> 883 data = self.raw_query(query, arguments, authorization=True)['data']
884 stakes = data['model']['stakeTxs']
885 # convert strings to python objects
~/.pyenv/versions/3.7.9/envs/dev/lib/python3.7/site-packages/numerapi/base_api.py in raw_query(self, query, variables, authorization)
118 err = self._handle_call_error(result['errors'])
119 # fail!
--> 120 raise ValueError(err)
121 return result
122
ValueError: Cannot query field "stakeTxs" on type "Model". Did you mean "stakeBonusPayments" or "v2Stake"?
I might be missing something obvious but I'm passing in a model UUID as guided. Thoughts?
Thanks in advance,
-- chris
uuazed commented
Hi!
Thanks for finding and reporting that issue.
get_stakes
was a leftover from some previous iteration of the tournament, where participants needed to stake every round. Back then, it was useful to get a model's stake per round. The tournament has changed in the meantime and apparently the numerai guys decided toremove that information from their graphql api, which numerapi relies on.
To resolve the issue, I removed get_stakes
endpoint completely.