-
Notifications
You must be signed in to change notification settings - Fork 24
fix: bob money market #1132
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: bob money market #1132
Conversation
🦋 Changeset detectedLatest commit: dc255c6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Deploy Preview for sovryn-storybook canceled.
|
✅ Deploy Preview for sovryn-dapp ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes issues with the BOB money market by refactoring how spot prices and position balances are calculated. The changes address calculation inconsistencies and remove redundant logic for handling LP token balances.
Key changes:
- Replaced dynamic spot price queries with static price values from pool metadata
- Removed duplicate LP token balance handling logic from position queries
- Added
extrafield serialization to Pool class
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/sdk/src/indexer/pools/pool.ts | Added serialization of extra field in Pool's serialize() method |
| apps/frontend/src/app/5_pages/MarketMakingPage/components/BobWIthdrawModal/BobWithdrawModal.tsx | Refactored to use static display price and updated position with LP token balance instead of querying wallet |
| apps/frontend/src/app/5_pages/MarketMakingPage/components/AmbientMarketMaking/hooks/useGetPositionsTotalBalance.ts | Replaced usePoolSpotPrice hook with static price calculation from pool metadata |
| apps/frontend/src/app/5_pages/MarketMakingPage/components/AmbientMarketMaking/hooks/useGetAmbientPositions.ts | Removed complex LP token balance handling logic and wallet queries |
| apps/frontend/src/app/5_pages/MarketMakingPage/components/AmbientMarketMaking/components/AmbientPoolPositions/hooks/usePoolSpotPrice.ts | Deleted entire file as spot price queries are no longer needed |
| apps/frontend/src/app/5_pages/MarketMakingPage/components/AmbientMarketMaking/components/AmbientPoolPositions/hooks/useAmbientPositionBalance.ts | Replaced usePoolSpotPrice with static price calculation, added optional priceOverride parameter |
| apps/frontend/src/app/5_pages/MarketMakingPage/components/AmbientMarketMaking/components/AmbientPoolPositions/components/AmbientPositionBalance/AmbientPositionBalance.tsx | Added priceOverride prop and simplified by removing token detail lookups |
| apps/frontend/src/app/5_pages/MarketMakingPage/components/AmbientMarketMaking/components/AmbientPoolPositions/AmbientPoolPositions.utils.ts | Added validation to check if spotPrice is finite |
| apps/frontend/src/app/5_pages/MarketMakingPage/components/AmbientMarketMaking/AmbientMarketMaking.tsx | Updated query key for better cache specificity |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
https://sovryn.atlassian.net/browse/SOV-5277
https://sovryn.atlassian.net/browse/SOV-5284