ICollateralManager
Last updated
Was this helpful?
Last updated
Was this helpful?
Get the address of vault
Return Values:
vault
address
address of vault
Get the address of clearing house config
Return Values:
clearingHouseConfig
address
address of clearing house config
Get collateral config by token address
token
address
address of token
collateral
struct Collateral.Config
config
Get price feed decimals of the collateral token
token
address
address of token
decimals
uint8
of the price feed
Get the price of the collateral token
token
address
address of token
price
uint256
of the certain period
Get the max number of collateral tokens per account
max
uint8
number of collateral tokens per account
Get the minimum margin ratio - mmRatio
before the account's collateral is liquidatable
6 decimals, same decimals as _mmRatio
Get the maximum debt / nonSettlementTokenValue
before the account's collaterals are liquidated
6 decimals
Get the maximum ratio of debt can be repaid in one transaction
6 decimals. For example, liquidationRatio
= 50% means the liquidator can repay as much as half of the trader’s debt in one liquidation
liquidation
uint24
ratio
Get the insurance fund fee ratio when liquidating a trader's collateral
6 decimals. For example, clInsuranceFundFeeRatio
= 5% means the liquidator will pay 5% of transferred settlement token to insurance fund
insurance
uint24
fund fee ratio
Get the default maximum debt (denominated in settlement token) allowed before an account’s collateral is liquidatable.
6 decimals
Get the maximum whitelisted debt (denominated in settlement token) allowed before an account’s collateral is liquidatable.
6 decimals
Get the total whitelisted debt (denominated in settlement token) allowed
6 decimals
Get the threshold of the minium repaid. If a trader’s collateral value (denominated in settlement token) falls below the threshold, the liquidator can convert it with 100% liquidationRatio
so there is no dust left
6 decimals
Dust
uint256
collateral value
Check if the given token is one of collateral tokens
token
address
address of token
true
bool
if the token is one of collateral tokens
Require and get the the valid collateral maintenance margin ratio by mmRatioBuffer
mmRatioBuffer
uint24
safe margin ratio buffer; 6 decimals, same decimals as _mmRatio
collateralMmRatio
uint24
the collateral maintenance margin ratio
Emitted when owner add collateral
token
address
address of token
priceFeed
address
address of price feed
collateralRatio
uint24
collateral ratio
discountRatio
uint24
discount ratio for the collateral liquidation
depositCap
uint256
max amount of collateral that can be deposited
Emitted when owner update the address of clearing house config
clearingHouseConfig
address
address of clearing house config
Emitted when owner update the address of vault
vault
address
address of vault
Emitted when owner update the price feed address of a collateral token
token
address
address of token
priceFeed
address
address of price feed
Emitted when owner update the collateral ratio of a collateral token
token
address
address of token
collateralRatio
uint24
collateral ratio
Emitted when owner change the discount ratio
token
address
address of token
discountRatio
uint24
discount ratio for the collateral liquidation
Emitted when owner update the deposit cap of a collateral token
token
address
address of token
depositCap
uint256
max amount of the collateral that can be deposited
Emitted when owner init or update the max collateral tokens that per account can have, this is can prevent high gas cost.
maxCollateralTokensPerAccount
uint8
max amount of collateral tokens that per account can have
Emitted when owner init or update the maintenance margin ratio buffer, the value provides a safe range between the mmRatio & the collateralMMRatio.
mmRatioBuffer
uint24
safe buffer number (bps)
Emitted when owner init or update the debt non-settlement token value ratio, maximum debt / nonSettlementTokenValue
before the account's is liquidatable
debtNonSettlementTokenValueRatio
uint24
debt non-settlement token value ratio, ≤ 1
Emitted when owner init or update the liquidation ratio, the value presents the max repaid ratio of the collateral liquidation.
liquidationRatio
uint24
liquidation ratio, ≤ 1
Emitted when owner init or update the clearing house insurance fund fee ratio, charge fee for clearing house insurance fund.
clInsuranceFundFeeRatio
uint24
clearing house insurance fund fee ratio, ≤ 1
Emitted when owner init or update the debt threshold, maximum debt allowed before an account’s collateral is liquidatable.
debtThreshold
uint256
debt threshold
Emitted when owner init or update the whitelisted debt threshold, maximum debt allowed before an account’s collateral is liquidatable.
whitelistedDebtThreshold
address
whitelisted debt threshold
Emitted when owner init or update the collateral value dust, if a trader’s debt value falls below this dust threshold, the liquidator will ignore the liquidationRatio.
collateralValueDust
uint256
collateral value dust
Parameters:
Return Values:
Parameters:
Return Values:
Parameters:
Return Values:
Return Values:
Return Values:
Return Values:
Return Values:
Parameters:
Return Values:
Parameters:
Return Values:
Parameters:
Parameters:
Parameters:
Parameters:
Parameters:
Parameters:
Parameters:
Parameters:
Parameters:
Parameters:
Parameters:
Parameters:
Parameters:
Parameters:
Parameters: