-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Markets without invalid #1532
Comments
UI changes to remove "No Contest"Displaying market outcomes: Resolving a market:The market structure only allows for one winning outcome The Claiming winnings:
After these changes the claim winnings buttons should appear in user's portfolio and allow them to claim winnings. |
There's an interest in removing invalid as an outcome. When a market would resolve as invalid, it would instead pay out equally to all outcomes.
This involves some core changes because right now there is no inherent notion of invalid: it's just outcomes, one of which wins. There are also some mixins that need to be updated, as well as the Sports market factories.
The Grouped market factory needs to be updated as well but that's in purgatory (not sure if we'll release it) so it can be excluded from this ticket's scope. The Crypto market factory doesn't use invalid so it needn't be updated.
This requires changes in a few places:
AbstractMarketFactoryV3.sol
claimWinnings
method needs to be rewritten. Probably just tack on an invalid-wins check at the start then follow an alternate code path that iterates over all outcomes to pay them out equally.0xF..F
or0x0..1.
This impacts some methods:isMarketResolved
endMarket
Sport.sol
HasHeadToHeadMarket
HasSpreadMarket
HasOverUnderMarket
ResolvesByFiat
(contract name and file name differ by a plural)ResolvesByScore
(same)TokenNamesFromTeams
NFLMarketFactoryV3
NBAMarketFactoryV3
MMAMarketFactoryV3
MLBMarketFactoryV3
There are other market factories like NCAAFB but they aren't being used so I've excluded them.
There are two broad approaches to take to changing the base code:
Copy-paste is easier but creates more technical debt.
In either case, the UI will have issues if the contract names aren't changed. The naming scheme is a little hacky but a couple of rules should be sufficient:
MMAMarketFactoryV3
:MMA
is the kind of markets it creates.MarketFactory
indicates that this contract is a market factory.V3
is the API version. This comes from the base classAbstractMarketFactoryV3
. The API version is relevant to the UI and many scripts.MMAMarketFactoryEqV3
, whereEq
indicates that invalid markets will pay out Equally to all outcomes.Subtasks:
The text was updated successfully, but these errors were encountered: