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

Refactor TokenAdjacency and TokenAdjacencyBuilder [TKR-324] #517

Merged
merged 5 commits into from
Jul 18, 2022

Conversation

kyu-c
Copy link
Collaborator

@kyu-c kyu-c commented Jul 14, 2022

Description

  • Factor out interface TokenAdjacency and its utility functions (builder, and getIntermedidateTokens into classes.
  • Added tests!
  • The new TokenAdjacencyBuilder ensures that token addresses are lower-cased so that the user of TokenAdjacency does not need to worry about sanitizing token addresses.
  • Add addBidirectional and addCompleteSubgraph in TokenAdjacencyBuilder
    • In the vast majority of the case, liquidity is bi-directional
    • addCompleteSubgraph will be useful for a case where a set of tokens can be swapped among each other (the major use case would be Synthetix atomic swap).

Testing instructions

  • Did local testing with pairs requiring multihiop (cvxCRV, wstETH)

Types of changes

Checklist:

  • Prefix PR title with [WIP] if necessary.
  • Add tests to cover changes as needed.
  • Update documentation as needed.
  • Add new entries to the relevant CHANGELOG.jsons. (will be done before this PR is merged).

@kyu-c kyu-c merged commit b72b8b5 into development Jul 18, 2022
@kyu-c kyu-c deleted the chore/token-adj-graph branch July 18, 2022 20:02
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.

2 participants