gnosis / prediction-market-agent-tooling

Tools to benchmark, deploy and monitor prediction market agents.
GNU Lesser General Public License v3.0
13 stars 0 forks source link

Track USD value of outcome tokens held by each agent on Dune dashboard #231

Open gabrielfior opened 4 months ago

gabrielfior commented 4 months ago

Both replicator agents (that fund markets) as well as trader agents (that buy outcome tokens) have a given balance of outcomeTokens for each market they interact with.

Currently we see in the Dune dashboard the number of outcome tokens for a given market by the replicator.

image

It would be nice to see the following 1 - Display the USD value of the outcome tokens it owns across all markets

ToDo - Move this issue to the Dune dashboard repo once created.

gabrielfior commented 4 months ago

Transactions + Liquidity added for market 0x8cfaec692ff8f4e5a6c686cce7f2e98e0ce5d7a7

Dune queries

amount feeAmount outcomeTokens reserves_Delta action outcomeIndex
10000000000000000000 10000000000000000000, 10000000000000000000 10000000000000000000, 10000000000000000000 add (0,1)
100000000000000000 2000000000000000 195048920578332343, 0 -97048920578332343, 98000000000000000 buy 0

User has bought 195048920578332343 tokens0 paying 100000000000000000 (0.1 xDai) Reserves now are 10000000000000000000 - 97048920578332343 = 9902951079421667657 tokens0 and 10000000000000000000 + 98000000000000000 tokens1

I described my understanding using this Google sheet.