-
Notifications
You must be signed in to change notification settings - Fork 15
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
feat: add Range order pool price to the pool_price_v2 rpc call #4548
Conversation
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.
Looks fine to me. @AlastairHolmes ?
state-chain/amm/src/lib.rs
Outdated
@@ -57,6 +57,14 @@ impl<LiquidityProvider: Clone + Ord> PoolState<LiquidityProvider> { | |||
}) | |||
} | |||
|
|||
/// Returns the Range Order sub-pool's current price. | |||
/// SwapDirection is ignored as the price are the same for both directions. | |||
pub fn current_range_order_pool_price(&mut self) -> Option<(Price, SqrtPriceQ64F96, Tick)> { |
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.
So we want to just use the value in range_orders::PoolState::current_sqrt_price (which is not optional), because this is for calculating range order values, not for swaps.
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.
Done!
…-price * origin/main: feat(custom-rpc): add broker info [WEB-925] (#4560) chore: upgrade solana version (#4567) fix: continuous adapter (PRO-684) (#4503) fix: Wait for ThresholdSignature success before switching to NewKeysActivated (#4534) chore: remove un-needed serde derives from EncodedAddress (#4565) fix: more lenient max deposit fee in bouncer test (#4564) chore: build persa bins instead of fetch (#4554) feat: deploy L2 contracts upon localnet startup and send L2 TXs 📑 (#4558) feat: debug logs on runtime upgrade test (#4556) feature/PRO-1038/pool-fee-rpc (#4459) chore: update bootnodes in chainspec ✨ (#4456) fix: allow test coverage to run (#4555) refactor/pro-1160/remove-side-side-map (#4489) fix: activate missing migrations (#4550) chore: remove cf-build (#4551) # Conflicts: # state-chain/pallets/cf-pools/src/lib.rs
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4548 +/- ##
=====================================
- Coverage 73% 73% -0%
=====================================
Files 401 401
Lines 66738 66745 +7
Branches 66738 66745 +7
=====================================
- Hits 48418 48417 -1
- Misses 15975 15982 +7
- Partials 2345 2346 +1 ☔ View full report in Codecov by Sentry. |
…utxo * origin/main: feat: expose command for broker fee withdrawal (#4581) Chore/fix arbitrum deployment (#4570) Added Range order pool price to the pool_price_v2 rpc call (#4548) fix: just check that the balance after is greater than before (#4587) chore: add origin to ccm failed (#4586) fix: runtime upgrade state check uses AllPalletsWithoutSystem (#4583) chore: add zellic audit to repo (#4585) fix: disable try-state checks (#4576) chore: debug solana in CI 🐛 (#4580) refactor: pass tx_ref as an extrinsic parameter (#4579) fix: remove bounded balance check (#4575) Solana: update image to latest tag (#4574) feat: add boost lp account to bouncer and fund it on setup_swaps (#4552) feat: Expose tx_hash on BroadcastSuccess event (#4561) feat: Relative Slippage Limits (PRO-1207) (#4547) chore: disable localnet solana in CI ⏱️ (#4569) feat: store prewitnessed deposits with id (#4496) Feat: Scheduled Swaps Subscription (#4525)
…ero-liquidity * origin/main: feat: expose command for broker fee withdrawal (#4581) Chore/fix arbitrum deployment (#4570) Added Range order pool price to the pool_price_v2 rpc call (#4548) fix: just check that the balance after is greater than before (#4587) chore: add origin to ccm failed (#4586) fix: runtime upgrade state check uses AllPalletsWithoutSystem (#4583) chore: add zellic audit to repo (#4585) # Conflicts: # Cargo.lock
Pull Request
Closes: PRO-1050
Checklist
Please conduct a thorough self-review before opening the PR.