Closed ebma closed 6 months ago
@pendulum-chain/product I created a new ticket and @bogdanS98 will start working on it right away as it's very important.
Hey team! Please add your planning poker estimate with Zenhub @b-yap @bogdanS98 @ebma @gianfra-t @TorstenStueber
Context
The buyout possibly involves tokens with different decimals. We have to take that difference into account during the price calculation, otherwise the resulting exchange rates shift a lot.
TODO
Take the asset decimals into account when calculating the respective amounts in calc_amount_to_exchange and calc_buyout_amount.
We can do this in two ways:
I think the approach to use the
DecimalsLookup
trait but implementing it so that it accesses the asset registry is the best approach.The implementation for the price conversion can look similar to this one.