Ring Protocol
Search…
UniswapPCVDeposit
A PCV deposit for holding Uniswap liquidity

Contract

Description

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.
    Minter💰

Events

Deposit
Withdrawal
Collect
Deposit to the PCV
type
param
description
address indexed
_from
address of the depositor
uint256
_amount
amount deposited
Withdrawal of PCV
type
param
description
address indexed
_caller
the PCV controller calling this function
address indexed
_to
the recipient address of the PCV
uint256
_amount
amount withdrawn
Collect of UniswapV3 fees
type
param
description
address indexed
_from
the PCV deposit that provided LP
uint256
_amount0
amount collected for token0
uint256
_amount1
amount collected for token1

Read-Only Functions

1
function totalLiquidity() external view returns (uint256);
Copied!
Returns the total liquidity of pcv deposit UniswapV3 position

Public State-Changing Functions

deposit

1
function deposit(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
function withdraw(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.

ABIs

uniswappcvdeposit.json
6KB
Binary
UniswapPCVDeposit ABI
ipcvdeposit.json
2KB
Binary
PCVDeposit Interface ABI
Last modified 4mo ago