Modular Pricing Logic
With our modular pricing architecture, new token primitives and new token standards can be priced, without the need of protocol upgrades or asset migration. This allows users with existing vaults to use these newly added assets as collateral.
Per token primitive (which can be of any token standard) we use a different contract to price the asset (also known as Pricing Modules). For example all Uniswap V2 LP-tokens are priced with one contract, while all A-tokens are priced with a second contract.
All pricing logic is internally calculated with 18-decimal precision relying on gas-efficient and battle-tested mathematical libraries. Pricing calculations have been tested to be flash-loan resistant.
There are two big classes of Pricing Modules: Primary Pricing Modules and Derived Pricing Modules.
For primary Primary Pricing Modules, we have a direct, decentralized price oracle per asset. Examples of tokens for which we have primary price feeds are vanilla ERC20 tokens and floor prices for NFT collectibles. Both of them use at the moment Chainlink price feeds.
For Derived Pricing Modules (as the name implies), we don’t have a direct price feed; we first break down the asset in its underlying tokens, for which we do have primary price feeds. Examples here are Uniswap LP positions or Curve pools.