-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement Parimutuel markets (#1138)
* wip * remove market commons currency * update mocks, fix clippy * use unambiguous balance type * Update zrml/prediction-markets/src/lib.rs * Update zrml/prediction-markets/src/lib.rs * Update zrml/prediction-markets/src/lib.rs * fix benchmarks * fix copyrights * wip * restructure outcome asset type * wip * wip * Implement categorical and scalar claims * outsource into functions * add refund_pot extrinsic * prepare tests * fmt * fix after merge * fix mock of neo-swaps * apply review suggestions * delete parimutuel * add tests * impl bench, add comments * integrate Parimutuel into runtime * add parimutuel weights * remove scalar for parimutuels * revert outcome type changes in favour of dev speed * revert outcome type in parimutuels * add resolution mechanism * modify copyrights * taplo fmt * remove not existent Outcome type * avoid storage migration * decrease parimutuel existential deposits * impl resolution_mechanism * remove MaxCategories from parimutuel * Update zrml/parimutuel/Cargo.toml Co-authored-by: Malte Kliemann <[email protected]> * rename benchmark module * remove MaxCategories from parimutuel config * remove unused block run methods * move market mock to utils file * use default market type categorical * remove unnecessary debug assert * implement is_redeemable * update config comments * add inconsistent state error * update comment * update collateral to be base asset * remove unused scalar market storage item * use do function style * order config trait * change copyright * update copyrights * impl market assets contains fn * improve comments * reduce indentation * correct error * fmt * delete review jerk comment * use bmul_floor and bdiv_floor * add not categorical error * remove trailing commas * use test_case for parimutuel * rename refund_pot to claim_refunds * Update zrml/parimutuel/README.md Co-authored-by: Malte Kliemann <[email protected]> * use test cases for market status * add test cases for invalid scoring rule * improve test readibility * improve test cases * add docs * add invalid scoring rule tests * add redeem shares test * extend to non-trivial winner rewarding * add copyright * revert unsupported currency * Update zrml/prediction-markets/src/tests.rs Co-authored-by: Harald Heckmann <[email protected]> * remove import * use log * fmt * Update zrml/prediction-markets/src/tests.rs Co-authored-by: Harald Heckmann <[email protected]> * improve event readability * rename impl_distribute to do_distribute * Update zrml/parimutuel/src/lib.rs Co-authored-by: Harald Heckmann <[email protected]> * use logs * use log for optimized builds * separate tests * outsource shared code * outsource get_winning_asset * add log * use withdraw instead of slash * use withdraw instead of slash * Update runtime/battery-station/src/parameters.rs Co-authored-by: Harald Heckmann <[email protected]> * Update runtime/zeitgeist/src/parameters.rs Co-authored-by: Harald Heckmann <[email protected]> * use creator parameter in mock --------- Co-authored-by: Malte Kliemann <[email protected]> Co-authored-by: Harald Heckmann <[email protected]>
- Loading branch information
1 parent
4e25695
commit 52a3063
Showing
42 changed files
with
2,218 additions
and
107 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -86,4 +86,5 @@ pub enum ScoringRule { | |
RikiddoSigmoidFeeMarketEma, | ||
Lmsr, | ||
Orderbook, | ||
Parimutuel, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.