Closed xianny closed 4 years ago
Thanks for the review @barakman ! I made some changes, please re-review.
The first force-push is just to rebase off bancorprotocol:master
. No changes to the first commit.
Hey y'all, I think we've addressed the comments so far, would appreciate another look whenever you have a chance!
hey, we just released the new version.
Thank you!
Support contract multicall for multiple input amounts at once.
For context, this is necessary for integrating Bancor liquidity into 0x API. When calculating a quote, we request rates for multiple input amounts to find the best rates to compose the total target amount of the quote. Discussed details with @yudilevi off-thread.
This PR modifies the
getRates
functions to support requesting rates for multiple input amounts in the same contract multicall. The output is is the rates per path, grouped by amount. E.g.:Interface changes:
getPathAndRates
to the Pricing moduleCore
module,getPathAndRate
is now renamed togetPathAndRates
. The function signature has changed too. However this is a private module so hopefully not a breaking changeBlockchain
interface,getRates(Token[][], string): Promise<string[]>
is nowgetRates(Token[][], string[]): Promise<string[][]>