IMarketRegistry

MarketInfo

  struct MarketInfo(
    address pool
    uint24 exchangeFeeRatio
    uint24 uniswapFeeRatio
    uint24 insuranceFundFeeRatio
    uint24 maxPriceSpreadRatio
  )

Functions

getPool

  function getPool(
    address baseToken
  ) external returns (address pool)

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

Parameters:

Return Values:

getFeeRatio

  function getFeeRatio(
    address baseToken
  ) external returns (uint24 feeRatio)

Get the fee ratio of a given market

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

Parameters:

Return Values:

getInsuranceFundFeeRatio

  function getInsuranceFundFeeRatio(
    address baseToken
  ) external returns (uint24 feeRatio)

Get the insurance fund fee ratio of a given market

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

Parameters:

Return Values:

getMarketInfo

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

Get the market info by given base token address

Parameters:

Return Values:

getMarketInfoByTrader

  function getMarketInfoByTrader(
    address trader,
    address baseToken
  ) external returns (struct IMarketRegistry.MarketInfo info)

Get the market info by given trader address and base token address

Parameters:

Return Values:

getQuoteToken

  function getQuoteToken(
  ) external returns (address quoteToken)

Get the quote token address

Return Values:

getUniswapV3Factory

  function getUniswapV3Factory(
  ) external returns (address factory)

Get Uniswap factory address

Return Values:

getMaxOrdersPerMarket

  function getMaxOrdersPerMarket(
  ) external returns (uint8 maxOrdersPerMarket)

Get max allowed orders per market

Return Values:

hasPool

  function hasPool(
  ) external returns (bool hasPool)

Check if a pool exist by given base token address

Return Values:

getMarketMaxPriceSpreadRatio

  function getMarketMaxPriceSpreadRatio(
  ) external returns (uint24 marketMaxPriceSpreadRatio)

Return Values:

Events

PoolAdded

  event PoolAdded(
    address baseToken,
    uint24 feeRatio,
    address pool
  )

Emitted when a new market is created.

Parameters:

FeeRatioChanged

  event FeeRatioChanged(
    address baseToken,
    uint24 feeRatio
  )

Emitted when the fee ratio of a market is updated.

Parameters:

InsuranceFundFeeRatioChanged

  event InsuranceFundFeeRatioChanged(
    address baseToken,
    uint24 feeRatio
  )

Emitted when the insurance fund fee ratio is updated.

Parameters:

MaxOrdersPerMarketChanged

  event MaxOrdersPerMarketChanged(
    uint8 maxOrdersPerMarket
  )

Emitted when the max orders per market is updated.

Parameters:

MarketMaxPriceSpreadRatioChanged

  event MarketMaxPriceSpreadRatioChanged(
    address baseToken,
    uint24 spreadRatio
  )

Emitted when the max market price spread ratio is updated.

Parameters:

FeeDiscountRatioChanged

  event FeeDiscountRatioChanged(
    address trader,
    uint24 discountRatio
  )

Emitted when the trader's fee discount ratio gets updated.

Parameters:

Last updated