An abstract contract for storing PCV in a Uniswap RUSD liquidity pair
Uniswap PCV deposits receive PCV, mint the corresponding amount of RUSD to match the Uniswap spot price, and deposit to Uniswap. They can withdraw and read in the amount of non-RUSD PCV on Uniswap held in the contract.
When withdrawing, any excess RUSD held is burned.
When depositing, if no existing LP exists, the oracle price is used. The oracle is a UniswapOracle.
Returns the total liquidity of pcv deposit UniswapV3 position
Public State-Changing Functions
deposit
1
functiondeposit(uint256 amount) external payable;
Copied!
Deposits amount PCV into Uniswap by minting the necessary amount of RUSD to make the liquidity provision.
E.g., if there are 50,000 ETH and 100,000,000 RUSD on Uniswap, and the protocol receives another 500 ETH to deposit, the protocol will mint another 1,000,000 RUSD to deposit at the current 2000 RUSD/ETH spot price.
PCV Controller-Only ⚙️ State-Changing Functions
withdraw
1
functionwithdraw(address to, uint128 amount) external;
Copied!
Withdraws amount PCV from Uniswap to address to by withdrawing the necessary amount of liquidity and burning the corresponding RUSD.
E.g., if the protocol owns 50,000 ETH and 100,000,000 RUSD worth of liquidity on Uniswap, a withdrawal of 500 ETH would liquidate 1% of the LP shares and burn the extra 1,000,000 RUSD received before transferring the 500 ETH.