Skip to main content
logo

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
NOTE

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.

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
}