-
Notifications
You must be signed in to change notification settings - Fork 33
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 staked amounts, add position amounts and prices #48
Conversation
contracts/LpSugar.vy
Outdated
@@ -559,11 +583,15 @@ def _byData(_data: address[4], _token0: address, _token1: address, \ | |||
id: 0, | |||
liquidity: acc_balance, | |||
staked: acc_staked, | |||
amount0: ((acc_balance + acc_staked) * reserve0) / pool_total_supply, | |||
amount1: ((acc_balance + acc_staked) * reserve1) / pool_total_supply, |
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.
Let's add staked0 and staked1 too here to separate these
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.
Added, lmk if the way I did it makes sense
contracts/LpSugar.vy
Outdated
@@ -640,15 +673,28 @@ def _byDataCL(_data: address[4], _token0: address, _token1: address, \ | |||
fee_voting_reward = gauge.feesVotingReward() | |||
emissions_token = gauge.rewardToken() | |||
|
|||
if gauge_alive: | |||
emissions = gauge.rewardRate() | |||
# fetch total staked liquidity from the ticks surrounding current 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.
I think we can just use this, no?
https://github.com/velodrome-finance/slipstream/blob/main/contracts/core/interfaces/pool/ICLPoolState.sol#L78-L80
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.
Added ty
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.
✨
* feat: add staked amounts, add position amounts and prices * feat: add staked/staked1 to Position * refactor: use active tick staked liquidity on CL Lp
* feat: add staked amounts, add position amounts and prices * feat: add staked/staked1 to Position * refactor: use active tick staked liquidity on CL Lp
No description provided.