-
Notifications
You must be signed in to change notification settings - Fork 0
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/oraidex support converter #3
Conversation
trung2891
commented
Sep 30, 2024
- Support convert asset
let pool_key = convert_pool_id_to_v3_pool_key(&operation.pool)?; | ||
let x_to_y = pool_key.token_x == operation.denom_in; | ||
hop_swap_requests.push(OraidexSwapOperation::SwapV3 { pool_key, x_to_y }); | ||
} else { |
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.
Should we specifically check if the operation is swap v2? A fallback to v2 can be risky. We can fallback to an error if the operation is neither v3 or v2
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.
we default swap through v2 if poolID is not of v3 format. Pool V2 only needs denom_in & denom_out to determine pool, and if this pool doesn't exist, it will throw pool not found in factory
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.
lgtm