Documentation
SocialsStatisticsLaunch App
  • Welcome to Mars Protocol
  • Getting Started
    • How to set up a Wallet
    • Connect your wallet
    • Using a Credit Account
  • Credit Accounts
  • Perpetual Futures (Perps)
    • Perps Vault (Counterparty Vault)
    • Funding Rate Mechanism
    • Price Impact
    • Open Interest Caps
    • Vault Solvency Protection
    • Health Factor
    • Liquidations
  • Spot & Margin Trading
  • Lending & Borrowing
  • Leveraged Yield Farming
  • High Leverage Strategies
  • Managed Vaults
    • Creating a Vault
      • How to Resume Vault Creation After Failed Transaction
    • Managing a Vault
    • Depositing into Vault
  • Risk Methodology
    • Asset Listing
    • Protocol Risk Framework
    • Perps Risk Framework
      • Maximum Leverage & LTVs
      • SkewScale
      • Open Interest Caps
      • Maximum Funding Velocity
      • Mitigating Risks of Static Parameters
    • Deposit Caps Risk Framework
  • Governance
    • MARS Token
  • Smart Contracts
    • Address Provider
    • Account NFT
    • Credit Manager
    • Health
    • Incentives
    • Oracle
    • Params
    • Red Bank
    • Rewards Collector
    • Swapper
    • Zapper
    • Perps
  • Brand kit
    • The Mars Brand
  • Legal
    • Mars FUD Bible
    • Terms of Service
    • Privacy Policy
    • Cookie Policy
Powered by GitBook
On this page
  • Deployments
  • Types
  • Queries
  • Methods
Edit on GitHub
Export as PDF
  1. Smart Contracts

Params

The Params Contract provides market, vault, and perp data. It is mandatory to whitelist and enable markets throughout the Mars Protocol ecosystem.

Last updated 25 days ago

Deployments

Neutron:

Osmosis:


Types

The types of the Params Contract can be found .

For reference on the Queries and Methods:

Base Types
type Addr = string
type Decimal = string
type Uint128 = string

Queries

all_asset_params (outdated)

Returns all asset params.

Query message
{
    all_asset_params: {
        limit?: number | null
        start_after?: string | null
    }  
}
Return output
{
    data: [
        {
            close_factor: Decimal
            credit_manager: {
                hls?: {
                    correlations: [
                        {
                            coin: {
                                denom: string
                            }
                        } | {
                            vault: {
                                addr: Addr
                            }
                        },
                        ...
                    ]
                    liquidation_threshold: Decimal
                    max_loan_to_value: Decimal
                } | null
                whitelisted: boolean
                withdraw_enabled: boolean
            }
            denom: string
            deposit_cap: Uint128
            liquidation_bonus: {
                max_lb: Decimal
                min_lb: Decimal
                slope: Decimal
                starting_lb: Decimal
            }
            liquidation_threshold: Decimal
            max_loan_to_value: Decimal
            protocol_liquidation_fee: Decimal
            red_bank: {
                borrow_enabled: boolean
                deposit_enabled: boolean
                withdraw_enabled: boolean
            }
        },
        ...
    ]
}

all_asset_params_v2

Query message
{
    all_asset_params_v2: {
        limit?: number | null
        start_after?: string | null
    }
}
Return output
{
    data: {
        data: [
            {
                close_factor: Decimal
                credit_manager: {
                    hls?: {
                        correlations: [
                            {
                                coin: {
                                    denom: string
                                }
                            } | {
                                vault: {
                                    addr: Addr
                                }
                            },
                            ...
                        ]
                        liquidation_threshold: Decimal
                        max_loan_to_value: Decimal
                    } | null
                    whitelisted: boolean
                    withdraw_enabled: boolean
                }
                denom: string
                deposit_cap: Uint128
                liquidation_bonus: {
                    max_lb: Decimal
                    min_lb: Decimal
                    slope: Decimal
                    starting_lb: Decimal
                }
                liquidation_threshold: Decimal
                max_loan_to_value: Decimal
                protocol_liquidation_fee: Decimal
                red_bank: {
                    borrow_enabled: boolean
                    deposit_enabled: boolean
                    withdraw_enabled: boolean
                }
            },
            ...
        ]
        metadata: {
            has_more: boolean
        }
    }
}

all_perp_params (outdated)

Query message
{
    all_perp_params: {
        limit?: number | null
        start_after?: string | null
    }  
}
Return output
{
    data: [
          closing_fee_rate: Decimal
          denom: string
          enabled: boolean
          liquidation_threshold: Decimal
          max_funding_velocity: Decimal
          max_loan_to_value: Decimal
          max_long_oi_value: Uint128
          max_net_oi_value: Uint128
          max_position_value?: Uint128 | null
          max_short_oi_value: Uint128
          min_position_value: Uint128
          opening_fee_rate: Decimal
          skew_scale: Uint128
    ]
}

all_perp_params_v2

Query message
{
    all_perp_params_v2: {
        limit?: number | null
        start_after?: string | null
    }
}
Return output
{
    data: {
          data: [
                closing_fee_rate: Decimal
                denom: string
                enabled: boolean
                liquidation_threshold: Decimal
                max_funding_velocity: Decimal
                max_loan_to_value: Decimal
                max_long_oi_value: Uint128
                max_net_oi_value: Uint128
                max_position_value?: Uint128 | null
                max_short_oi_value: Uint128
                min_position_value: Uint128
                opening_fee_rate: Decimal
                skew_scale: Uint128
          ]
          metadata: {
            has_more: boolean
        }
    }
}

all_total_deposits_v2

Query message
{
    all_total_deposits_v2: {
        limit?: number | null
        start_after?: string | null
    }
}
Return output
{
      data: {
          data: [
              {
                  amount: Uint128
                  cap: Uint128
                  denom: string
              },
              ...
          ]
          metadata: {
            has_more: boolean
        }
    }
}

all_vault_configs (outdated)

Query message
{
    all_vault_configs: {
        limit?: number | null
        start_after?: string | null
    } 
}
Return output
{
    data: [
        {
            addr: Addr
            deposit_cap: Coin
            hls?: {
                correlations: [
                    {
                        coin: {
                            denom: string
                        }
                    } | {
                        vault: {
                            addr: Addr
                        }
                    },
                    ...
                ]
                liquidation_threshold: Decimal
                max_loan_to_value: Decimal
            } | null
            liquidation_threshold: Decimal
            max_loan_to_value: Decimal
            whitelisted: boolean
        },
        ...
    ]
}

all_vault_configs_v2

Query message
{
    all_vault_configs_v2: {
        limit?: number | null
        start_after?: string | null
    }
}
Return output
{
    data: {
        data: [
            {
                addr: Addr
                deposit_cap: Coin
                hls?: {
                    correlations: [
                        {
                            coin: {
                                denom: string
                            }
                        } | {
                            vault: {
                                addr: Addr
                            }
                        },
                        ...
                    ]
                    liquidation_threshold: Decimal
                    max_loan_to_value: Decimal
                } | null
                liquidation_threshold: Decimal
                max_loan_to_value: Decimal
                whitelisted: boolean
            },
            ...
        ],
        metadata: {
            has_more: boolean
        }
    }
}

asset_params

Query message
{
    asset_params: {
        denom: string
    }   
}
Return output
{
    data: {
        close_factor: Decimal
        credit_manager: {
            hls?: {
                correlations: [
                    {
                        coin: {
                            denom: string
                        }
                    } | {
                        vault: {
                            addr: Addr
                        }
                    },
                    ...
                ]
                liquidation_threshold: Decimal
                max_loan_to_value: Decimal
            } | null
            whitelisted: boolean
            withdraw_enabled: boolean
        }
        denom: string
        deposit_cap: Uint128
        liquidation_bonus: {
            max_lb: Decimal
            min_lb: Decimal
            slope: Decimal
            starting_lb: Decimal
        }
        liquidation_threshold: Decimal
        max_loan_to_value: Decimal
        protocol_liquidation_fee: Decimal
        red_bank: {
            borrow_enabled: boolean
            deposit_enabled: boolean
            withdraw_enabled: boolean
        }
    }
}

config

Query message
{
    config: {}    
}
Return output
{
    data: {
        address_provider: string
        max_perp_params: number
    }
}

managed_vault_config

Query message
{
    managed_vault_config: {}
}
Return output
{
    data: {
        code_ids: number[]
        min_creation_fee_in_uusd: number
    }
}

owner

Query message
{
    owner: {} 
}
Return output
{
    data: {
        abolished: boolean
        emergency_owner?: string | null
        initialized: boolean
        owner?: string | null
        proposed?: string | null
    }
}

perp_params

Query message
{
    perp_params: {
        denom: string
    } 
}
Return output
{
    data: {
          closing_fee_rate: Decimal
          denom: string
          enabled: boolean
          liquidation_threshold: Decimal
          max_funding_velocity: Decimal
          max_loan_to_value: Decimal
          max_long_oi_value: Uint128
          max_net_oi_value: Uint128
          max_position_value?: Uint128 | null
          max_short_oi_value: Uint128
          min_position_value: Uint128
          opening_fee_rate: Decimal
          skew_scale: Uint128
    }
}

risk_manager

Query message
{
    risk_manager: {}  
}
Return output
{
    data: {
        abolished: boolean
        emergency_owner?: string | null
        initialized: boolean
        owner?: string | null
        proposed?: string | null
    }
}

total_deposit

Query message
{
    total_deposit: {
        denom: string
    } 
}
Return output
{
    data: {
        amount: Uint128
        cap: Uint128
        denom: string
    }
}

vault_config

Query message
{
    vault_config: {
        address: string
    }
}
Return output
{
    data: {
        addr: Addr
        deposit_cap: Coin
        hls?: {
            correlations: [
                {
                    coin: {
                        denom: string
                    }
                } | {
                    vault: {
                        addr: Addr
                    }
                },
                ...
            ]
            liquidation_threshold: Decimal
            max_loan_to_value: Decimal
        } | null
        liquidation_threshold: Decimal
        max_loan_to_value: Decimal
        whitelisted: boolean
    }
}

Methods

Only the owner of the contract can call its methods. That's why they are not part of the documentation.

neutron1x4rgd7ry23v2n49y7xdzje0743c5tgrnqrqsvwyya2h6m48tz4jqqex06x
osmo1nlmdxt9ctql2jr47qd4fpgzg84cjswxyw6q99u4y4u4q6c2f5ksq7ysent
here