OCL_ZVE.sol

OCL -> On-Chain Liquidity (Sushi, Uniswap)

Introduction

This contract manages liquidity provisioning for a Uniswap V2 or Sushi pool.

This contract has the following responsibilities:

  • Allocate capital to a $ZVE/pairAsset pool.

  • Remove capital from a $ZVE/pairAsset pool.

  • Forward yield (profits) every 30 days to the YDL with compounding mechanisms.

State Variables

TypeNameDescription

address

GBL

The ZivoeGlobals contract.

address

factory

Address for the Factory (Uniswap v2 or Sushi).

address

pairAsset

ERC20 that will be paired with $ZVE for Sushi pool.

address

router

Address for the Router (Uniswap v2 or Sushi).

address

OCT_YDL

Facilitates swaps and forwards distributedAsset() to YDL.

uint256

basis

The basis used for forwardYield() accounting.

uint256

compoundingRateBIPS

The % of returns to retain, in BIPS.

uint256

nextYieldDistribution

Determines next available forwardYield() call.

uint256

BIPS

Private constant, 10000

Sections

Read Functions

Write Functions

Events

Read Functions

canPushMulti()

Permission for owner to call pushToLockerMulti(). See ZivoeLocker.sol

 function canPushMulti() public override pure returns (bool) { return true; }

canPull()

Permission for owner to call pullFromLocker(). See ZivoeLocker.sol

function canPull() public override pure returns (bool) { return true; }

canPullPartial()

Permission for owner to call pullFromLockerPartial(). See ZivoeLocker.sol

function canPullPartial() public override pure returns (bool) { return true; }

fetchBasis()

Returns amount of pairAsset redeemable with current LP position.

function pairAssetConvertible() public view returns (uint256 amout, uint256 lp);

Returns

TypeNameDescription

uint256

amount

Current pairAsset harvestable.

uint256

lp

Current ZVE/pairAsset LP tokens.

Write Functions

pushToLockerMulti()

This pulls capital from the DAO and adds liquidity into a $ZVE/pairAsset pool.

function pushToLockerMulti(
    address[] calldata assets, 
    uint256[] calldata amounts, 
    bytes[] calldata data
) external override onlyOwner nonReentrant;
TypeNameDescription

address[]

assets

The assets to pull from the DAO.

uint256[]

amounts

The amount to pull of each asset respectively.

bytes[]

data

Accompanying transaction data.

Emits the LiquidityTokensMinted() event

pullFromLocker()

This burns all LP tokens owned by the contract from the $ZVE/pairAsset pool and returns them to the DAO.

function pullFromLocker(
    address asset, 
    bytes calldata data
) external override onlyOwner nonReentrant;
TypeNameDescription

address

asset

The asset to burn.

bytes

data

Accompanying transaction data.

Emits the LiquidityTokensBurned() event

pullFromLockerPartial()

This burns LP tokens from the $ZVE/pairAsset pool and returns them to the DAO.

function pullFromLockerPartial(
    address asset, 
    uint256 amount, 
    bytes calldata data
) external override onlyOwner nonReentrant;
TypeNameDescription

address

asset

The asset to burn.

uint256

amount

The amount of "asset" to burn.

bytes

data

Accompanying transaction data.

Emits the LiquidityTokensBurned() event

forwardYield()

This forwards yield to the YDL in the form of pairAsset. Requires that the block timestamp is greater than nextYieldDistribution variable, see above.

function forwardYield() external;

Emits the YieldForwarded() event

updateCompoundingRateBIPS()

Updates the compounding rate of this contract. A value of 2,000 represent 20% of the earnings stays in this contract, compounding.

function updateCompoundingRateBIPS(uint256 _compoundingRateBIPS) external;
TypeNameDescription

uint256

_compoundingRateBIPS

The new compounding rate value.

Emits the UpdatedCompoundingRateBIPS() event

updateOCTYDL()

Updates the OCT_YDL endpoint.

function updateOCTYDL(address _OCT_YDL) external;
TypeNameDescription

address

_OCT_YDL

The new address for OCT_YDL.

Emits the UpdatedOCTYDL() event

Events

LiquidityTokensBurned()

Emitted during pullFromLocker(), pullFromLockerPartial(), and forwardYield()

event LiquidityTokensBurned(
    uint256 amountBurned, 
    uint256 claimedZVE, 
    uint256 claimedPairAsset
);
TypeIndexedNameDescription

uint256

False

amountBurned

Amount of liquidity tokens burned.

uint256

False

claimedZVE

Amount of ZVE claimed.

uint256

False

claimedPairAsset

Amount of pairAsset claimed.

LiquidityTokensMinted()

Emitted during pushToLockerMulti()

event LiquidityTokensMinted(
    uint256 amountMinted, 
    uint256 depositedZVE, 
    uint256 depositedPairAsset
);
TypeIndexedNameDescription

uint256

False

amountMinted

Amount of liquidity tokens minted.

uint256

False

depositedZVE

Amount of ZVE deposited.

uint256

False

depositedPairAsset

Amount of pairAsset deposited.

UpdatedCompoundingRateBIPS()

Emitted during updateCompoundingRateBIPS()

event UpdatedCompoundingRateBIPS(uint256 oldValue, uint256 newValue);
TypeIndexedNameDescription

uint256

False

oldValue

The old value of compoundingRateBIPS.

uint256

False

newValue

The new value of compoundingRateBIPS.

UpdatedOCTYDL()

Emitted during updateOCTYDL()

event UpdatedOCTYDL(address indexed newOCT, address indexed oldOCT);
TypeIndexedNameDescription

address

True

newOCT

The new OCT_YDL contract.

address

True

oldOCT

The old OCT_YDL contract.

YieldForwarded()

Emitted during forwardYield()

event YieldForwarded(address indexed asset, uint256 amount);
TypeIndexedNameDescription

address

True

asset

The "asset" being distributed.

uint256

False

amount

The amount distributed.

Last updated

Zivoe Finance - Official Documentation