GToken
GToken vault contract, direct counterparty to trades happening on gTrade
gnsToken
address gnsTokenlockedDepositNft
contract IGTokenLockedDepositNft lockedDepositNftmanager
address manageradmin
address adminpnlHandler
address pnlHandleropenTradesPnlFeed
contract IGTokenOpenPnlFeed openTradesPnlFeedgnsPriceProvider
struct IGToken.GnsPriceProvider gnsPriceProviderPRECISION_18
uint256 PRECISION_18PRECISION_10
uint256 PRECISION_10MIN_DAILY_ACC_PNL_DELTA
uint256 MIN_DAILY_ACC_PNL_DELTAMAX_SUPPLY_INCREASE_DAILY_P
uint256 MAX_SUPPLY_INCREASE_DAILY_PMAX_LOSSES_BURN_P
uint256 MAX_LOSSES_BURN_PMAX_GNS_SUPPLY_MINT_DAILY_P
uint256 MAX_GNS_SUPPLY_MINT_DAILY_PMAX_DISCOUNT_P
uint256 MAX_DISCOUNT_PMIN_LOCK_DURATION
uint256 MIN_LOCK_DURATIONMAX_LOCK_DURATION
uint256 MAX_LOCK_DURATIONWITHDRAW_EPOCHS_LOCKS
uint256[] WITHDRAW_EPOCHS_LOCKSmaxAccOpenPnlDelta
uint256 maxAccOpenPnlDeltamaxDailyAccPnlDelta
uint256 maxDailyAccPnlDeltawithdrawLockThresholdsP
uint256[2] withdrawLockThresholdsPmaxSupplyIncreaseDailyP
uint256 maxSupplyIncreaseDailyPlossesBurnP
uint256 lossesBurnPmaxGnsSupplyMintDailyP
uint256 maxGnsSupplyMintDailyPmaxDiscountP
uint256 maxDiscountPmaxDiscountThresholdP
uint256 maxDiscountThresholdPshareToAssetsPrice
uint256 shareToAssetsPriceaccPnlPerTokenUsed
int256 accPnlPerTokenUsedaccPnlPerToken
int256 accPnlPerTokenaccRewardsPerToken
uint256 accRewardsPerTokendailyAccPnlDelta
int256 dailyAccPnlDeltalastDailyAccPnlDeltaReset
uint256 lastDailyAccPnlDeltaResetcurrentEpoch
uint256 currentEpochcurrentEpochStart
uint256 currentEpochStartcurrentEpochPositiveOpenPnl
uint256 currentEpochPositiveOpenPnlcurrentMaxSupply
uint256 currentMaxSupplylastMaxSupplyUpdate
uint256 lastMaxSupplyUpdatewithdrawRequests
mapping(address => mapping(uint256 => uint256)) withdrawRequestslockedDepositsCount
uint256 lockedDepositsCountlockedDeposits
mapping(uint256 => struct IGToken.LockedDeposit) lockedDepositsassetsToDeplete
uint256 assetsToDepletedailyMintedGns
uint256 dailyMintedGnslastDailyMintedGnsReset
uint256 lastDailyMintedGnsResettotalDeposited
uint256 totalDepositedtotalClosedPnl
int256 totalClosedPnltotalRewards
uint256 totalRewardstotalLiability
int256 totalLiabilitytotalLockedDiscounts
uint256 totalLockedDiscountstotalDiscounts
uint256 totalDiscountstotalDepleted
uint256 totalDepletedtotalDepletedGns
uint256 totalDepletedGnstotalRefilled
uint256 totalRefilledtotalRefilledGns
uint256 totalRefilledGnsaccBlockWeightedMarketCap
uint256 accBlockWeightedMarketCapaccBlockWeightedMarketCapLastStored
uint256 accBlockWeightedMarketCapLastStoredcollateralConfig
struct CollateralUtils.CollateralConfig collateralConfiginitialize
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) externalinitializeV3
function initializeV3() externalonlyManager
modifier onlyManager()checks
modifier checks(uint256 assetsOrShares)validDiscount
modifier validDiscount(uint256 lockDuration)transferOwnership
function transferOwnership(address newOwner) publicTransfers ownership of the contract to a new account (newOwner). Can only be called by the current owner.
updateManager
function updateManager(address newValue) externalupdateAdmin
function updateAdmin(address newValue) externalupdatePnlHandler
function updatePnlHandler(address newValue) externalupdateGnsPriceProvider
function updateGnsPriceProvider(struct IGToken.GnsPriceProvider newValue) externalupdateOpenTradesPnlFeed
function updateOpenTradesPnlFeed(address newValue) externalupdateDelegatee
function updateDelegatee(address _delegatee) externalupdateMaxAccOpenPnlDelta
function updateMaxAccOpenPnlDelta(uint256 newValue) externalupdateMaxDailyAccPnlDelta
function updateMaxDailyAccPnlDelta(uint256 newValue) externalupdateWithdrawLockThresholdsP
function updateWithdrawLockThresholdsP(uint256[2] newValue) externalupdateMaxSupplyIncreaseDailyP
function updateMaxSupplyIncreaseDailyP(uint256 newValue) externalupdateLossesBurnP
function updateLossesBurnP(uint256 newValue) externalupdateMaxGnsSupplyMintDailyP
function updateMaxGnsSupplyMintDailyP(uint256 newValue) externalupdateMaxDiscountP
function updateMaxDiscountP(uint256 newValue) externalupdateMaxDiscountThresholdP
function updateMaxDiscountThresholdP(uint256 newValue) externalmaxAccPnlPerToken
function maxAccPnlPerToken() public view returns (uint256)collateralizationP
function collateralizationP() public view returns (uint256)gnsTokenToAssetsPrice
function gnsTokenToAssetsPrice() public view returns (uint256 price)withdrawEpochsTimelock
function withdrawEpochsTimelock() public view returns (uint256)lockDiscountP
function lockDiscountP(uint256 collatP, uint256 lockDuration) public view returns (uint256)totalSharesBeingWithdrawn
function totalSharesBeingWithdrawn(address owner) public view returns (uint256 shares)tryUpdateCurrentMaxSupply
function tryUpdateCurrentMaxSupply() publictryResetDailyAccPnlDelta
function tryResetDailyAccPnlDelta() publictryNewOpenPnlRequestOrEpoch
function tryNewOpenPnlRequestOrEpoch() publictransfer
function transfer(address to, uint256 amount) public returns (bool)transferFrom
function transferFrom(address from, address to, uint256 amount) public returns (bool)decimals
function decimals() public view returns (uint8)_convertToShares
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
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
function maxMint(address) public view returns (uint256)See {IERC4626-maxMint}.
maxDeposit
function maxDeposit(address owner) public view returns (uint256)maxRedeem
function maxRedeem(address owner) public view returns (uint256)See {IERC4626-maxRedeem}.
maxWithdraw
function maxWithdraw(address owner) public view returns (uint256)See {IERC4626-maxWithdraw}.
deposit
function deposit(uint256 assets, address receiver) public returns (uint256)See {IERC4626-deposit}.
mint
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
function withdraw(uint256 assets, address receiver, address owner) public returns (uint256)See {IERC4626-withdraw}.
redeem
function redeem(uint256 shares, address receiver, address owner) public returns (uint256)See {IERC4626-redeem}.
makeWithdrawRequest
function makeWithdrawRequest(uint256 shares, address owner) externalcancelWithdrawRequest
function cancelWithdrawRequest(uint256 shares, address owner, uint256 unlockEpoch) externaldepositWithDiscountAndLock
function depositWithDiscountAndLock(uint256 assets, uint256 lockDuration, address receiver) external returns (uint256)mintWithDiscountAndLock
function mintWithDiscountAndLock(uint256 shares, uint256 lockDuration, address receiver) external returns (uint256)unlockDeposit
function unlockDeposit(uint256 depositId, address receiver) externaldistributeReward
function distributeReward(uint256 assets) externalsendAssets
function sendAssets(uint256 assets, address receiver) externalreceiveAssets
function receiveAssets(uint256 assets, address user) externaldeplete
function deplete(uint256 assets) externalrefill
function refill(uint256 assets) externalupdateAccPnlPerTokenUsed
function updateAccPnlPerTokenUsed(uint256 prevPositiveOpenPnl, uint256 newPositiveOpenPnl) external returns (uint256)getLockedDeposit
function getLockedDeposit(uint256 depositId) external view returns (struct IGToken.LockedDeposit)tvl
function tvl() public view returns (uint256)availableAssets
function availableAssets() public view returns (uint256)marketCap
function marketCap() public view returns (uint256)Was this helpful?