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

Add Secta adapter #29

Merged
merged 3 commits into from
May 1, 2024
Merged

Add Secta adapter #29

merged 3 commits into from
May 1, 2024

Conversation

jac0x
Copy link
Contributor

@jac0x jac0x commented Mar 26, 2024

Secta Finance

DEX uniswap-style v2 & v3

Comment on lines 35 to 42
if (currentTick < tickLow) {
amount0 = BigInt(Math.floor(Number(liquidity) * ((sqrtRatioB - sqrtRatioA) / (sqrtRatioA * sqrtRatioB))));
} else if (currentTick >= tickHigh) {
amount1 = BigInt(Math.floor(Number(liquidity) * (sqrtRatioB - sqrtRatioA)));
} else if (currentTick >= tickLow && currentTick < tickHigh) {
amount0 = BigInt(Math.floor(Number(liquidity) * ((sqrtRatioB - sqrtPrice) / (sqrtPrice * sqrtRatioB))));
amount1 = BigInt(Math.floor(Number(liquidity) * (sqrtPrice - sqrtRatioA)));
}
Copy link
Contributor

Choose a reason for hiding this comment

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

hi, we are looking to remove inactive liquidity.

can you edit this part to not calculate any position that are out of range?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've removed first and second if statements.

@0xroll
Copy link
Contributor

0xroll commented Apr 16, 2024

Hi @lijac thanks for the PR.

for linea points calculation, we are only considering LP positions that are active (in range).

can you make changes to the codes ? you can also refer to sushi's PR : https://github.com/delta-hq/l2-lxp-liquidity-reward/pull/37/files

@jac0x
Copy link
Contributor Author

jac0x commented Apr 23, 2024

@0xroll I'm late, thanks for review.

I've updated code. How can I see if this is working in action? Is there a dashboard on your side?

From performance perspective, I see sushi's code is much simpler than ours. Is it a big deal?

@nitish-91 nitish-91 merged commit b91c604 into delta-hq:main May 1, 2024
1 check passed
@0xroll
Copy link
Contributor

0xroll commented May 3, 2024

@0xroll I'm late, thanks for review.

I've updated code. How can I see if this is working in action? Is there a dashboard on your side?

From performance perspective, I see sushi's code is much simpler than ours. Is it a big deal?

hey please check #95

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