OCL_ZVE.sol
OCL -> On-Chain Liquidity (Sushi, Uniswap)
Last updated
OCL -> On-Chain Liquidity (Sushi, Uniswap)
Last updated
Zivoe Finance - Official Documentation
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.
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
canPushMulti() - Permission for owner to call pushToLockerMulti()
. See ZivoeLocker.sol
canPull() - Permission for owner to call pullFromLocker()
. See ZivoeLocker.sol
canPullPartial() - Permission for owner to call pullFromLockerPartial()
. See ZivoeLocker.sol
fetchBasis() - Returns amount of pairAsset redeemable with current LP position.
pushToLockerMulti() - This pulls capital from the DAO and adds liquidity into a $ZVE/pairAsset pool.
pullFromLocker() - This burns all LP tokens owned by the contract from the $ZVE/pairAsset pool and returns them to the DAO.
pullFromLockerPartial() - This burns LP tokens from the $ZVE/pairAsset pool and returns them to the DAO.
forwardYield() - This forwards yield to the YDL in the form of pairAsset.
updateCompoundingRateBIPS() - Updates the compounding rate of this contract.
updateOCTYDL() - Updates the OCT_YDL endpoint.
canPushMulti()
Permission for owner to call pushToLockerMulti()
. See ZivoeLocker.sol
canPull()
Permission for owner to call pullFromLocker()
. See ZivoeLocker.sol
canPullPartial()
Permission for owner to call pullFromLockerPartial()
. See ZivoeLocker.sol
fetchBasis()
Returns amount of pairAsset redeemable with current LP position.
Returns
uint256
amount
Current pairAsset harvestable.
uint256
lp
Current ZVE/pairAsset LP tokens.
pushToLockerMulti()
This pulls capital from the DAO and adds liquidity into a $ZVE/pairAsset pool.
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.
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.
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.
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.
uint256
_compoundingRateBIPS
The new compounding rate value.
Emits the UpdatedCompoundingRateBIPS() event
updateOCTYDL()
Updates the OCT_YDL endpoint.
address
_OCT_YDL
The new address for OCT_YDL.
Emits the UpdatedOCTYDL() event
LiquidityTokensBurned()
Emitted during pullFromLocker(), pullFromLockerPartial(), and forwardYield()
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()
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()
uint256
False
oldValue
The old value of compoundingRateBIPS.
uint256
False
newValue
The new value of compoundingRateBIPS.
UpdatedOCTYDL()
Emitted during updateOCTYDL()
address
True
newOCT
The new OCT_YDL contract.
address
True
oldOCT
The old OCT_YDL contract.
YieldForwarded()
Emitted during forwardYield()
address
True
asset
The "asset" being distributed.
uint256
False
amount
The amount distributed.