KlpManager

Mantle

0x3c4de8fb37055500bb3d18eae8dd0dfff527090e

Solidity v0.6.12+commit.27d51765

🤖
通过你的 AI 查询此合约
引用: 0x3c4de8fb37055500bb3d18eae8dd0dfff527090e
示例提示词: "Tell me the current state of mantle/0x3c4de8fb37055500bb3d18eae8dd0dfff527090e"
还没有接入 AI?→ mcp.smarts.md
Mantle 在 Smarts 上是仅文档链:源代码和 ABI 已索引,但当前不提供实时链上数据(状态、最新事件、管理员画像)。AI 代理仍可通过 MCP 调用 get_contract_info 和 get_contract_source。

概览

读取函数
23
写入函数
11
事件
2

读取函数

BASIS_POINTS_DIVISOR() view

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
KLP_PRECISION() view

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
MAX_COOLDOWN_DURATION() view

Returns the maximum cooldown duration that the manager enforces.✨ AI

返回值

名称 类型 描述
uint256 The maximum cooldown duration as a uint256, expressed in seconds.✨ AI
PRICE_PRECISION() view

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
USDG_DECIMALS() view

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
aumAddition() view

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
aumDeduction() view

Return the current deduction applied to assets under management (AUM).✨ AI

返回值

名称 类型 描述
uint256 Amount deducted from total AUM used in fee and valuation calculations.✨ AI
cooldownDuration() view

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
getAum(maximise: bool) view

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
getAumInUsdg(maximise: bool) view

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
getAums() view

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
getGlobalShortAveragePrice(_token: address) view

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
getGlobalShortDelta(_token: address, _price: uint256, _size: uint256) view

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
getPrice(_maximise: bool) view

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
gov() view

Returns the current governance (gov) address for the KlpManager.✨ AI

返回值

名称 类型 描述
address The address that holds governance privileges (gov).✨ AI
inPrivateMode() view

Reports whether the KlpManager contract is operating in private mode.✨ AI

返回值

名称 类型 描述
bool True if the contract is in private mode, otherwise false.✨ AI
isHandler(address) view

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
klp() view

Returns the KLP token contract address.✨ AI

返回值

名称 类型 描述
address The address of the KLP token contract.✨ AI
lastAddedAt(address) view

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
shortsTracker() view

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
shortsTrackerAveragePriceWeight() view

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
usdg() view

Returns the USDG token contract address used by this manager.✨ AI

返回值

名称 类型 描述
address Address of the USDG token contract used by the manager.✨ AI
vault() view

Returns the address of the vault contract used by the KLP manager.✨ AI

返回值

名称 类型 描述
address The vault contract address that the manager interacts with.✨ AI

写入函数

addLiquidity(_token: address, _amount: uint256, _minUsdg: uint256, _minKlp: uint256) nonpayable

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
addLiquidityForAccount(_fundingAccount: address, _account: address, _token: address, _amount: uint256, _minUsdg: uint256, _minKlp: uint256) nonpayable

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
removeLiquidity(_tokenOut: address, _klpAmount: uint256, _minOut: uint256, _receiver: address) nonpayable

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
removeLiquidityForAccount(_account: address, _tokenOut: address, _klpAmount: uint256, _minOut: uint256, _receiver: address) nonpayable

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
setAumAdjustment(_aumAddition: uint256, _aumDeduction: uint256) nonpayable

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
setCooldownDuration(_cooldownDuration: uint256) nonpayable

Set the cooldown duration used before users can withdraw after staking.✨ AI

参数

名称 类型 描述
_cooldownDuration uint256 New cooldown duration in seconds.✨ AI
setGov(_gov: address) nonpayable

Update the contract governance address to a new address.✨ AI

参数

名称 类型 描述
_gov address New governance address that will have administrative permissions.✨ AI
setHandler(_handler: address, _isActive: bool) nonpayable

参数

名称 类型 描述
_handler address
_isActive bool
setInPrivateMode(_inPrivateMode: bool) nonpayable

参数

名称 类型 描述
_inPrivateMode bool
setShortsTracker(_shortsTracker: address) nonpayable

参数

名称 类型 描述
_shortsTracker address
setShortsTrackerAveragePriceWeight(_shortsTrackerAveragePriceWeight: uint256) nonpayable

参数

名称 类型 描述
_shortsTrackerAveragePriceWeight uint256

事件

AddLiquidity(account: address, token: address, amount: uint256, aumInUsdg: uint256, klpSupply: uint256, usdgAmount: uint256, mintAmount: uint256)
名称 类型 已索引 描述
account address
token address
amount uint256
aumInUsdg uint256
klpSupply uint256
usdgAmount uint256
mintAmount uint256
RemoveLiquidity(account: address, token: address, klpAmount: uint256, aumInUsdg: uint256, klpSupply: uint256, usdgAmount: uint256, amountOut: uint256)
名称 类型 已索引 描述
account address
token address
klpAmount uint256
aumInUsdg uint256
klpSupply uint256
usdgAmount uint256
amountOut uint256