LiquidityProtectionSettings

Liquidity Protection Settings contract

Functions:

Events:

Function constructor(contract IERC20 networkToken, contract IContractRegistry registry)

initializes a new LiquidityProtectionSettings contract

Parameters:

  • registry: contract registry

  • networkToken: the network token

Function networkToken() → contract IERC20

returns the network token

Return Values:

  • the network token

Function minNetworkTokenLiquidityForMinting() → uint256

returns the minimum network token liquidity for minting

Return Values:

  • the minimum network token liquidity for minting

Function defaultNetworkTokenMintingLimit() → uint256

returns the default network token minting limit

Return Values:

  • the default network token minting limit

Function 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

returns the permission of adding liquidity for a given reserve on a given pool

Parameters:

  • poolAnchor: pool anchor

  • reserveToken: reserve token

Return Values:

  • true if adding liquidity is disabled, false otherwise

Function 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

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

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

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

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)

adds a pool to the whitelist

can only be called by the contract owner

Parameters:

  • poolAnchor: pool anchor

Function 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

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[]

returns pools whitelist

Return Values:

  • pools whitelist

Function addSubscriber(contract ILiquidityProvisionEventsSubscriber subscriber)

adds a subscriber

can only be called by the contract owner

Parameters:

  • subscriber: subscriber address

Function removeSubscriber(contract ILiquidityProvisionEventsSubscriber subscriber)

removes a subscriber

can only be called by the contract owner

Parameters:

  • subscriber: subscriber address

Function subscribers() → address[]

returns subscribers list

Return Values:

  • subscribers list

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

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)

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 anchor

  • amount: the amount of network tokens that the system can mint into a specific pool

Function setProtectionDelays(uint256 minDelay, uint256 maxDelay)

updates the protection delays

can only be called by the contract owner

Parameters:

  • minDelay: seconds until the protection starts

  • maxDelay: seconds until full protection

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

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)

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)

disables or enables adding liquidity for a given reserve on a given pool

can only be called by the contract owner

Parameters:

  • poolAnchor: pool anchor

  • reserveToken: reserve token

  • disable: true to disable, false otherwise

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

triggered when the pool whitelist is updated

Parameters:

  • poolAnchor: pool anchor

  • added: true if the pool was added to the whitelist, false if it was removed

Event SubscriberUpdated(contract ILiquidityProvisionEventsSubscriber subscriber, bool added)

triggered when a subscriber is added or removed

Parameters:

  • subscriber: subscriber

  • added: true if the subscriber was added, false if it was removed

Event 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 minting

  • newMin: new minimum amount of network token liquidity for minting

Event DefaultNetworkTokenMintingLimitUpdated(uint256 prevDefault, uint256 newDefault)

triggered when the default network token minting limit is updated

Parameters:

  • prevDefault: previous default network token minting limit

  • newDefault: new default network token minting limit

Event NetworkTokenMintingLimitUpdated(contract IConverterAnchor poolAnchor, uint256 prevLimit, uint256 newLimit)

triggered when a pool network token minting limit is updated

Parameters:

  • poolAnchor: pool anchor

  • prevLimit: previous limit

  • newLimit: new limit

Event ProtectionDelaysUpdated(uint256 prevMinProtectionDelay, uint256 newMinProtectionDelay, uint256 prevMaxProtectionDelay, uint256 newMaxProtectionDelay)

triggered when the protection delays are updated

Parameters:

  • prevMinProtectionDelay: previous seconds until the protection starts

  • newMinProtectionDelay: new seconds until the protection starts

  • prevMaxProtectionDelay: previous seconds until full protection

  • newMaxProtectionDelay: new seconds until full protection

Event MinNetworkCompensationUpdated(uint256 prevMinNetworkCompensation, uint256 newMinNetworkCompensation)

triggered when the minimum network token compensation is updated

Parameters:

  • prevMinNetworkCompensation: previous minimum network token compensation

  • newMinNetworkCompensation: new minimum network token compensation

Event LockDurationUpdated(uint256 prevLockDuration, uint256 newLockDuration)

triggered when the network token lock duration is updated

Parameters:

  • prevLockDuration: previous network token lock duration, in seconds

  • newLockDuration: new network token lock duration, in seconds

Event 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 rate

  • newAverageRateMaxDeviation: new maximum deviation of the average rate from the spot rate

Event 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 anchor

  • reserveToken: reserve token

  • disabled: true if disabled, false otherwise

Last updated