KlpManager
Mantle0x3c4de8fb37055500bb3d18eae8dd0dfff527090e
Solidity v0.6.12+commit.27d51765
概覽
讀取函式
Returns the divisor used to express basis points for fee and percentage calculations.✨ AI
回傳值
| 名稱 | 類型 | 描述 |
|---|---|---|
| — | uint256 | The basis points divisor (denominator for basis-point calculations), typically 10000.✨ AI |
Get the precision multiplier used for KLP calculations.✨ AI
回傳值
| 名稱 | 類型 | 描述 |
|---|---|---|
| — | uint256 | The KLP precision constant as a uint256, a scaling factor used in KLP arithmetic and comparisons.✨ AI |
Returns the maximum cooldown duration that the manager enforces.✨ AI
回傳值
| 名稱 | 類型 | 描述 |
|---|---|---|
| — | uint256 | The maximum cooldown duration as a uint256, expressed in seconds.✨ AI |
Get the constant used as the precision for price calculations.✨ AI
回傳值
| 名稱 | 類型 | 描述 |
|---|---|---|
| — | uint256 | The price precision constant (scaling factor) used to represent fractional prices as an integer.✨ AI |
Returns the number of decimal places used by the USDG token.✨ AI
回傳值
| 名稱 | 類型 | 描述 |
|---|---|---|
| — | uint256 | Number of decimal places for the USDG token as a uint256.✨ AI |
Returns the additional AUM amount added to total assets under management for KLP valuation.✨ AI
回傳值
| 名稱 | 類型 | 描述 |
|---|---|---|
| — | uint256 | Additional AUM amount added to total assets under management, expressed in the contract's uint256 units.✨ AI |
Return the current deduction applied to assets under management (AUM).✨ AI
回傳值
| 名稱 | 類型 | 描述 |
|---|---|---|
| — | uint256 | Amount deducted from total AUM used in fee and valuation calculations.✨ AI |
Returns the cooldown period required before a user can perform certain KLP actions.✨ AI
回傳值
| 名稱 | 類型 | 描述 |
|---|---|---|
| — | uint256 | The cooldown duration in seconds as an unsigned integer.✨ AI |
Returns the current assets under management (AUM) for the KLP as a uint256 value.✨ AI
參數
| 名稱 | 類型 | 描述 |
|---|---|---|
| maximise | bool | If true, compute AUM using optimistic/pricing assumptions; if false, use conservative assumptions.✨ AI |
回傳值
| 名稱 | 類型 | 描述 |
|---|---|---|
| — | uint256 | Total AUM as a uint256 amount denominated in the contract's base token units (wei).✨ AI |
Return the total assets under management for the Klp denominated in USDG.✨ AI
參數
| 名稱 | 類型 | 描述 |
|---|---|---|
| maximise | bool | If true, use pricing adjustments that increase the reported AUM; if false, use adjustments that lower it.✨ AI |
回傳值
| 名稱 | 類型 | 描述 |
|---|---|---|
| — | uint256 | A uint256 value representing the assets under management expressed in USDG token units.✨ AI |
Return the current assets-under-management (AUM) values for the manager.✨ AI
回傳值
| 名稱 | 類型 | 描述 |
|---|---|---|
| — | uint256[] | Array of AUM values expressed in the token smallest unit (wei), one entry per tracked asset or category in the contract-defined order.✨ AI |
Return the current global average price for short positions of the specified token.✨ AI
參數
| 名稱 | 類型 | 描述 |
|---|---|---|
| _token | address | Token contract address to query the global short average price for.✨ AI |
回傳值
| 名稱 | 類型 | 描述 |
|---|---|---|
| — | uint256 | Global average price for short positions of the token, returned as a uint256 price value.✨ AI |
Calculate the current global short delta for a token using the provided price and short size.✨ AI
參數
| 名稱 | 類型 | 描述 |
|---|---|---|
| _token | address | Token address for which to compute the global short delta.✨ AI |
| _price | uint256 | Price to use for the calculation, in the contract's price units.✨ AI |
| _size | uint256 | Total short size to use when computing the delta.✨ AI |
回傳值
| 名稱 | 類型 | 描述 |
|---|---|---|
| — | uint256 | The absolute delta amount (uint256) for global short positions using the given price and size.✨ AI |
| — | bool | Boolean indicating whether the delta represents a profit (true) or a loss (false) for shorts.✨ AI |
Return the current KLP token price; choose a conservative or optimistic value based on _maximise.✨ AI
參數
| 名稱 | 類型 | 描述 |
|---|---|---|
| _maximise | bool | If true, return the maximized (optimistic) price; if false, return the minimized (conservative) price.✨ AI |
回傳值
| 名稱 | 類型 | 描述 |
|---|---|---|
| — | uint256 | KLP price as a uint256, scaled by the contract's internal price precision.✨ AI |
Returns the current governance (gov) address for the KlpManager.✨ AI
回傳值
| 名稱 | 類型 | 描述 |
|---|---|---|
| — | address | The address that holds governance privileges (gov).✨ AI |
Reports whether the KlpManager contract is operating in private mode.✨ AI
回傳值
| 名稱 | 類型 | 描述 |
|---|---|---|
| — | bool | True if the contract is in private mode, otherwise false.✨ AI |
Returns true if a given address is registered as an authorized handler.✨ AI
參數
| 名稱 | 類型 | 描述 |
|---|---|---|
| — | address |
回傳值
| 名稱 | 類型 | 描述 |
|---|---|---|
| — | bool | True if the address is registered as an authorized handler, otherwise false.✨ AI |
Returns the KLP token contract address.✨ AI
回傳值
| 名稱 | 類型 | 描述 |
|---|---|---|
| — | address | The address of the KLP token contract.✨ AI |
Returns the Unix timestamp (in seconds) when the address last added KLP tokens.✨ AI
參數
| 名稱 | 類型 | 描述 |
|---|---|---|
| — | address |
回傳值
| 名稱 | 類型 | 描述 |
|---|---|---|
| — | uint256 | Unix timestamp (seconds) of the last addition for the address; zero if the address never added KLP.✨ AI |
Returns the address of the contract that tracks short positions (shorts tracker).✨ AI
回傳值
| 名稱 | 類型 | 描述 |
|---|---|---|
| — | address | The address of the shorts tracker contract used to record and manage short positions.✨ AI |
Returns the weighted average price used by the shorts tracker.✨ AI
回傳值
| 名稱 | 類型 | 描述 |
|---|---|---|
| — | uint256 | The weighted average price for shorts tracking expressed as a uint256 using the contract's price precision.✨ AI |
Returns the USDG token contract address used by this manager.✨ AI
回傳值
| 名稱 | 類型 | 描述 |
|---|---|---|
| — | address | Address of the USDG token contract used by the manager.✨ AI |
Returns the address of the vault contract used by the KLP manager.✨ AI
回傳值
| 名稱 | 類型 | 描述 |
|---|---|---|
| — | address | The vault contract address that the manager interacts with.✨ AI |
寫入函式
Deposit a token to add liquidity and receive KLP tokens.✨ AI
參數
| 名稱 | 類型 | 描述 |
|---|---|---|
| _token | address | Address of the token to deposit.✨ AI |
| _amount | uint256 | Amount of the token to deposit.✨ AI |
| _minUsdg | uint256 | Minimum USDG amount accepted to protect against slippage.✨ AI |
| _minKlp | uint256 | Minimum KLP tokens expected to receive to protect against slippage.✨ AI |
回傳值
| 名稱 | 類型 | 描述 |
|---|---|---|
| — | uint256 | Amount of KLP tokens minted for the deposit.✨ AI |
Add liquidity to the KLP pool for an account using tokens supplied by a funding account.✨ AI
參數
| 名稱 | 類型 | 描述 |
|---|---|---|
| _fundingAccount | address | Address that supplies the tokens to add as liquidity.✨ AI |
| _account | address | Address that will receive the minted KLP tokens.✨ AI |
| _token | address | ERC20 token address to deposit into the liquidity pool.✨ AI |
| _amount | uint256 | Amount of the token to deposit (in the token's smallest unit).✨ AI |
| _minUsdg | uint256 | Minimum acceptable USDG value to mint from the deposit to protect against slippage.✨ AI |
| _minKlp | uint256 | Minimum KLP tokens expected to be minted; transaction reverts if this is not met.✨ AI |
回傳值
| 名稱 | 類型 | 描述 |
|---|---|---|
| — | uint256 | The amount of KLP tokens minted and credited to the account.✨ AI |
Burn KLP tokens to remove liquidity and transfer the requested token to the receiver.✨ AI
參數
| 名稱 | 類型 | 描述 |
|---|---|---|
| _tokenOut | address | Address of the token to receive when removing liquidity.✨ AI |
| _klpAmount | uint256 | Amount of KLP tokens to burn for liquidity withdrawal.✨ AI |
| _minOut | uint256 | Minimum acceptable amount of tokenOut to receive; transaction reverts if lower.✨ AI |
| _receiver | address | Address that will receive the output tokens.✨ AI |
回傳值
| 名稱 | 類型 | 描述 |
|---|---|---|
| — | uint256 | The number of tokenOut tokens actually transferred to the receiver.✨ AI |
Remove KLP liquidity from an account and convert it to a specified token sent to the receiver.✨ AI
參數
| 名稱 | 類型 | 描述 |
|---|---|---|
| _account | address | Address of the account whose KLP balance will be reduced.✨ AI |
| _tokenOut | address | Address of the token to receive when KLP is burned.✨ AI |
| _klpAmount | uint256 | Quantity of KLP to remove (in KLP token units).✨ AI |
| _minOut | uint256 | Minimum acceptable amount of tokenOut to protect against slippage.✨ AI |
| _receiver | address | Address that will receive the output token.✨ AI |
回傳值
| 名稱 | 類型 | 描述 |
|---|---|---|
| — | uint256 | Amount of tokenOut tokens actually transferred to the receiver as a result of the removal.✨ AI |
Set the AUM addition and deduction values used to adjust the reported assets under management.✨ AI
參數
| 名稱 | 類型 | 描述 |
|---|---|---|
| _aumAddition | uint256 | Amount to add to AUM when applying upward adjustments.✨ AI |
| _aumDeduction | uint256 | Amount to subtract from AUM when applying downward adjustments.✨ AI |
Set the cooldown duration used before users can withdraw after staking.✨ AI
參數
| 名稱 | 類型 | 描述 |
|---|---|---|
| _cooldownDuration | uint256 | New cooldown duration in seconds.✨ AI |
Update the contract governance address to a new address.✨ AI
參數
| 名稱 | 類型 | 描述 |
|---|---|---|
| _gov | address | New governance address that will have administrative permissions.✨ AI |
參數
| 名稱 | 類型 | 描述 |
|---|---|---|
| _handler | address | |
| _isActive | bool |
參數
| 名稱 | 類型 | 描述 |
|---|---|---|
| _inPrivateMode | bool |
參數
| 名稱 | 類型 | 描述 |
|---|---|---|
| _shortsTracker | address |
參數
| 名稱 | 類型 | 描述 |
|---|---|---|
| _shortsTrackerAveragePriceWeight | uint256 |
事件
| 名稱 | 類型 | 已索引 | 描述 |
|---|---|---|---|
| account | address | ||
| token | address | ||
| amount | uint256 | ||
| aumInUsdg | uint256 | ||
| klpSupply | uint256 | ||
| usdgAmount | uint256 | ||
| mintAmount | uint256 |
| 名稱 | 類型 | 已索引 | 描述 |
|---|---|---|---|
| account | address | ||
| token | address | ||
| klpAmount | uint256 | ||
| aumInUsdg | uint256 | ||
| klpSupply | uint256 | ||
| usdgAmount | uint256 | ||
| amountOut | uint256 |