Open kongzii opened 3 months ago
Here's what I know
-> Subgraph only serves the latest history hash (not all previous history hashes)
-> If there's a second answer, what happens?
a. Second answer is correct - market creator will try to claim bond, unsuccessful (OK, as its answer was wrong)
b. Second answer is incorrect - market creator will try to claim bond, unsucessful (NOT OK, because its answer was correct and claim should have been possible, but history hash will not match the one from the answer)
In conclusion, fetching history_hash from the subgraph is not working for this. My understanding is that responses
should be queried, since they contain the different history_hash
corresponding to each new answer.
We fixed it in our repo at https://github.com/gnosis/prediction-market-agent-tooling/pull/368
According to Realitio docs, only the latest history hash is stored in the question struct:
If multiple answers were submitted, and we query them on subgraph, we can see it:
All the returned history hashes are the same. (it's this question)
And that's why the following code https://github.com/kongzii/trader/blob/main/packages/valory/skills/market_manager_abci/graph_tooling/requests.py#L297:
submits invalid hashes if there are multiple different answers and claiming of bonds fails.