Closed DylanVerstraete closed 3 months ago
Bump, also the average price stored. One use case is to check the actual historic cost of a contract in USD, by querying the bill reports for a contract and multiplying with the average price at the time of billing.
It makes sense to index the averagePriceStored
event, as Lee suggested.
averagePriceStored
Events.
priceStored
Events.I ran into an issue with the priceStored
event. The price was stored at older runtimes in U16F16
encoded format as hex.
I'll go through its implementation in fixed
crate to see how I should decode the U16F16
hex value in JS to be indexed as a number instead.
Remaining Time: 1-2 days.
Resources:
I32F32
(which closest thing I found).
Index event: https://github.com/threefoldtech/tfchain/blob/bb09e8e88cbc055a89057d4bc084014c66fdd1a4/substrate-node/pallets/pallet-tft-price/src/lib.rs#L98