-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* oracle api clarification Signed-off-by: Dzmitry Lahoda <dzmitry@lahoda.pro> * fixing pr comments Signed-off-by: Dzmitry Lahoda <dzmitry@lahoda.pro> * fixed comment Signed-off-by: Dzmitry Lahoda <dzmitry@lahoda.pro> * crazy fmt issue Signed-off-by: Dzmitry Lahoda <dzmitry@lahoda.pro> * just something to tirgget build after fail Signed-off-by: Dzmitry Lahoda <dzmitry@lahoda.pro> * fixed lending Signed-off-by: Dzmitry Lahoda <dzmitry@lahoda.pro> * fixed price, added ratio test Signed-off-by: Dzmitry Lahoda <dzmitry@lahoda.pro> * fixed comments of review Signed-off-by: Dzmitry Lahoda <dzmitry@lahoda.pro> * fixed comments Signed-off-by: Dzmitry Lahoda <dzmitry@lahoda.pro>
- Loading branch information
1 parent
a26f8d0
commit a8c5bfb
Showing
34 changed files
with
961 additions
and
740 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -22,4 +22,4 @@ tombstoned | |
u128 | ||
Wasm | ||
Xcm | ||
XCM | ||
Dispatchable |
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 |
---|---|---|
@@ -1,33 +1,2 @@ | ||
use crate::loans::DurationSeconds; | ||
use frame_support::pallet_prelude::*; | ||
use scale_info::TypeInfo; | ||
use sp_runtime::Permill; | ||
|
||
#[derive(Decode, Encode, Clone, TypeInfo, Debug, PartialEq)] | ||
pub enum AuctionStepFunction { | ||
/// default - direct pass through to dex without steps, just to satisfy defaults and reasonably | ||
/// for testing | ||
LinearDecrease(LinearDecrease), | ||
StairstepExponentialDecrease(StairstepExponentialDecrease), | ||
} | ||
|
||
impl Default for AuctionStepFunction { | ||
fn default() -> Self { | ||
Self::LinearDecrease(Default::default()) | ||
} | ||
} | ||
|
||
#[derive(Default, Decode, Encode, Clone, TypeInfo, Debug, PartialEq)] | ||
pub struct LinearDecrease { | ||
/// Seconds after auction start when the price reaches zero | ||
pub total: DurationSeconds, | ||
} | ||
|
||
#[derive(Default, Decode, Encode, Clone, TypeInfo, Debug, PartialEq)] | ||
pub struct StairstepExponentialDecrease { | ||
// Length of time between price drops | ||
pub step: DurationSeconds, | ||
// Per-step multiplicative factor, usually more than 50%, mostly closer to 100%, but not 100%. | ||
// Drop per unit of `step`. | ||
pub cut: Permill, | ||
} | ||
// TODO: how type alias to such generics can be achieved? | ||
// pub type DutchAuction = SellEngine<AuctionStepFunction>; |
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.