💬Price feeds
Price feeds are a critical component of decentralised lending protocols, enabling the system to function without reliance on a centralized entity. These feeds serve multiple essential functions, including:
Borrowing, by ensuring that loans are adequately collateralized.
Liquidating, by confirming that a loan is under-collateralized and that the borrower is compensated fairly.
Withdrawing delegation rewards, particularly when the assets in the lending pool are not in ADA.
Key points
Liquidity movements on DEX will impact positions, even if the asset price seems unchanged.
If you control a large part of a single asset's liquidity, it's better to move liquidity in chunks or even notify the team before the movement.
How it works
When a price feed is requested, the price is provided by the client. The oracle verifies the price and, if it's valid, signs the data. Only signed data can be used by Lenfi V2.
The oracle only validates the values of verified pools. The team is making its best effort to maintain the list up-to-date.
You can find current approved DEX pools here
How the collateral and loan values are calculated
The example below illustrates how the price feed is used in the Lenfi protocol. Assume that the price feed has data of...
Where the spot token price could be seen as 7 ADA/LENFI. However, if someone tries to use 100,000 LENFI as collateral value would be:
The above formula is used to find out the assets value if it is sold on a DEX
In case someone tries to borrow 100,000 LENFI tokens it's value would be calculated by:
The above formula is used to find out how much ADA you buy assets on DEX
The above example tells us that:
If you sell 100,000 LENFI you would receive 636,537 ADA. That's the value would be seen on Lenfi if you put 100,000 LENFI as collateral.
If you buy 100,000 LENFI you need to pay 777,518 ADA.That's the value would be seen on Lenfi if you borrow 100,000.
Last updated