-
Notifications
You must be signed in to change notification settings - Fork 13
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
Extend multi-callee with auto router #527
Comments
is this necessary to specify in the config?:
i fail to see the use case for the |
are you referring to the i'm failing to pinpoint where exactly routes' generation takes place in |
What's your proposal? I think the types should enforce that either
No. Currently the
Currently there is no generation, |
the part after the question mark makes sense. The question I raised is rather to discover some additional app-logic/story that i am not aware of, not in order to adjust the datastructure.
👍🏻
👍🏻 one more q:
error
intentionally merged like this? does scope of this pr include fixing those? or is my setup somehow deviant? |
I checked out |
ok, sorry for the hussle for no reason: my shell aliases went out of control (typo) and git-stash-pop got executed unintentionally. |
just to be clear, the change introduced via this issue should not alter the logic of should routes of the non-automatic callees be mapped into pools as well? |
Hard to say, but they are related in a way. Maybe in order to avoid broader changes, instead of replacing |
Ok, works. Next question: after looking at how to approach this cleanly i've encountered the problem with typing and i am trying to avoid the mess.
|
Not sure what exactly the problem is, but, we're doing similar thing (like accessing
So to my understanding all you need to do is:
|
Ok, such option is clear but isn't it somehow undesired due to us limiting the expected set of callees? That is, if we would like to add another callee that also supports auto routing, then we would have to not only adjust the collateral config (add the callee to relevant collaterals), but also adjust code so that the if conditions allow the code to execute? |
If you don't need config to enforce callee name, then you can create export declare interface RoutableCalleeConfig {
callee: RegularCalleeConfig['callee']
autoRouter: boolean;
} And it will still enforce the same thing, but without checking the callee name? You can also use |
Since I don't find myself being sufficiently familiar with the uniswap exchanges i would like to do an intermidiate iteration with the code in order to determine wether the direction that the solution moves into is correct from the perspective of the product-logic. Please see #531 |
Goal
Automatic router is used for tokens exchangeable via
UniswapV3Callee
as a separate exchange config.Context
After
core/
for multi-callee support #511We're finally ready to add full support of the uniswap automatic router. The idea is to add them as a new separate exchange config, eg:
And then get quote and the route in the
getMarketPrice
(or some higher level function). Then, route will become part of themarketData
object insidemarketDataRecords['Uniswap V3 auto router']
during the auction enrichment and will be picked up from there by thegetCalleeData
during auction execution.Note: we currently store routes as just a list of intermediate
collateralSymbols
through which the exchange should be made eg:While the callees accept array of token addresses + pools, eg:
While we might want to store this data in this format:
Therefore, we should:
exchange[marketId].route
config as nowroute
format intopools
format during enrichment and store it undermarketDataRecords[marketId].pools
instead ofroute
marketDataRecords[marketId].pools
Assets
getUniswapAutoRoute
unified-auctions-ui/core/src/calleeFunctions/helpers/uniswapAutoRouter.ts
Lines 16 to 49 in cbf5727
Implementation proposal
route->pools
:pools
value during enrichment instead ofroute
pools
on the frontendpools
value during execution (ie createencodePools
instead of usingencodeRoute
)enrichAuctionWithMarketDataRecords
andenrichMarketDataRecordsWithValues
into one function, but without a loopgetMarketDataById
which returns both fetched values, calculated values and poolsautomaticRouter
markets to the collateral configautomaticRouter
type when the callee isUniswapV3Callee
via callinggetUniswapAutoRoute
getUniswapAutoRoute
into thepools
formatroute.quoteGasAdjusted
automaticRouter
is presentThe text was updated successfully, but these errors were encountered: