Skip to main content

MarketDeployer.sol

MarketDeployer

struct MarketDeployer {
struct Parameters parameters;
}

Storage struct for deploying a ChromaticMarket contract

Parameters

struct Parameters {
address oracleProvider;
address settlementToken;
uint16 protocolFeeRate;
}

Struct for storing deployment parameters

DeployArgs

struct DeployArgs {
address oracleProvider;
address settlementToken;
address marketDiamondCutFacet;
address marketLoupeFacet;
address marketStateFacet;
address marketAddLiquidityFacet;
address marketRemoveLiquidityFacet;
address marketLensFacet;
address marketTradeOpenPositionFacet;
address marketTradeClosePositionFacet;
address marketLiquidateFacet;
address marketSettleFacet;
uint16 protocolFeeRate;
}
NameTypeDescription
oracleProvideraddressThe address of the oracle provider
settlementTokenaddressThe address of the settlement token
marketDiamondCutFacetaddressThe market diamond cut facet address.
marketLoupeFacetaddressThe market loupe facet address.
marketStateFacetaddressThe market state facet address.
marketAddLiquidityFacetaddressThe market liquidity facet address for adding and claiming.
marketRemoveLiquidityFacetaddressThe market liquidity facet address for removing and withdrawing.
marketLensFacetaddressThe market liquidity lens facet address.
marketTradeOpenPositionFacetaddressThe market trade facet address for opending positions.
marketTradeClosePositionFacetaddressThe market trade facet address for closing and claiming positions.
marketLiquidateFacetaddressThe market liquidate facet address.
marketSettleFacetaddressThe market settle facet address.
protocolFeeRateuint16The protocol fee rate for the market.

MarketDeployerLib

Library for deploying a ChromaticMarket contract

deploy

function deploy(struct MarketDeployer self, struct DeployArgs args) external returns (address market)

Deploys a ChromaticMarket contract

  • Parameters:

    NameTypeDescription
    selfstruct MarketDeployerThe MarketDeployer storage
    argsstruct DeployArgsThe arguments for deploy
  • Return Values:

    NameTypeDescription
    marketaddressThe address of the deployed ChromaticMarket contract