Skip to content

Conversation

@mannutech
Copy link

@mannutech mannutech commented Sep 12, 2025

  • Added safeUpdatePoolPrice function to ensure price updates are validated against previous prices with a defined jump factor.
  • Introduced isSane function to check price sanity based on a maximum allowed price change.
  • Updated handleSwap to utilize the new price update logic, improving price integrity during swaps.
  • Added MAX_JUMP_FACTOR constant to control price movement limits.

Net effect: no schema changes; subgraph no longer persists corrupted price/tick, avoids ETH/USD inversion, and remains robust if slot0 call reverts or both sources are bad.

Todo: Extend the same changes to the lite subgraph as well

- Added `safeUpdatePoolPrice` function to ensure price updates are validated against previous prices with a defined jump factor.
- Introduced `isSane` function to check price sanity based on a maximum allowed price change.
- Updated `handleSwap` to utilize the new price update logic, improving price integrity during swaps.
- Added `MAX_JUMP_FACTOR` constant to control price movement limits.
- Deleted legacy code that addressed pricing issues for a specific block (18450862) in the handleSwap function.
- This cleanup improves code readability and maintains focus on current pricing logic.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant