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/sor service #599

Merged
merged 10 commits into from
Dec 20, 2023
Merged

Refactor/sor service #599

merged 10 commits into from
Dec 20, 2023

Conversation

franzns
Copy link
Contributor

@franzns franzns commented Dec 15, 2023

moving, renaming and removing unused stuff.
Also adding on chain query for v2 swaps

@franzns franzns requested a review from gmbronco December 15, 2023 10:37
Comment on lines 24 to 35
type GqlCowSwapApiResponse {
tokenAddresses: [String!]!
swaps: [GqlSwap!]!
swapAmount: String!
swapAmountForSwaps: String!
returnAmount: String!
returnAmountFromSwaps: String!
returnAmountConsideringFees: String!
tokenIn: String!
tokenOut: String!
marketSp: String!
}
Copy link
Contributor

Choose a reason for hiding this comment

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

perhaps we could already remove fields they don't use:

marketSp
returnAmountConsideringFees
swapAmountForSwaps

they didn't confirm which fields they use, didn't they?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

agree, will remove once I know what they use

// args.swapAmount is RawScale, e.g. 1USDC should be passed as 1000000
const amount = await getTokenAmountRaw(amountToken, args.swapAmount, args.chain!);

const swap = await sorV2Service.getSwapResult({
Copy link
Contributor

Choose a reason for hiding this comment

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

V2 only?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, balancer chains dont support a V1

// args.swapAmount is HumanScale
const amount = await getTokenAmountHuman(amountToken, args.swapAmount, args.chain!);

const swap = await this.getComparingSwap({
Copy link
Contributor

Choose a reason for hiding this comment

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

i like the name vs getSwap

@franzns franzns mentioned this pull request Dec 20, 2023
3 tasks
@franzns franzns merged commit 2fa7fe5 into v3-canary Dec 20, 2023
1 check passed
@franzns franzns deleted the refactor/sor-service branch December 20, 2023 14:35
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