Oracle Pricing

Oracle Pricing Risk pertains to the accuracy and reliability of the oracle mechanism used for asset valuation in the protocol. The robustness of the oracle can be assessed via the number of price sources, the types of price sources, and the uptime of the price sources.

K-Lend’s oracle risk engine combines various risk practices such as heuristic, and TWAP/EWMA prices, while also maintaining its own oracles alongside those from other providers.

Price Bands

Each stable or soft-pegged asset in K-Lend has a price range within which the smart contract expects the price to fall within. This is referred to as the price-band, and protects from flash-crashes and flash-loan exploits.

For example, USD-pegged stables like USDC and USDH could have a 1% upper or lower band from $1. In this case, if the price is below $0.99 or above $1.01, the price would be rejected. For SOL-pegged assets, price bands would be expressed relative to the SOL price.

TWAP and EWMA Prices

Similar to price bands, Time Weighted Average Prices (TWAP) and Exponentially Weighted Moving Average (EWMA) prices are resistant to price manipulations because they identify the average price of an asset over time. Since K-Lend uses TWAPs and EWMAs, exploiting the protocol via price manipulation is expensive, as it requires the exploiter not only to manipulate a price, but to sustain it for some period of time relative to the existing TWAP/EWMA intervals.

Multiple Providers

K-Lend cross-references oracles from both Pyth and Switchboard, as well as its own Switchboard oracles that ingest feeds from various on-chain and off-chain sources.