Skip to main content

MarketRegistry

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

setFeeDiscountRatio

  function setFeeDiscountRatio(
) external

getQuoteToken

  function getQuoteToken(
) external returns (address)

Get the quote token address

Return Values:

NameTypeDescription
quoteTokenaddressThe address of the quote token

getUniswapV3Factory

  function getUniswapV3Factory(
) external returns (address)

Get Uniswap factory address

Return Values:

NameTypeDescription
factoryaddressThe address of the Uniswap factory

getMaxOrdersPerMarket

  function getMaxOrdersPerMarket(
) external returns (uint8)

Get max allowed orders per market

Return Values:

NameTypeDescription
maxOrdersPerMarketuint8The max allowed orders per market

getPool

  function getPool(
address baseToken
) external returns (address)

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

Parameters:

NameTypeDescription
baseTokenaddressThe address of the base token

Return Values:

NameTypeDescription
pooladdressThe address of the pool

getFeeRatio

  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

Parameters:

NameTypeDescription
baseTokenaddressThe address of the base token

Return Values:

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

getInsuranceFundFeeRatio

  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

Parameters:

NameTypeDescription
baseTokenaddressThe address of the base token

Return Values:

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

getMarketMaxPriceSpreadRatio

  function getMarketMaxPriceSpreadRatio(
) external returns (uint24)

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

Return Values:

NameTypeDescription
marketMaxPriceSpreadRatiouint24Max price spread ratio of the market

getMarketInfo

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

Get the market info by given base token address

Parameters:

NameTypeDescription
baseTokenaddressThe address of the base token

Return Values:

NameTypeDescription
infostruct IMarketRegistry.MarketInfoThe market info encoded as MarketInfo

getMarketInfoByTrader

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

hasPool

  function hasPool(
) external returns (bool)

Check if a pool exist by given base token address

Return Values:

NameTypeDescription
hasPoolboolTrue if the pool exist, false otherwise