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

Feat/oraidex support converter #3

Merged
merged 16 commits into from
Oct 8, 2024
Merged

Conversation

trung2891
Copy link
Member

  • Support convert asset

contracts/adapters/swap/oraidex/src/contract.rs Outdated Show resolved Hide resolved
contracts/adapters/swap/oraidex/src/helper.rs Outdated Show resolved Hide resolved
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 {
Copy link
Collaborator

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

Copy link
Member Author

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

@trung2891 trung2891 requested a review from ducphamle2 October 7, 2024 10:12
Copy link
Collaborator

@ducphamle2 ducphamle2 left a comment

Choose a reason for hiding this comment

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

lgtm

@trung2891 trung2891 merged commit bf90265 into main Oct 8, 2024
2 of 5 checks passed
@trung2891 trung2891 deleted the feat/oraidex-support-converter branch October 8, 2024 02:04
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