PCV Deposits
The PCV Deposit is a standard interface implemented across the Essence protocol codebase.
A PCV Deposit is a contract that holds funds on behalf of the protocol. There are multiple types (implementations) of PCV Deposits, and each type of PCV Deposit can be instantiated multiple times on-chain. Collectively, all the funds deposited across various PCV Deposits constitute the Protocol Controlled Value.
A PCV Deposit manages only one type of token, and if additional tokens are available on the deposit (e.g. rewards from deploying PCV to a DEX), they are ignored in accounting and cannot be used and so will most likely be moved somewhere else.
Interface
The following methods must be implemented on all PCV Deposits :
Accounting
The methods balanceReportedIn()
, balance()
, and resistantBalanceAndChi()
are used for accounting and compatibility. These view
methods are used in the Collateralization Oracle to determine the aggregated amount of PCV and CHI the protocol controls.
balanceReportedIn()
is the address of the token managed and reported by a deposit.
balance()
reports the instantaneous balance of a PCVDeposit. The instantaneous balance can be subject to in-block atomic manipulations (e.g. using flashloans).
resistantBalanceAndChi()
reports the manipulation-resistant balance of a PCVDeposit, as well as the protocol-owned CHI controlled by the contract. This method is often based on "ideal balances" computed using Oracle prices, and not reading the actual balances in the current block.
Enter / Exit
The deposit()
method is called after tokens have been sent to the PCV Deposit to deploy those tokens into the "strategy" implemented by the contract.
The withdraw()
method is called by a PCV Controller to withdraw tokens from the "strategy" implemented by the contract.
The withdrawERC20()
method is called by a PCV Controller to withdraw ERC20 tokens held in the PCV Deposit.
Movements
The withdrawETH()
and withdrawERC20()
methods are called by a PCV Controller to send the ETH and ERC20 held on the PCV Deposit somewhere else.
These methods can move any tokens and not just the token used in accounting by the PCV Deposit so, for instance, they can be used to move rewards earned by the contract. These functions are restricted to the role PCV_CONTROLLER
.
Some PCV Deposits are meant to hold funds over the long term, and some are meant to be used in a transitory manner, to enter or exit a yield strategy/liquidity pool.
Last updated