-
Notifications
You must be signed in to change notification settings - Fork 15
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
Refactor/sor service #599
Conversation
modules/sor/sor.gql
Outdated
type GqlCowSwapApiResponse { | ||
tokenAddresses: [String!]! | ||
swaps: [GqlSwap!]! | ||
swapAmount: String! | ||
swapAmountForSwaps: String! | ||
returnAmount: String! | ||
returnAmountFromSwaps: String! | ||
returnAmountConsideringFees: String! | ||
tokenIn: String! | ||
tokenOut: String! | ||
marketSp: String! | ||
} |
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.
perhaps we could already remove fields they don't use:
marketSp
returnAmountConsideringFees
swapAmountForSwaps
they didn't confirm which fields they use, didn't they?
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.
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({ |
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.
V2 only?
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.
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({ |
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.
i like the name vs getSwap
moving, renaming and removing unused stuff.
Also adding on chain query for v2 swaps