-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Labels
choremaintenance relatedmaintenance related
Description
scale18 amounts for tokens with rates should always consider the rate - similar to live balances from Balancer v3 - but SOR code (i.e. PathWithAmount) uses TokenAmount, which does not take rate into account.
In order to compensate for that, inner pool math manually apply rates before/after swap calculation.
This is error prone because sometimes scale18 is "live" (i.e. considers rate) and sometimes it isn't.
The suggestion is to refactor tokens with rates to use PoolTokenWithRate and properly apply rates to scale18 amounts.
GyroE pool already follows that logic, so it can be used as reference.
Known pools that should be refactored:
ComposableStableGyro2MetaStable
Note: NOT urgent - since functionality is correct, this is more of a refactor to improve maintainability
Metadata
Metadata
Assignees
Labels
choremaintenance relatedmaintenance related