At the moment, the conversion of u128 prices to UnsignedFixedPoint numbers we use in our runtimes (see here) is not correct.
The prices are 10 ** 6 times smaller than they should because we are using u128 as the inner type of our UnsignedFixedPoint implementation, see here, which makes the FixedPoint implementation use a DIV of 1_000_000_000_000_000_000 (10e18), see here. The batching server converts the prices to u128 numbers considering 12 decimals in this function however. Thus we have a mismatch.
This is not problematic for the price conversions in Spacewalk but we should still try to fix this.
Context
At the moment, the conversion of
u128
prices toUnsignedFixedPoint
numbers we use in our runtimes (see here) is not correct.The prices are 10 ** 6 times smaller than they should because we are using
u128
as theinner
type of ourUnsignedFixedPoint
implementation, see here, which makes the FixedPoint implementation use aDIV
of1_000_000_000_000_000_000
(10e18), see here. The batching server converts the prices tou128
numbers considering 12 decimals in this function however. Thus we have a mismatch.This is not problematic for the price conversions in Spacewalk but we should still try to fix this.
Related notion page here.
TODO
Change the conversion functions in the runtime to convert the incoming prices to correct FixedPoint numbers.