Protocol Overview
Last updated
Last updated
The Phantazm Protocol repository can be found on our Github, with an .
The main contracts in Phantazm v2 and their purposes are:
The main entry point into the Phantazm Protocol. Most interactions with Phantazm will happen via the LendingPool, including:
The main addresses register of the protocol, for particular markets. The latest contract addresses should be retrieved from this contract by making the appropriate calls.
Contains a list of active LendingPoolAddressesProvider
addresses, for different markets.
The yield-generating, tokenised deposits used throughout the Phantazm protocol. They implement most of the standard EIP-20/ERC20 token methods with slight modifications, as well as Phantazm specific methods including:
The tokenised borrow positions used throughout the Phantazm protocol. Most of the standard EIP-20/ERC20 methods are disabled, since debt tokens are non-transferrable.
The following contracts should generally not be interacted with directly, but are used throughout the Phantazm Protocol via contract calls.
Using delegatecall
via the LendingPool contract, the LendingPoolCollateralManager implements actions involving management of collateral in the protocol, including:
liquidationCall()
The above function should only be called via the main LendingPool
contract.
Provides configuration functions for the LendingPool
contracts. It also has a number of important functions:
Activates / Deactivates reserves,
Enables / Disables borrowing for a reserve,
Enables / Disables using a reserve as collateral,
Enables / Disables stable rate borrowing for a reserve,
Freezes / Unfreezes reserves,
Updates a reserve's Loan to Value,
Updates a reserve's liquidation threshold,
Updates a reserve's liquidation bonus,
Updates a reserve's decimals,
Updates a reserve's interest rate strategy address,
Activates / Deactivates all functions of a LendingPool in emergencies.
For all of the above functions, relevant events are emitted to the blockchain. Anyone can monitor these changes to know when values have been modified or added/removed.
Holds the information needed to calculate and update the interest rates of specific reserves.
Each contract stores the optimised base curves using the corresponding parameters of each currency. This means that there is a mathematical function which determines the interest rate of each asset pool, with the interest rate changing based on the amount of borrowed funds and the total liquidity (i.e. utilisation) of the asset pool.
The parameters for the optimised base curves are:
baseVariableBorrowRate
variableRateSlope1
variableRateSlope2
stableRateSlope1
stableRateSlope2
The interest rates are calculated depending on the available liquidity and the total borrowed amount.
Various libraries are also used throughout the Phantazm Protocol, which can be found on our Github
All aTokens also implement , which via the function enables gas-less transfers and single transaction approve + actions.
For more information, see the section.
Provides asset price data required throughout the Phantazm protocol, using Chainlink and a fallback when necessary. More details on the page.