params
Overview
The Mars Params Contract is published to Crates.io
This contract holds the following values for all the assets in Mars Protocol:
- Max Loan To Value: Max percentage of collateral that can be borrowed
- Liquidation Threshold: LTV at which the loan is defined as under collateralized and can be liquidated
- Liquidation Bonus: Percentage of extra collateral the liquidator gets as a bonus
- Deposit Enabled: Is the asset able to be deposited into the Red Bank
- Borrow Enabled: Is the asset able to be borrowed from the Red Bank
- Deposit Cap: Max amount that can be deposited into the Red Bank
- Asset Settings: Credit Manager and Red Bank Permission Settings
Credit Manager Vaults only utilize max loan to value, liquidation threshold, and deposit cap parameters, while Red Bank Markets utilize all of the above parameters.
High Levered Strategies (HLS)
An HLS is a position where the borrowed asset is highly correlated to the collateral asset (e.g. atom debt -> stAtom collateral). This has a low risk of liquidation. For this reason, Credit Manager grants higher MaxLTV & LiqThreshold parameters, granting higher leverage. An asset's HLS parameters are stored in this contract and are applied to credit accounts of the HLS type during a health check.
De-listing an HLS asset
There are a few scenarios depending on what denom is being de-listed. Always communicate each step to the users!
- De-listing a collateral denom:
- Set the MaxLTV of the denom to zero.
- Gradually reduce the HLS Liquidation Threshold to zero.
- Do not set HLS parameters to None or remove it from correlations list for debt denom. This would result in freezing the HLS accounts that have that collateral.
- De-listing a debt denom:
- Set the MaxLTV of all denoms in the debt denom's correlations list to zero.
- Gradually reduce the HLS Liquidation Threshold to zero.
- Do not set HLS parameters to None. This would result in freezing the HLS accounts that have that debt denom.
Links
- Deployments:
- Types:
- Rust:
- Typescript:
- Contract repo:
- Audits: https://github.com/mars-protocol/mars-audits
InstantiateMsg
_5{_5 "address_provider": "string", // Address of the address provider contract_5 "owner": "string", // Contract's owner _5 "target_health_factor": "Decimal" // Determines the ideal HF a position should be left at immediately after the position has been liquidated._5}
ExecuteMsg
update_owner
_3{_3 "update_owner": OwnerUpdate_3}
OwnerUpdate
_14| {_14 "propose_new_owner": {_14 "proposed": "string"_14 }_14 }_14| "clear_proposed"_14| "accept_proposed"_14| "abolish_owner_role"_14| {_14 "set_emergency_owner": {_14 "emergency_owner": "string"_14 }_14 }_14| "clear_emergency_owner"
update_asset_params
_3{_3 "update_asset_params": AssetParamsUpdate_3}
AssetParamsUpdate
_5{_5 "add_or_update": {_5 "params": AssetParamsBaseForString_5 }_5}
AssetParamsBaseForString
_10{_10 "credit_manager": CmSettingsForString,_10 "denom": "string",_10 "deposit_cap": "Uint128",_10 "liquidation_bonus": LiquidationBonus,_10 "liquidation_threshold": "Decimal",_10 "max_loan_to_value": "Decimal",_10 "protocol_liquidation_fee": "Decimal",_10 "red_bank": RedBankSettings_10}
CmSettingsForString
_4{_4 "hls"?: HlsParamsBaseForString | null,_4 "whitelisted": boolean_4}
HlsParamsBaseForString
_5{_5 "correlations": HlsAssetTypeForString[],_5 "liquidation_threshold": "Decimal",_5 "max_loan_to_value": "Decimal"_5}
HlsAssetTypeForString
_10| {_10 "coin": {_10 "denom": "string"_10 }_10 }_10| {_10 "vault": {_10 "addr": "string"_10 }_10 }
LiquidationBonus
_6{_6 "max_lb": "Decimal",_6 "min_lb": "Decimal",_6 "slope": "Decimal",_6 "starting_lb": "Decimal"_6}
RedBankSettings
_4{_4 "borrow_enabled": boolean,_4 "deposit_enabled": boolean_4}
update_target_health_factor
_3{_3 "update_target_health_factor": "Decimal"_3}
update_vault_config
_3{_3 "update_vault_config": VaultConfigUpdate_3}
VaultConfigUpdate
_5{_5 "add_or_update": {_5 "config": VaultConfigBaseForString_5 }_5}
VaultConfigBaseForString
_8{_8 "addr": "string",_8 "deposit_cap": Coin,_8 "hls"?: HlsParamsBaseForString | null,_8 "liquidation_threshold": "Decimal",_8 "max_loan_to_value": "Decimal",_8 "whitelisted": boolean_8}
Coin
_4{_4 "amount": "Uint128",_4 "denom": "string"_4}
HlsParamsBaseForString
See above.
emergency_update
_3{_3 "emergency_update": EmergencyUpdate_3}
EmergencyUpdate
_6| {_6 "credit_manager": CmEmergencyUpdate_6 }_6| {_6 "red_bank": RedBankEmergencyUpdate_6 }
CmEmergencyUpdate
_9| {_9 "set_zero_max_ltv_on_vault": "string"_9 }_9| {_9 "set_zero_deposit_cap_on_vault": "string"_9 }_9| {_9 "disallow_coin": "string"_9 }
RedBankEmergencyUpdate
_3{_3 "disable_borrowing": "string"_3}
QueryMsg
owner
_3{_3 "owner": {}_3}
asset_params
_5{_5 "asset_params": {_5 "denom": "string"_5 }_5}
all_asset_params
_6{_6 "all_asset_params": {_6 "limit"?: number | null,_6 "start_after"?: "string" | null_6 }_6}
vault_config
_5{_5 "vault_config": {_5 "address": "string"_5 }_5}
all_vault_configs
_6{_6 "all_vault_configs": {_6 "limit"?: number | null,_6 "start_after"?: "string" | null_6 }_6}
target_health_factor
_3{_3 "target_health_factor": {}_3}
total_deposit
Computes the total amount deposited of the given asset across Red Bank and Credit Manager.
_5{_5 "total_deposit": {_5 "denom": "string"_5 }_5}