Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: do not skip known indexes in price data table #71

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

dib542
Copy link
Contributor

@dib542 dib542 commented Mar 22, 2024

This PR attempts to fix the setting of LastTickIndex1To0 values in the derived.tx_price_data table.

Previously an update would be skipped if the price on the specific reserve's side TickIndex (HighestNormalizedTickIndex0 or LowestNormalizedTickIndex1 had not changed) had not changed. This is incorrect behavior.

The original intent of the HighestNormalizedTickIndex0 and LowestNormalizedTickIndex1 values was to create a "indicative price" of the pair where a reserve deposit that was "closer to the middle" than any other deposit or previous trade would indicate that the price had changed to that value. This was supposed to be helpful but is not that helpful. It may also even introduce attack vectors where users can influence the recorded price with small deposits at extreme positions.

It is much simpler to keep the definition of price as the last price that a trade occurred on, without accepting prices from any deposit events.

After removing the previous logic, the previous data columns for tracking HighestNormalizedTickIndex0 and LowestNormalizedTickIndex1 values were removed.

dib542 added a commit that referenced this pull request Apr 8, 2024
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