Skip to content

Advanced features to improve SparkLend beyond the core contracts. This repository is mostly focused on improving security and automating governance processes.

License

Notifications You must be signed in to change notification settings

marsfoundation/sparklend-advanced

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SparkLend Advanced Contracts

This repository contains advanced features to improve SparkLend beyond the core contracts. This repository is mostly focused on improving security and automating governance processes.

Available Contracts

Oracles

Please note all these oracles are designed for consumption by AaveOracle which assumes 8 decimal places.

FixedPriceOracle: A hardcoded oracle price that never changes. Used for: DAI/USDC/USDT markets

CappedOracle: Returns min(market price, hardcoded max price). Not currently used.

WSTETHExchangeRateOracle: Provides wstETH/USD by multiplying the wstETH exchange rate by ETH/USD. Used for: wstETH market

RETHExchangeRateOracle: Provides rETH/USD by multiplying the rETH exchange rate by ETH/USD. Used for: rETH market

WEETHExchangeRateOracle: Provides weETH/USD by multiplying the weETH exchange rate by ETH/USD. Used for: weETH market

MorphoUpgradableOracle: Allows Spark Governance to change an oracle for Morpho Blue markets. Planned to be used in Morpho Blue.

Custom Interest Rate Strategies

VariableBorrowInterestRateStrategy: Modified version of DefaultReserveInterestRateStrategy that removes the stable borrow logic.

RateTargetBaseInterestRateStrategy: Overridden version of VariableBorrowInterestRateStrategy that sets the base variable borrow rate to match an external rate source with a fixed spread. Used for: DAI market

RateTargetKinkInterestRateStrategy: Overridden version of VariableBorrowInterestRateStrategy that sets the variable slope 1 rate to match an external rate source with a fixed spread. Used for: ETH/USDC/USDT markets

Rate Sources

PotRateSource: Adapter to convert DSR into APR which can be consumed by one of the rate target interest rate strategies. Used for: DAI/USDC/USDT markets

CappedFallbackRateSource: Wraps another rate source, caps the rate and protects against reverts with a fallback value. Used for: ETH market

Usage

forge build

Test

forge test

The IP in this repository was assigned to Mars SPC Limited in respect of the MarsOne SP

About

Advanced features to improve SparkLend beyond the core contracts. This repository is mostly focused on improving security and automating governance processes.

Resources

License

Stars

Watchers

Forks

Packages

No packages published