-
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.
Sunset old AMMs and their pools (#1197)
* Replace `bmul` and `bdiv` with traited versions * Restructure directories * Replace `saturating_*` from neo-swaps * Fix formatting * Restructure zrml-swaps math * Implement and test `b*` * Fix formatting * Use new math in orderbook-v1 * Replace checked multiplication with new math * Use correct rounding in neo-swaps * Add docs * Update licenses * Remove `fixed` module from `primitives` * Fix formatting * . * Rewrite math functions * Remove training wheels * Fix docs.pdf * Fix quotes * Add tests for buying * Add tests for selling and improve error names * Update docs * Check adjusted amount in for numerical bounds * Remove unused implementations * Adjust docs * Add stress test exploring various scenarios * Add swap fees to stress test * Add underscore separators * Clean up * Benchmark `buy` as function of `asset_count` * Update benchmarks * Clippy fix * Fix benchmark tests * Update benchmarks of zrml-prediction-markets * Fix broken comment * Add comment explaining benchmark spot prices * Use clearer constants for `amount_in` in tests * Update zrml/neo-swaps/src/traits/pool_operations.rs Co-authored-by: Chralt <[email protected]> * Fix botched merge * Fix merge * Update benchmarks * Remove `pool_*_subsidy` * Remove `distribute_pool_share_rewards` * Remove `end_subsidy_phase` * Remove `destroy_pool_in_subsidy_phase` * Remove `MinSubsidy*` * Remove `SubsidyProviders` * Remove `start_subsidy` * Rewrite `create_pool` * Rewrite `swap_exact_amount_in` * Rewrite `swap_exact_amount_out` * Rewrite utility functions * Remove Rikiddo from weight calculation * Remove Rikiddo from zrml-swaps * Remove unused errors * Remove `ScoringRule::Rikiddo...` * Remove `*SubsidyPeriod` * Remove Rikiddo-related storage and events * Remove automatic opening of pools * Remove `open_pool` from prediction-markets * Remove `Swaps::close_pool` from prediction-markets * Remove `clean_up_pool` from prediction-markets * Remove `clean_up_pool` from `Swaps` trait * Remove CPMM deployment from prediction-markets * Remove automatic arbitrage * Move `market_account` back to prediction-markets * Remove unused market states * Fix fuzz tests * Implement market migration * Minor changes * Fix migration behavior * Remove creator fees from swaps * Fix try-runtime * Fix clippy issues * Remove `LiquidityMining` from swaps * Fix `get_spot_prices` * Take first step to remove `MarketCommons` from swaps * Remove `MarketCommons` from swaps * Rewrite `PoolStatus` * Move `Pool*` to swaps * Use `Bounded*` types in `Pool` * Finish swaps migration * Add missing files * Fix formatting and clippy errors * Remove `pool_status.rs` * Ignore doctests * Fix fuzz tests * Add prediciton-markets migration * Test prediction-markets migration * Finish tests of the market-commons migration * Add migrations to runtime and fix various errors * Clean up * Clean up * Format code * Fix pool migration behavior * Remove `MarketId` from swaps * Fix formatting * Fix formatting * Remove `CPMM` and allow other scoring rules on Battery Station * Update macros/Cargo.toml Co-authored-by: Harald Heckmann <[email protected]> * Update primitives/src/traits/zeitgeist_asset.rs Co-authored-by: Harald Heckmann <[email protected]> * Update zrml/market-commons/src/migrations.rs Co-authored-by: Harald Heckmann <[email protected]> * Update zrml/swaps/src/migrations.rs Co-authored-by: Harald Heckmann <[email protected]> * Update zrml/swaps/src/migrations.rs Co-authored-by: Harald Heckmann <[email protected]> * Update zrml/prediction-markets/src/migrations.rs Co-authored-by: Harald Heckmann <[email protected]> * Update zrml/market-commons/src/migrations.rs Co-authored-by: Harald Heckmann <[email protected]> * Clean up TODOs/FIXMEs * Update changelog * Make more changes to changelog * Clear zrml-swaps storage * Remove cfg-if dependency * Fix formatting * Trigger CI * Update copyright notices * Update docs/changelog_for_devs.md Co-authored-by: Chralt <[email protected]> * Make benchmark helper only available if feature flags are set * Remove `ZeitgeistAsset` trait * Remove preliminary benchmarks with more steps * Format code * Fix copyright notice --------- Co-authored-by: Chralt <[email protected]> Co-authored-by: Harald Heckmann <[email protected]>
- Loading branch information
1 parent
3761f96
commit 9e1cc2c
Showing
83 changed files
with
2,396 additions
and
8,641 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[package] | ||
authors = ["Zeitgeist PM <[email protected]>"] | ||
edition = "2021" | ||
name = "zeitgeist-macros" | ||
version = "0.4.3" |
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Copyright 2023-2024 Forecasting Technologies LTD. | ||
// | ||
// This file is part of Zeitgeist. | ||
// | ||
// Zeitgeist is free software: you can redistribute it and/or modify it | ||
// under the terms of the GNU General Public License as published by the | ||
// Free Software Foundation, either version 3 of the License, or (at | ||
// your option) any later version. | ||
// | ||
// Zeitgeist is distributed in the hope that it will be useful, but | ||
// WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
// General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with Zeitgeist. If not, see <https://www.gnu.org/licenses/>. | ||
|
||
/// Creates an `alloc::collections::BTreeMap` from the pattern `{ key => value, ... }`. | ||
/// | ||
/// ```ignore | ||
/// // Example: | ||
/// let m = create_b_tree_map!({ 0 => 1, 2 => 3 }); | ||
/// assert_eq!(m[2], 3); | ||
/// | ||
/// // Overwriting a key:) | ||
/// let m = create_b_tree_map!({ 0 => "foo", 0 => "bar" }); | ||
/// assert_eq!(m[0], "bar"); | ||
/// ``` | ||
#[macro_export] | ||
macro_rules! create_b_tree_map { | ||
({ $($key:expr => $value:expr),* $(,)? } $(,)?) => { | ||
[$(($key, $value),)*].iter().cloned().collect::<alloc::collections::BTreeMap<_, _>>() | ||
} | ||
} |
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.