-
Notifications
You must be signed in to change notification settings - Fork 117
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
Cast oracle price to bigint and then numeric to get proper values #2689
Conversation
Signed-off-by: Shrenuj Bansal <[email protected]>
WalkthroughThe changes involve modifications to test constants and a SQL function related to market price updates. The primary focus is on handling markets with very low exponent values. A new test constant Changes
Sequence DiagramsequenceDiagram
participant Test as Market Price Update Test
participant Handler as Price Update Handler
participant DB as Database
Test->>Handler: Trigger with low exponent market event
Handler->>DB: Calculate oracle price
DB-->>Handler: Return processed price
Handler-->>Test: Confirm price calculation
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (4)
🧰 Additional context used📓 Learnings (1)indexer/services/ender/src/scripts/handlers/dydx_market_price_update_handler.sql (1)
⏰ Context from checks skipped due to timeout of 90000ms (10)
🔇 Additional comments (5)
Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Changelist
Currently, the conversion of the calculated oracle price to a numeric type leads to truncation for some reason which leads to an oracle price of 0
The solution here is to first cast the calculated value to a bigint and follow that with a numeric
Test Plan
Added test
Author/Reviewer Checklist
state-breaking
label.indexer-postgres-breaking
label.PrepareProposal
orProcessProposal
, manually add the labelproposal-breaking
.feature:[feature-name]
.backport/[branch-name]
.refactor
,chore
,bug
.Summary by CodeRabbit
Release Notes
New Features
Bug Fixes
Tests
The changes improve the system's ability to handle market price updates with extremely precise pricing models, ensuring accurate data processing and representation.