Skip to content

Implementation of get_swap_rate_logic #107#109

Closed
anihdev wants to merge 2 commits intoskill-mind:mainfrom
anihdev:feature/Implementation_of_get_swap_rate_logic_107
Closed

Implementation of get_swap_rate_logic #107#109
anihdev wants to merge 2 commits intoskill-mind:mainfrom
anihdev:feature/Implementation_of_get_swap_rate_logic_107

Conversation

@anihdev
Copy link

@anihdev anihdev commented Jun 3, 2025

This PR implements the get_swap_rate_logic and wrote the essential tests ensuring

  • Query rate for TokenA to TokenB with 100 TokenA; verify returned rate matches expected value from pool reserves.
  • Edge Case: Pass invalid tokenIn or tokenOut (e.g., non-existent token); expect revert with "Invalid token".
  • Edge Case: Query rate for a pair with zero liquidity; expect revert with "Insufficient liquidity".
  • Edge Case: Pass amountIn = 0 (if applicable); expect revert or return a valid rate based on specification.
  • Edge Case: Query rate for same token pair (e.g., TokenA to TokenA); expect revert with "Invalid pair".

closes #107

@GoSTEAN
Copy link
Collaborator

GoSTEAN commented Jun 5, 2025

@anihdev Fix conflicts and resolve ci

@anihdev anihdev force-pushed the feature/Implementation_of_get_swap_rate_logic_107 branch from 832ef0d to 008f8ce Compare June 8, 2025 04:51
@GoSTEAN GoSTEAN closed this Jul 1, 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.

Implement get_swap_rate Function

2 participants

Comments