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

Gyro 2-CLP and E-CLP dynamic and immutable info #1222

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

Conversation

joaobrunoah
Copy link
Contributor

Description

Gyro pools (2-CLP and E-CLP) should export dynamic and immutable data in the same way that Stable and Weighted pools do, and also inherit PoolInfo contract so that basic functions are available to compute the pool math off-chain.

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Dependency changes
  • Code refactor / cleanup
  • Optimization: [ ] gas / [ ] bytecode
  • Documentation or wording changes
  • Other

Checklist:

  • The diff is legible and has no extraneous changes
  • Complex code has been commented, including external interfaces
  • Tests have 100% code coverage
  • The base branch is either main, or there's a description of how to merge

Issue Resolution

Closes #1214

Copy link
Collaborator

@EndymionJkb EndymionJkb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good - just one substantive question about an apparent unrelated change in the swap path

Comment on lines +14 to +15
* @param sqrtAlpha Square root of alpha (the lowest price in the price interval of the 2CLP price curve)
* @param sqrtBeta Square root of beta (the highest price in the price interval of the 2CLP price curve)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @param sqrtAlpha Square root of alpha (the lowest price in the price interval of the 2CLP price curve)
* @param sqrtBeta Square root of beta (the highest price in the price interval of the 2CLP price curve)
* @param sqrtAlpha Square root of alpha (the lowest price in the price interval of the 2-CLP price curve)
* @param sqrtBeta Square root of beta (the highest price in the price interval of the 2-CLP price curve)

Just for consistency

* @param isPoolPaused If true, the pool is paused, and all non-recovery-mode state-changing operations will revert
* @param isPoolInRecoveryMode If true, Recovery Mode withdrawals are enabled, and live balances may be inaccurate
*/
struct GyroECLPPoolDynamicData {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the same as the 2-CLP; technically this structure and corresponding function could be shared (i.e., both pool interfaces inherit an additional IGyroPoolDynamicData interface). Not sure if it's worth it.

@@ -115,8 +126,7 @@ contract Gyro2CLPPool is IGyro2CLPPool, BalancerPoolToken {
(uint256 virtualParamIn, uint256 virtualParamOut) = _getVirtualOffsets(
balanceTokenInScaled18,
balanceTokenOutScaled18,
tokenInIsToken0,
request.kind
tokenInIsToken0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this argument change in _getVirtualOffsets? Is something not updated, or did another change slip in?

@EndymionJkb EndymionJkb changed the title Gyro 2-CLP and E-CLP dynamic and immutable infos Gyro 2-CLP and E-CLP dynamic and immutable info Jan 10, 2025
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.

Gyro Pools: View functions to calculate swaps off-chain
2 participants