feat(test): add fee AMM tests for liquidity operations#265
Merged
Conversation
35a13c1 to
7bbe8a5
Compare
0xKitsune
reviewed
Sep 18, 2025
7bbe8a5 to
6d6ce2a
Compare
This was referenced Sep 19, 2025
6d6ce2a to
1a60def
Compare
1a60def to
e0935ce
Compare
0xKitsune
approved these changes
Sep 19, 2025
|
|
||
| // Calculate expected liquidity (sqrt(amount0 * amount1) - MIN_LIQUIDITY) | ||
| // Since amounts are equal, sqrt(amount0 * amount1) = amount0 = amount1 | ||
| // But we use the formula: (amount0 * amount1) / sqrt(2) - MIN_LIQUIDITY |
Contributor
There was a problem hiding this comment.
nit: looks like this comment is incorrect, we are using uint!(2_U256) instead of sqrt(2).
Comment on lines
+563
to
+570
| assert!( | ||
| user_balance0_after > user_balance0_before, | ||
| "Should receive userToken" | ||
| ); | ||
| assert!( | ||
| user_balance1_after > user_balance1_before, | ||
| "Should receive validatorToken" | ||
| ); |
Contributor
There was a problem hiding this comment.
Wdyt about asserting actual values here since we know the balance before and expected amounts?
fgimenez
added a commit
that referenced
this pull request
Sep 19, 2025
fgimenez
added a commit
that referenced
this pull request
Sep 19, 2025
fgimenez
added a commit
that referenced
this pull request
Sep 22, 2025
…rence (#279) ported from reference implementation https://github.com/tempoxyz/specs/blob/fee-manager/test/StableAMM.t.sol ref #265 the tests are defined as unit tests bc the covered functionality is not exposed externally. also, some tests that hit overflow are ignored, same as in solidity
legion2002
pushed a commit
that referenced
this pull request
Oct 9, 2025
* feat(test): add fee AMM tests for pool and liquidity operations * consolidate pool creation tests into a single one
legion2002
pushed a commit
that referenced
this pull request
Oct 9, 2025
legion2002
pushed a commit
that referenced
this pull request
Oct 9, 2025
…rence (#279) ported from reference implementation https://github.com/tempoxyz/specs/blob/fee-manager/test/StableAMM.t.sol ref #265 the tests are defined as unit tests bc the covered functionality is not exposed externally. also, some tests that hit overflow are ignored, same as in solidity
unbalancedparentheses
pushed a commit
to unbalancedparentheses/tempo
that referenced
this pull request
Feb 23, 2026
…oxyz#265) * feat(test): add fee AMM tests for pool and liquidity operations * consolidate pool creation tests into a single one
unbalancedparentheses
pushed a commit
to unbalancedparentheses/tempo
that referenced
this pull request
Feb 23, 2026
unbalancedparentheses
pushed a commit
to unbalancedparentheses/tempo
that referenced
this pull request
Feb 23, 2026
…rence (tempoxyz#279) ported from reference implementation https://github.com/tempoxyz/specs/blob/fee-manager/test/StableAMM.t.sol ref tempoxyz#265 the tests are defined as unit tests bc the covered functionality is not exposed externally. also, some tests that hit overflow are ignored, same as in solidity
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ported from reference implementation https://github.com/tempoxyz/specs/blob/fee-manager/test/StableAMM.t.sol
still not ported: