📜contracts

an overview of the main handle contracts & addresses

the handle protocol consists of four main contracts which contain the core functions required for performing vault logic around loans, minting and collateral. These contracts are the Handle contract, the Treasury contract, the Comptroller contract and the VaultLibrary contract. Their functions are as follows:

  • Handle.sol: stores the main protocol data and configurations. Holds a reference to all protocol contracts.

  • Treasury.sol: provides deposit and withdrawal functions for vaults. Holds all protocol funds.

  • Comptroller.sol: provides mint and burn functions for vaults.

  • VaultLibrary.sol: provides read-only functions to calculate vault data such as the collateral ratio, the equivalent ETH value of collateral/debt at the current exchange rates, weighted fees, etc.

  • Handle.sol: stores the main protocol data and configurations. Holds a reference to all protocol contracts.

  • Treasury.sol: provides deposit and withdrawal functions for vaults. Holds all protocol funds.

  • Comptroller.sol: provides mint and burn functions for vaults.

  • VaultLibrary.sol: provides read-only functions to calculate vault data such as the collateral ratio, the equivalent ETH value of collateral/debt at the current exchange rates, weighted fees, etc.

the rest of the contracts may be divided into two subgroups: collateral health (liquidations and redemptions) and investment strategies (the protocol-controlled treasury, PCT), and also the Interest contract:

  • Interest.sol: keeps track of time passed and interest rates, storing relevant variables. allows to track and update the interest rates according to configured external protocol rates such as MakerDAO's.

  • Collateral health: includes the Liquidator contract (implementing redemptions and liquidations), an off-chain liquidation bot written in node.js which relies in a The Graph's subgraph indexing module to index relevant vault and collateral data for liquidation purposes.

  • Investment strategies: the PCT contract can interact with external finance protocols to earn interest over Treasury collateral, which may be borrowed by the PCT and transferred into these external protocols.