Skip to main content

PrePOMarketFactory

Overview​

Deploys a PrePOMarket and two LongShortToken contracts to serve as the token pair.

Functions​

createMarket​

  function createMarket(
string tokenNameSuffix,
string tokenSymbolSuffix,
address collateral,
address governance,
uint256 floorLongPrice,
uint256 ceilingLongPrice,
uint256 floorValuation,
uint256 ceilingValuation,
uint256 mintingFee,
uint256 redemptionFee,
uint256 expiryTime
) external

Deploys a PrePOMarket with the given parameters and two LongShortToken contracts to serve as the token pair.

Parameters are all passed along to their respective arguments in the PrePOMarket constructor.

Token names are generated from tokenNameSuffix as the name suffix and tokenSymbolSuffix as the symbol suffix.

"LONG "/"SHORT " are appended to respective names, "L"/"S" are appended to respective symbols.

e.g. preSTRIPE 100-200 30-September 2021 => LONG preSTRIPE 100-200 30-September-2021.

e.g. preSTRIPE_100-200_30SEP21 => L_preSTRIPE_100-200_30SEP21.

Parameters:​

NameTypeDescription
tokenNameSuffixstringThe name suffix for the token pair
tokenSymbolSuffixstringThe symbol suffix for the token pair
collateraladdressThe address of the collateral token
governanceaddressThe address of the governance contract
floorLongPriceuint256The floor price for the Long token
ceilingLongPriceuint256The ceiling price for the Long token
floorValuationuint256The floor valuation for the Market
ceilingValuationuint256The ceiling valuation for the Market
mintingFeeuint256The minting fee for Long/Short tokens
redemptionFeeuint256The redemption fee for Long/Short tokens
expiryTimeuint256The expiry time for the Market

setCollateralValidity​

  function setCollateralValidity(
address collateral,
bool validity
) external

Sets whether a collateral contract is valid for assignment to new PrePOMarkets.

Parameters:​

NameTypeDescription
collateraladdressThe address of the collateral contract
validityboolWhether the collateral contract should be valid

isCollateralValid​

  function isCollateralValid(
address collateral
) external returns (bool)

Returns whether collateral contract is valid for assignment to new PrePOMarkets.

Parameters:​

NameTypeDescription
collateraladdressThe address of the collateral contract

getMarket​

  function getMarket(
bytes32 longShortHash
) external returns (contract IPrePOMarket)

longShortHash is a keccak256 hash of the long token address and short token address of the PrePOMarket.

Parameters:​

NameTypeDescription
longShortHashbytes32PrePOMarket unique identifier

Events​

CollateralValidityChanged​

  event CollateralValidityChanged(
address collateral,
bool allowed
)

Emitted via setCollateralValidity().

Parameters:​

NameTypeDescription
collateraladdressthe collateral changed
allowedboolwhether the collateral is valid

MarketAdded​

  event MarketAdded(
address market,
bytes32 longShortHash
)

Emitted via createMarket().

Parameters:​

NameTypeDescription
marketaddressThe market created
longShortHashbytes32The market unique id