Perp v2
Perp v2
  • About Perpetual Protocol
    • Social Links
    • Governance
    • v2 Era Ecosystem
    • PERP Token
  • Terms of Service
  • General
    • Wallets
    • Transfering Assets
    • Deposit & Withdrawal
    • Perpetual + Uniswap
    • FAQs
    • Guides
    • Legacy Reward Programs
    • Security
  • Hot Tub
  • Trading on Perp v2
    • How It Works
    • UI Overview
    • Perpetual Futures Basics
    • Trading Quick-start
    • Opening and Closing Positions
    • Account Value & More
    • Funding Payments
    • Order Types
    • Trading Fees and Gas Fees
    • Managing Risk
    • Multi-collateral
    • More docs
  • Providing Liquidity
    • Basics
    • Introduction to Maker UI
    • Add / Remove Liquidity
    • Estimated Fees and Rewards APR
    • More on LPing
    • Tools for LPs
  • Perp v2 Specs
  • Developer Docs
    • Developer FAQs
    • Source Code
    • Protocol Attributes
    • Contract guide
      • AccountBalance
      • BaseToken
      • ClearingHouse
      • CollateralManager
      • DelegateApproval
      • Exchange
      • InsuranceFund
      • MarketRegistry
      • OrderBook
      • QuoteToken
      • Vault
      • VirtualToken
    • Interface Contracts
      • IAccountBalance
      • IBaseToken
      • IClearingHouse
      • IClearingHouseConfig
      • IClearingHouseConfigEvent
      • ICollateralManager
      • IDelegateApproval
      • IERC20Metadata
      • IExchange
      • IIndexPrice
      • IInsuranceFund
      • IMarketRegistry
      • IOrderBook
      • IVault
      • IVirtualToken
    • Integration guide
    • Dev tools
Powered by GitBook
On this page

Was this helpful?

  1. Developer Docs
  2. Contract guide

MarketRegistry

Last updated 1 year ago

Was this helpful?

Functions

initialize

  function initialize(
  ) external

addPool

  function addPool(
  ) external returns (address)

setFeeRatio

  function setFeeRatio(
  ) external

setInsuranceFundFeeRatio

  function setInsuranceFundFeeRatio(
  ) external

setMaxOrdersPerMarket

  function setMaxOrdersPerMarket(
  ) external

setMarketMaxPriceSpreadRatio

  function setMarketMaxPriceSpreadRatio(
  ) external
  function setFeeDiscountRatio(
  ) external
  function getQuoteToken(
  ) external returns (address)

Get the quote token address

Name
Type
Description

quoteToken

address

The address of the quote token

  function getUniswapV3Factory(
  ) external returns (address)

Get Uniswap factory address

Name
Type
Description

factory

address

The address of the Uniswap factory

  function getMaxOrdersPerMarket(
  ) external returns (uint8)

Get max allowed orders per market

Name
Type
Description

maxOrdersPerMarket

uint8

The max allowed orders per market

  function getPool(
    address baseToken
  ) external returns (address)

Get the pool address (UNIv3 pool) by given base token address

Name
Type
Description

baseToken

address

The address of the base token

Name
Type
Description

pool

address

The address of the pool

  function getFeeRatio(
    address baseToken
  ) external returns (uint24)

Get the fee ratio of a given market

The ratio is in 1e6 format, that means 1% = 1e4

Name
Type
Description

baseToken

address

The address of the base token

Name
Type
Description

feeRatio

uint24

The fee ratio of the market, it is a decimal in 1e6

  function getInsuranceFundFeeRatio(
    address baseToken
  ) external returns (uint24)

Get the insurance fund fee ratio of a given market

The ratio is in 1e6 format, that means 1% = 1e4

Name
Type
Description

baseToken

address

The address of the base token

Name
Type
Description

feeRatio

uint24

The fee ratio of the market, it is a decimal in 1e6

  function getMarketMaxPriceSpreadRatio(
  ) external returns (uint24)

if we didn't set the max spread ratio for the market, we will use the default value

Name
Type
Description

marketMaxPriceSpreadRatio

uint24

Max price spread ratio of the market

  function getMarketInfo(
    address baseToken
  ) external returns (struct IMarketRegistry.MarketInfo)

Get the market info by given base token address

Name
Type
Description

baseToken

address

The address of the base token

Name
Type
Description

info

struct IMarketRegistry.MarketInfo

The market info encoded as MarketInfo

  function getMarketInfoByTrader(
  ) external returns (struct IMarketRegistry.MarketInfo)
  function hasPool(
  ) external returns (bool)

Check if a pool exist by given base token address

Name
Type
Description

hasPool

bool

True if the pool exist, false otherwise

setFeeDiscountRatio

getQuoteToken

Return Values:

getUniswapV3Factory

Return Values:

getMaxOrdersPerMarket

Return Values:

getPool

Parameters:

Return Values:

getFeeRatio

Parameters:

Return Values:

getInsuranceFundFeeRatio

Parameters:

Return Values:

getMarketMaxPriceSpreadRatio

Return Values:

getMarketInfo

Parameters:

Return Values:

getMarketInfoByTrader

hasPool

Return Values:

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​