Switch market price feed for LSDs to DIA fair value price feed #1111
Description
Is your feature request related to a problem? Please describe.
Currently the bridge uses coingecko price feeds for all assets. This exposes the bridge to the risk of CG suddenly stopping to report prices for an asset with low liquidity such as vKSM. In addition to that, the price feeds or assets such as vKSM have low liquidity so the price can easily manipulated.
Describe the solution you'd like
Change the source of the price feed from Coingecko to DIAs fair value price feed for vKSM. For this we would have to query the total_backable
and total_issued
amounts from: https://api.diadata.org/customer/bifrost/state/KSM and multiply it with the market price (Price
) of KSM which can be sourced from here: https://api.diadata.org/v1/assetQuotation/Kusama/0x0000000000000000000000000000000000000000
Additional context
Important: The API endpoint that fetches total_backable
and total_issued
currently only covers Bifrost parachain. Once people start bridging these assets over to Kintsugi DIA needs to add support for Kintsugi as well to aggregate both chains into one metric.
For details on the formula and methodology for the fair value price feed see here: https://docs.diadata.org/documentation/methodology/liquid-staked-derivatives-lsds-fair-pricing
Metadata
Assignees
Labels
Type
Projects
Status
Todo ⏳