LiquidityProtectionSettings
Liquidity Protection Settings contract
Functions:
Events:
Function constructor(contract IERC20 networkToken, contract IContractRegistry registry)
constructor(contract IERC20 networkToken, contract IContractRegistry registry)
initializes a new LiquidityProtectionSettings contract
Parameters:
registry
: contract registrynetworkToken
: the network token
Function networkToken() → contract IERC20
networkToken() → contract IERC20
returns the network token
Return Values:
the network token
Function minNetworkTokenLiquidityForMinting() → uint256
minNetworkTokenLiquidityForMinting() → uint256
returns the minimum network token liquidity for minting
Return Values:
the minimum network token liquidity for minting
Function defaultNetworkTokenMintingLimit() → uint256
defaultNetworkTokenMintingLimit() → uint256
returns the default network token minting limit
Return Values:
the default network token minting limit
Function networkTokenMintingLimits(contract IConverterAnchor poolAnchor) → uint256
networkTokenMintingLimits(contract IConverterAnchor poolAnchor) → uint256
returns the network token minting limit for a given pool
Parameters:
poolAnchor
: pool anchor
Return Values:
the network token minting limit for a given pool
Function addLiquidityDisabled(contract IConverterAnchor poolAnchor, contract IReserveToken reserveToken) → bool
addLiquidityDisabled(contract IConverterAnchor poolAnchor, contract IReserveToken reserveToken) → bool
returns the permission of adding liquidity for a given reserve on a given pool
Parameters:
poolAnchor
: pool anchorreserveToken
: reserve token
Return Values:
true if adding liquidity is disabled, false otherwise
Function minProtectionDelay() → uint256
minProtectionDelay() → uint256
returns the minimum number of seconds until any protection is in effect
Return Values:
the minimum number of seconds until any protection is in effect
Function maxProtectionDelay() → uint256
maxProtectionDelay() → uint256
returns the maximum number of seconds until full protection is in effect
Return Values:
the maximum number of seconds until full protection is in effect
Function minNetworkCompensation() → uint256
minNetworkCompensation() → uint256
returns the minimum amount of network tokens that the system can mint as compensation for base token losses
Return Values:
the minimum amount of network tokens that the system can mint as compensation for base token losses
Function lockDuration() → uint256
lockDuration() → uint256
returns the number of seconds from liquidation to full network token release
Return Values:
the number of seconds from liquidation to full network token release
Function averageRateMaxDeviation() → uint32
averageRateMaxDeviation() → uint32
returns the maximum deviation of the average rate from the spot rate
Return Values:
the maximum deviation of the average rate from the spot rate
Function addPoolToWhitelist(contract IConverterAnchor poolAnchor)
addPoolToWhitelist(contract IConverterAnchor poolAnchor)
adds a pool to the whitelist
can only be called by the contract owner
Parameters:
poolAnchor
: pool anchor
Function removePoolFromWhitelist(contract IConverterAnchor poolAnchor)
removePoolFromWhitelist(contract IConverterAnchor poolAnchor)
removes a pool from the whitelist
can only be called by the contract owner
Parameters:
poolAnchor
: pool anchor
Function isPoolWhitelisted(contract IConverterAnchor poolAnchor) → bool
isPoolWhitelisted(contract IConverterAnchor poolAnchor) → bool
checks whether a given pool is whitelisted
Parameters:
poolAnchor
: pool anchor
Return Values:
true if the given pool is whitelisted, false otherwise
Function poolWhitelist() → address[]
poolWhitelist() → address[]
returns pools whitelist
Return Values:
pools whitelist
Function addSubscriber(contract ILiquidityProvisionEventsSubscriber subscriber)
addSubscriber(contract ILiquidityProvisionEventsSubscriber subscriber)
adds a subscriber
can only be called by the contract owner
Parameters:
subscriber
: subscriber address
Function removeSubscriber(contract ILiquidityProvisionEventsSubscriber subscriber)
removeSubscriber(contract ILiquidityProvisionEventsSubscriber subscriber)
removes a subscriber
can only be called by the contract owner
Parameters:
subscriber
: subscriber address
Function subscribers() → address[]
subscribers() → address[]
returns subscribers list
Return Values:
subscribers list
Function setMinNetworkTokenLiquidityForMinting(uint256 amount)
setMinNetworkTokenLiquidityForMinting(uint256 amount)
updates the minimum amount of network token liquidity to allow minting
can only be called by the contract owner
Parameters:
amount
: the minimum amount of network token liquidity to allow minting
Function setDefaultNetworkTokenMintingLimit(uint256 amount)
setDefaultNetworkTokenMintingLimit(uint256 amount)
updates the default amount of network token that the system can mint into each pool
can only be called by the contract owner
Parameters:
amount
: the default amount of network token that the system can mint into each pool
Function setNetworkTokenMintingLimit(contract IConverterAnchor poolAnchor, uint256 amount)
setNetworkTokenMintingLimit(contract IConverterAnchor poolAnchor, uint256 amount)
updates the amount of network tokens that the system can mint into a specific pool
can only be called by the contract owner
Parameters:
poolAnchor
: pool anchoramount
: the amount of network tokens that the system can mint into a specific pool
Function setProtectionDelays(uint256 minDelay, uint256 maxDelay)
setProtectionDelays(uint256 minDelay, uint256 maxDelay)
updates the protection delays
can only be called by the contract owner
Parameters:
minDelay
: seconds until the protection startsmaxDelay
: seconds until full protection
Function setMinNetworkCompensation(uint256 amount)
setMinNetworkCompensation(uint256 amount)
updates the minimum amount of network token compensation
can only be called by the contract owner
Parameters:
amount
: the minimum amount of network token compensation
Function setLockDuration(uint256 duration)
setLockDuration(uint256 duration)
updates the network token lock duration
can only be called by the contract owner
Parameters:
duration
: network token lock duration, in seconds
Function setAverageRateMaxDeviation(uint32 deviation)
setAverageRateMaxDeviation(uint32 deviation)
sets the maximum deviation of the average rate from the spot rate
can only be called by the contract owner
Parameters:
deviation
: maximum deviation of the average rate from the spot rate
Function disableAddLiquidity(contract IConverterAnchor poolAnchor, contract IReserveToken reserveToken, bool disable)
disableAddLiquidity(contract IConverterAnchor poolAnchor, contract IReserveToken reserveToken, bool disable)
disables or enables adding liquidity for a given reserve on a given pool
can only be called by the contract owner
Parameters:
poolAnchor
: pool anchorreserveToken
: reserve tokendisable
: true to disable, false otherwise
Function isPoolSupported(contract IConverterAnchor poolAnchor) → bool
isPoolSupported(contract IConverterAnchor poolAnchor) → bool
checks if protection is supported for the given pool
only standard pools are supported (2 reserves, 50%/50% weights)
note that the pool should still be whitelisted
Parameters:
poolAnchor
: anchor of the pool
Return Values:
true if the pool is supported, false otherwise
Event PoolWhitelistUpdated(contract IConverterAnchor poolAnchor, bool added)
PoolWhitelistUpdated(contract IConverterAnchor poolAnchor, bool added)
triggered when the pool whitelist is updated
Parameters:
poolAnchor
: pool anchoradded
: true if the pool was added to the whitelist, false if it was removed
Event SubscriberUpdated(contract ILiquidityProvisionEventsSubscriber subscriber, bool added)
SubscriberUpdated(contract ILiquidityProvisionEventsSubscriber subscriber, bool added)
triggered when a subscriber is added or removed
Parameters:
subscriber
: subscriberadded
: true if the subscriber was added, false if it was removed
Event MinNetworkTokenLiquidityForMintingUpdated(uint256 prevMin, uint256 newMin)
MinNetworkTokenLiquidityForMintingUpdated(uint256 prevMin, uint256 newMin)
triggered when the minimum amount of network token liquidity to allow minting is updated
Parameters:
prevMin
: previous minimum amount of network token liquidity for mintingnewMin
: new minimum amount of network token liquidity for minting
Event DefaultNetworkTokenMintingLimitUpdated(uint256 prevDefault, uint256 newDefault)
DefaultNetworkTokenMintingLimitUpdated(uint256 prevDefault, uint256 newDefault)
triggered when the default network token minting limit is updated
Parameters:
prevDefault
: previous default network token minting limitnewDefault
: new default network token minting limit
Event NetworkTokenMintingLimitUpdated(contract IConverterAnchor poolAnchor, uint256 prevLimit, uint256 newLimit)
NetworkTokenMintingLimitUpdated(contract IConverterAnchor poolAnchor, uint256 prevLimit, uint256 newLimit)
triggered when a pool network token minting limit is updated
Parameters:
poolAnchor
: pool anchorprevLimit
: previous limitnewLimit
: new limit
Event ProtectionDelaysUpdated(uint256 prevMinProtectionDelay, uint256 newMinProtectionDelay, uint256 prevMaxProtectionDelay, uint256 newMaxProtectionDelay)
ProtectionDelaysUpdated(uint256 prevMinProtectionDelay, uint256 newMinProtectionDelay, uint256 prevMaxProtectionDelay, uint256 newMaxProtectionDelay)
triggered when the protection delays are updated
Parameters:
prevMinProtectionDelay
: previous seconds until the protection startsnewMinProtectionDelay
: new seconds until the protection startsprevMaxProtectionDelay
: previous seconds until full protectionnewMaxProtectionDelay
: new seconds until full protection
Event MinNetworkCompensationUpdated(uint256 prevMinNetworkCompensation, uint256 newMinNetworkCompensation)
MinNetworkCompensationUpdated(uint256 prevMinNetworkCompensation, uint256 newMinNetworkCompensation)
triggered when the minimum network token compensation is updated
Parameters:
prevMinNetworkCompensation
: previous minimum network token compensationnewMinNetworkCompensation
: new minimum network token compensation
Event LockDurationUpdated(uint256 prevLockDuration, uint256 newLockDuration)
LockDurationUpdated(uint256 prevLockDuration, uint256 newLockDuration)
triggered when the network token lock duration is updated
Parameters:
prevLockDuration
: previous network token lock duration, in secondsnewLockDuration
: new network token lock duration, in seconds
Event AverageRateMaxDeviationUpdated(uint32 prevAverageRateMaxDeviation, uint32 newAverageRateMaxDeviation)
AverageRateMaxDeviationUpdated(uint32 prevAverageRateMaxDeviation, uint32 newAverageRateMaxDeviation)
triggered when the maximum deviation of the average rate from the spot rate is updated
Parameters:
prevAverageRateMaxDeviation
: previous maximum deviation of the average rate from the spot ratenewAverageRateMaxDeviation
: new maximum deviation of the average rate from the spot rate
Event AddLiquidityDisabled(contract IConverterAnchor poolAnchor, contract IReserveToken reserveToken, bool disabled)
AddLiquidityDisabled(contract IConverterAnchor poolAnchor, contract IReserveToken reserveToken, bool disabled)
triggered when adding liquidity is disabled or enabled for a given reserve on a given pool
Parameters:
poolAnchor
: pool anchorreserveToken
: reserve tokendisabled
: true if disabled, false otherwise
Last updated