_pairName, we can choose a name for the pair of long and short tokens.
_customAncillaryDatais where we define the price request question. The addresses of the
_timerAddressset the rest of the contracts addresses we interact with. For reference, here is the full list of UMA contract deployments.
initializeMarket()after approving the
proposerRewardamount to be paid to the wallet that resolves the price request. To keep things simple,
proposerRewardis set to
priceIdentifieris set to
"YES_OR_NO_QUERY". This function sets up the prediction market by getting the proposer reward and calling
_requestOraclePrice. This last function starts the price request in Optimistic Oracle V2 and sets up a number of options that are explained below.
priceDisputedcallbacks so that our contract can use OO callbacks to respond to these kinds of events
createfunction with the
tokensToCreateparameter to mint the same number of short and long tokens. Having both tokens in the same proportion means being in a neutral position, as is the case when calling
settleif the oracle has processed the price request. The returned collateral amount is a function of
1. This number is used in the
settlefunction to calculate the collateral to pay in exchange of the long and short tokens.
priceDisputedfunction is called when a price request is disputed. This function re-starts the same price request with the bond amount that was given back to the requester, which in our case is the
EventBasedPredictionMarketin Görli network, run: