metaDAOproject / meta-dao-frontend

https://app.themetadao.org
Other
16 stars 16 forks source link

Missing TWAP value if the only recorded value is the initial value #11

Closed jshiohaha closed 4 months ago

jshiohaha commented 4 months ago

Describe the bug

There is no TWAP value in the edge case that the only recorded value on-chain is the initial value.

To Reproduce Steps to reproduce the behavior:

  1. Go to proposal 9 on the deployed site: https://app.themetadao.org/proposal?id=9
  2. Scroll down to the fail market conditional markets card
  3. See missing TWAP
Screenshot 2024-02-19 at 22 54 47

Expected behavior

Expect a TWAP value to always be returned, as long as oracle is defined. Below, you can see the TWAP value displayed on my localhost environment.

Note: as is currently configured, 10_000 (1 * 1e4) is the initially configured TWAP value.

Screenshot 2024-02-19 at 22 55 00

Additional context

First reported by Taipan in the metadao discord https://discord.com/channels/1155877543174475859/1178032815221264405/1209363962840490005

jshiohaha commented 4 months ago

Closing, as associated PR was merged