GToken

GToken vault contract, direct counterparty to trades happening on gTrade

gnsToken

address gnsToken

lockedDepositNft

contract IGTokenLockedDepositNft lockedDepositNft

manager

address manager

admin

address admin

pnlHandler

address pnlHandler

openTradesPnlFeed

contract IGTokenOpenPnlFeed openTradesPnlFeed

gnsPriceProvider

struct IGToken.GnsPriceProvider gnsPriceProvider

PRECISION_18

uint256 PRECISION_18

PRECISION_10

uint256 PRECISION_10

MIN_DAILY_ACC_PNL_DELTA

uint256 MIN_DAILY_ACC_PNL_DELTA

MAX_SUPPLY_INCREASE_DAILY_P

uint256 MAX_SUPPLY_INCREASE_DAILY_P

MAX_LOSSES_BURN_P

uint256 MAX_LOSSES_BURN_P

MAX_GNS_SUPPLY_MINT_DAILY_P

uint256 MAX_GNS_SUPPLY_MINT_DAILY_P

MAX_DISCOUNT_P

uint256 MAX_DISCOUNT_P

MIN_LOCK_DURATION

uint256 MIN_LOCK_DURATION

MAX_LOCK_DURATION

uint256 MAX_LOCK_DURATION

WITHDRAW_EPOCHS_LOCKS

uint256[] WITHDRAW_EPOCHS_LOCKS

maxAccOpenPnlDelta

uint256 maxAccOpenPnlDelta

maxDailyAccPnlDelta

uint256 maxDailyAccPnlDelta

withdrawLockThresholdsP

uint256[2] withdrawLockThresholdsP

maxSupplyIncreaseDailyP

uint256 maxSupplyIncreaseDailyP

lossesBurnP

uint256 lossesBurnP

maxGnsSupplyMintDailyP

uint256 maxGnsSupplyMintDailyP

maxDiscountP

uint256 maxDiscountP

maxDiscountThresholdP

uint256 maxDiscountThresholdP

shareToAssetsPrice

uint256 shareToAssetsPrice

accPnlPerTokenUsed

int256 accPnlPerTokenUsed

accPnlPerToken

int256 accPnlPerToken

accRewardsPerToken

uint256 accRewardsPerToken

dailyAccPnlDelta

int256 dailyAccPnlDelta

lastDailyAccPnlDeltaReset

uint256 lastDailyAccPnlDeltaReset

currentEpoch

uint256 currentEpoch

currentEpochStart

uint256 currentEpochStart

currentEpochPositiveOpenPnl

uint256 currentEpochPositiveOpenPnl

currentMaxSupply

uint256 currentMaxSupply

lastMaxSupplyUpdate

uint256 lastMaxSupplyUpdate

withdrawRequests

mapping(address => mapping(uint256 => uint256)) withdrawRequests

lockedDepositsCount

uint256 lockedDepositsCount

lockedDeposits

mapping(uint256 => struct IGToken.LockedDeposit) lockedDeposits

assetsToDeplete

uint256 assetsToDeplete

dailyMintedGns

uint256 dailyMintedGns

lastDailyMintedGnsReset

uint256 lastDailyMintedGnsReset

totalDeposited

uint256 totalDeposited

totalClosedPnl

int256 totalClosedPnl

totalRewards

uint256 totalRewards

totalLiability

int256 totalLiability

totalLockedDiscounts

uint256 totalLockedDiscounts

totalDiscounts

uint256 totalDiscounts

totalDepleted

uint256 totalDepleted

totalDepletedGns

uint256 totalDepletedGns

totalRefilled

uint256 totalRefilled

totalRefilledGns

uint256 totalRefilledGns

accBlockWeightedMarketCap

uint256 accBlockWeightedMarketCap

accBlockWeightedMarketCapLastStored

uint256 accBlockWeightedMarketCapLastStored

collateralConfig

struct CollateralUtils.CollateralConfig collateralConfig

initialize

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

function initializeV3() external

onlyManager

modifier onlyManager()

checks

modifier checks(uint256 assetsOrShares)

validDiscount

modifier validDiscount(uint256 lockDuration)

transferOwnership

function transferOwnership(address newOwner) public

Transfers ownership of the contract to a new account (newOwner). Can only be called by the current owner.

updateManager

function updateManager(address newValue) external

updateAdmin

function updateAdmin(address newValue) external

updatePnlHandler

function updatePnlHandler(address newValue) external

updateGnsPriceProvider

function updateGnsPriceProvider(struct IGToken.GnsPriceProvider newValue) external

updateOpenTradesPnlFeed

function updateOpenTradesPnlFeed(address newValue) external

updateDelegatee

function updateDelegatee(address _delegatee) external

updateMaxAccOpenPnlDelta

function updateMaxAccOpenPnlDelta(uint256 newValue) external

updateMaxDailyAccPnlDelta

function updateMaxDailyAccPnlDelta(uint256 newValue) external

updateWithdrawLockThresholdsP

function updateWithdrawLockThresholdsP(uint256[2] newValue) external

updateMaxSupplyIncreaseDailyP

function updateMaxSupplyIncreaseDailyP(uint256 newValue) external

updateLossesBurnP

function updateLossesBurnP(uint256 newValue) external

updateMaxGnsSupplyMintDailyP

function updateMaxGnsSupplyMintDailyP(uint256 newValue) external

updateMaxDiscountP

function updateMaxDiscountP(uint256 newValue) external

updateMaxDiscountThresholdP

function updateMaxDiscountThresholdP(uint256 newValue) external

maxAccPnlPerToken

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() public

tryResetDailyAccPnlDelta

function tryResetDailyAccPnlDelta() public

tryNewOpenPnlRequestOrEpoch

function tryNewOpenPnlRequestOrEpoch() public

transfer

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) external

cancelWithdrawRequest

function cancelWithdrawRequest(uint256 shares, address owner, uint256 unlockEpoch) external

depositWithDiscountAndLock

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) external

distributeReward

function distributeReward(uint256 assets) external

sendAssets

function sendAssets(uint256 assets, address receiver) external

receiveAssets

function receiveAssets(uint256 assets, address user) external

deplete

function deplete(uint256 assets) external

refill

function refill(uint256 assets) external

updateAccPnlPerTokenUsed

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)