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

Oracle

The Oracle Contract returns the price data for the entire Money Market and the Perps Platform. It utilizes multiple price sources, ranging from external oracles like Pyth or Slinky, to TWAP and Spot.

Last updated 25 days ago

Deployments

Neutron:

Osmosis:


Types

The types of the Oracle Contract can be found .

For reference on the Queries and Methods:

Base Types
type Decimal = string

Queries

config

Returns the Contracts configuration.

Query message
{
    config: {}    
}
Return output
{
    data: {
        base_denom: string
        owner: string | null
        proposed_new_owner: string | null
    }
}

price

Query message
{
    price: {
        denom: string
        kind?: 'default' | 'liquidation' | null
    }  
}
Return output
{
    data: {
        denom: string
        price: Decimal
    }
}

price_source

Query message
{
    price_source: {
        denom: string
    }
}
Return output
{
    data: {
        denom: string
        price_source: string
    }
}

price_sources

Query message
{
    price_sources: {
        limit?: number | null
        start_after?: string | null
    }
}
Return output
{
    data: [
        {
            denom: string
            price_source: string
        },
        ...
    ]   
}

prices

Query message
{
    prices: {
        kind?: 'default' | 'liquidation' | null
        limit?: number | null
        start_after?: string | null
    } 
}
Return output
{
    data: {
        
    }
}

prices_by_denoms

Query message
{
    prices_by_denoms: {
        denoms: string[]
        kind?: 'default' | 'liquidation' | null
    }
}
Return output
{
    data: [
        {
            denom: string
            price: Decimal    
        },
        ...
    ]
}

Methods

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

neutron1dwp6m7pdrz6rnhdyrx5ha0acsduydqcpzkylvfgspsz60pj2agxqaqrr7g
osmo1mhznfr60vjdp2gejhyv2gax9nvyyzhd3z0qcwseyetkfustjauzqycsy2g
here