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

feat: add Range order pool price to the pool_price_v2 rpc call #4548

Merged
merged 4 commits into from
Feb 29, 2024

Conversation

syan095
Copy link
Contributor

@syan095 syan095 commented Feb 20, 2024

Pull Request

Closes: PRO-1050

Checklist

Please conduct a thorough self-review before opening the PR.

  • I am confident that the code works.
  • I have updated documentation where appropriate.

Copy link
Collaborator

@dandanlen dandanlen left a 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 ?

@@ -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)> {
Copy link
Contributor

@AlastairHolmes AlastairHolmes Feb 23, 2024

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.

Copy link
Contributor Author

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
Copy link

codecov bot commented Feb 27, 2024

Codecov Report

Attention: Patch coverage is 0% with 7 lines in your changes are missing coverage. Please review.

Project coverage is 73%. Comparing base (3b1ba4e) to head (44c5245).
Report is 1 commits behind head on main.

Files Patch % Lines
state-chain/amm/src/lib.rs 0% 3 Missing ⚠️
state-chain/amm/src/range_orders.rs 0% 3 Missing ⚠️
state-chain/pallets/cf-pools/src/lib.rs 0% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

@dandanlen dandanlen enabled auto-merge (squash) February 29, 2024 13:08
@dandanlen dandanlen changed the title Added Range order pool price to the pool_price_v2 rpc call feat: add Range order pool price to the pool_price_v2 rpc call Feb 29, 2024
@dandanlen dandanlen merged commit 2288510 into main Feb 29, 2024
40 of 42 checks passed
@dandanlen dandanlen deleted the chore/rpc-range-order-price branch February 29, 2024 14:18
syan095 added a commit that referenced this pull request Feb 29, 2024
…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)
syan095 added a commit that referenced this pull request Feb 29, 2024
…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
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.

3 participants