Content
@
https://warpcast.com/~/channel/miniapps
0 reply
0 recast
0 reaction
alexander
@attar
I'm glad we're alpha testing because we've already mitigated a flaw in the prediction market contract I'm building. https://warpcast.com/attar/0xb61066f4
2 replies
0 recast
3 reactions
alexander
@attar
We encountered a critical issue during the finalization of our game contracts: Uniswap V3's "OLD" error disrupted our 24-hour TWAP calculations. Here's a concise breakdown:
2 replies
0 recast
2 reactions
alexander
@attar
1/ Post-Mortem: Uniswap V3 'OLD' Error During Game Finalization Our game contract, referencing a Uniswap V3 pool for 24-hour TWAP calculations, failed at finalization due to an 'OLD' error.
1 reply
0 recast
1 reaction
alexander
@attar
2/ Cause of the Error Uniswap V3 pools store price observations in a fixed-size ring buffer. If the buffer isn't large enough for the entire TWAP period, older observations get overwritten. Attempting to retrieve a 24-hour TWAP without the necessary data triggers the 'OLD' error.
1 reply
0 recast
1 reaction
alexander
@attar
3/ Why This Wasn't Immediately Apparent No Visible Shrinking: The buffer size remains constant, but older data is silently overwritten by newer observations. Initial Success: Our contract's validation logic checked the pool's history during game creation. Early calls to observe(86400) succeeded because the buffer contained 24 hours of data. However, as more trades occurred, older observations were overwritten, leading to the error upon finalization.
1 reply
0 recast
1 reaction