GToken vault contract, direct counterparty to trades happening on gTrade
gnsToken
lockedDepositNft
Copy contract IGTokenLockedDepositNft lockedDepositNft
manager
admin
pnlHandler
openTradesPnlFeed
Copy contract IGTokenOpenPnlFeed openTradesPnlFeed
gnsPriceProvider
Copy struct IGToken .GnsPriceProvider gnsPriceProvider
PRECISION_18
PRECISION_10
MIN_DAILY_ACC_PNL_DELTA
Copy uint256 MIN_DAILY_ACC_PNL_DELTA
MAX_SUPPLY_INCREASE_DAILY_P
Copy uint256 MAX_SUPPLY_INCREASE_DAILY_P
MAX_LOSSES_BURN_P
Copy uint256 MAX_LOSSES_BURN_P
MAX_GNS_SUPPLY_MINT_DAILY_P
Copy uint256 MAX_GNS_SUPPLY_MINT_DAILY_P
MAX_DISCOUNT_P
Copy uint256 MAX_DISCOUNT_P
MIN_LOCK_DURATION
Copy uint256 MIN_LOCK_DURATION
MAX_LOCK_DURATION
Copy uint256 MAX_LOCK_DURATION
WITHDRAW_EPOCHS_LOCKS
Copy uint256 [] WITHDRAW_EPOCHS_LOCKS
maxAccOpenPnlDelta
Copy uint256 maxAccOpenPnlDelta
maxDailyAccPnlDelta
Copy uint256 maxDailyAccPnlDelta
withdrawLockThresholdsP
Copy uint256 [ 2 ] withdrawLockThresholdsP
maxSupplyIncreaseDailyP
Copy uint256 maxSupplyIncreaseDailyP
lossesBurnP
maxGnsSupplyMintDailyP
Copy uint256 maxGnsSupplyMintDailyP
maxDiscountP
maxDiscountThresholdP
Copy uint256 maxDiscountThresholdP
shareToAssetsPrice
Copy uint256 shareToAssetsPrice
accPnlPerTokenUsed
Copy int256 accPnlPerTokenUsed
accPnlPerToken
Copy int256 accPnlPerToken
accRewardsPerToken
Copy uint256 accRewardsPerToken
dailyAccPnlDelta
Copy int256 dailyAccPnlDelta
lastDailyAccPnlDeltaReset
Copy uint256 lastDailyAccPnlDeltaReset
currentEpoch
currentEpochStart
Copy uint256 currentEpochStart
currentEpochPositiveOpenPnl
Copy uint256 currentEpochPositiveOpenPnl
currentMaxSupply
Copy uint256 currentMaxSupply
lastMaxSupplyUpdate
Copy uint256 lastMaxSupplyUpdate
withdrawRequests
Copy mapping ( address => mapping ( uint256 => uint256 )) withdrawRequests
lockedDepositsCount
Copy uint256 lockedDepositsCount
lockedDeposits
Copy mapping ( uint256 => struct IGToken.LockedDeposit) lockedDeposits
assetsToDeplete
Copy uint256 assetsToDeplete
dailyMintedGns
Copy uint256 dailyMintedGns
lastDailyMintedGnsReset
Copy uint256 lastDailyMintedGnsReset
totalDeposited
Copy uint256 totalDeposited
totalClosedPnl
Copy int256 totalClosedPnl
totalRewards
totalLiability
Copy int256 totalLiability
totalLockedDiscounts
Copy uint256 totalLockedDiscounts
totalDiscounts
Copy uint256 totalDiscounts
totalDepleted
Copy uint256 totalDepleted
totalDepletedGns
Copy uint256 totalDepletedGns
totalRefilled
Copy uint256 totalRefilled
totalRefilledGns
Copy uint256 totalRefilledGns
accBlockWeightedMarketCap
Copy uint256 accBlockWeightedMarketCap
accBlockWeightedMarketCapLastStored
Copy uint256 accBlockWeightedMarketCapLastStored
collateralConfig
Copy struct CollateralUtils .CollateralConfig collateralConfig
initialize
Copy function initialize (struct IGToken . Meta _meta , struct IGToken . ContractAddresses _contractAddresses , uint256 _MIN_LOCK_DURATION , uint256 _maxAccOpenPnlDelta , uint256 _maxDailyAccPnlDelta , uint256 [2] _withdrawLockThresholdsP , uint256 _maxSupplyIncreaseDailyP , uint256 _lossesBurnP , uint256 _maxGnsSupplyMintDailyP , uint256 _maxDiscountP , uint256 _maxDiscountThresholdP ) external
initializeV3
Copy function initializeV3 () external
onlyManager
Copy modifier onlyManager ()
checks
Copy modifier checks ( uint256 assetsOrShares)
validDiscount
Copy modifier validDiscount ( uint256 lockDuration)
transferOwnership
Copy function transferOwnership ( address newOwner) public
Transfers ownership of the contract to a new account ( newOwner
). Can only be called by the current owner.
updateManager
Copy function updateManager ( address newValue) external
updateAdmin
Copy function updateAdmin ( address newValue) external
updatePnlHandler
Copy function updatePnlHandler ( address newValue) external
updateGnsPriceProvider
Copy function updateGnsPriceProvider (struct IGToken . GnsPriceProvider newValue) external
updateOpenTradesPnlFeed
Copy function updateOpenTradesPnlFeed ( address newValue) external
updateDelegatee
Copy function updateDelegatee ( address _delegatee ) external
updateMaxAccOpenPnlDelta
Copy function updateMaxAccOpenPnlDelta ( uint256 newValue) external
updateMaxDailyAccPnlDelta
Copy function updateMaxDailyAccPnlDelta ( uint256 newValue) external
updateWithdrawLockThresholdsP
Copy function updateWithdrawLockThresholdsP ( uint256 [2] newValue) external
updateMaxSupplyIncreaseDailyP
Copy function updateMaxSupplyIncreaseDailyP ( uint256 newValue) external
updateLossesBurnP
Copy function updateLossesBurnP ( uint256 newValue) external
updateMaxGnsSupplyMintDailyP
Copy function updateMaxGnsSupplyMintDailyP ( uint256 newValue) external
updateMaxDiscountP
Copy function updateMaxDiscountP ( uint256 newValue) external
updateMaxDiscountThresholdP
Copy function updateMaxDiscountThresholdP ( uint256 newValue) external
maxAccPnlPerToken
Copy function maxAccPnlPerToken () public view returns ( uint256 )
collateralizationP
Copy function collateralizationP () public view returns ( uint256 )
gnsTokenToAssetsPrice
Copy function gnsTokenToAssetsPrice () public view returns ( uint256 price)
withdrawEpochsTimelock
Copy function withdrawEpochsTimelock () public view returns ( uint256 )
lockDiscountP
Copy function lockDiscountP ( uint256 collatP , uint256 lockDuration) public view returns ( uint256 )
totalSharesBeingWithdrawn
Copy function totalSharesBeingWithdrawn ( address owner) public view returns ( uint256 shares)
tryUpdateCurrentMaxSupply
Copy function tryUpdateCurrentMaxSupply () public
tryResetDailyAccPnlDelta
Copy function tryResetDailyAccPnlDelta () public
tryNewOpenPnlRequestOrEpoch
Copy function tryNewOpenPnlRequestOrEpoch () public
transfer
Copy function transfer ( address to , uint256 amount) public returns ( bool )
transferFrom
Copy function transferFrom ( address from , address to , uint256 amount) public returns ( bool )
decimals
Copy function decimals () public view returns ( uint8 )
_convertToShares
Copy function _convertToShares ( uint256 assets , enum MathUpgradeable . Rounding rounding) internal view returns ( uint256 shares)
Internal conversion function (from assets to shares) with support for rounding direction.
_convertToAssets
Copy function _convertToAssets ( uint256 shares , enum MathUpgradeable . Rounding rounding) internal view returns ( uint256 assets)
Internal conversion function (from shares to assets) with support for rounding direction.
maxMint
Copy function maxMint ( address ) public view returns ( uint256 )
See {IERC4626-maxMint}.
maxDeposit
Copy function maxDeposit ( address owner) public view returns ( uint256 )
maxRedeem
Copy function maxRedeem ( address owner) public view returns ( uint256 )
See {IERC4626-maxRedeem}.
maxWithdraw
Copy function maxWithdraw ( address owner) public view returns ( uint256 )
See {IERC4626-maxWithdraw}.
deposit
Copy function deposit ( uint256 assets , address receiver) public returns ( uint256 )
See {IERC4626-deposit}.
mint
Copy function mint ( uint256 shares , address receiver) public returns ( uint256 )
_See {IERC4626-mint}.
As opposed to {deposit}, minting is allowed even if the vault is in a state where the price of a share is zero. In this case, the shares will be minted without requiring any assets to be deposited._
withdraw
Copy function withdraw ( uint256 assets , address receiver , address owner) public returns ( uint256 )
See {IERC4626-withdraw}.
redeem
Copy function redeem ( uint256 shares , address receiver , address owner) public returns ( uint256 )
See {IERC4626-redeem}.
makeWithdrawRequest
Copy function makeWithdrawRequest ( uint256 shares , address owner) external
cancelWithdrawRequest
Copy function cancelWithdrawRequest ( uint256 shares , address owner , uint256 unlockEpoch) external
depositWithDiscountAndLock
Copy function depositWithDiscountAndLock ( uint256 assets , uint256 lockDuration , address receiver) external returns ( uint256 )
mintWithDiscountAndLock
Copy function mintWithDiscountAndLock ( uint256 shares , uint256 lockDuration , address receiver) external returns ( uint256 )
unlockDeposit
Copy function unlockDeposit ( uint256 depositId , address receiver) external
distributeReward
Copy function distributeReward ( uint256 assets) external
sendAssets
Copy function sendAssets ( uint256 assets , address receiver) external
receiveAssets
Copy function receiveAssets ( uint256 assets , address user) external
deplete
Copy function deplete ( uint256 assets) external
refill
Copy function refill ( uint256 assets) external
updateAccPnlPerTokenUsed
Copy function updateAccPnlPerTokenUsed ( uint256 prevPositiveOpenPnl , uint256 newPositiveOpenPnl) external returns ( uint256 )
getLockedDeposit
Copy function getLockedDeposit ( uint256 depositId) external view returns (struct IGToken . LockedDeposit )
tvl
Copy function tvl () public view returns ( uint256 )
availableAssets
Copy function availableAssets () public view returns ( uint256 )
marketCap
Copy function marketCap () public view returns ( uint256 )