mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 12:19:24 +00:00
* add genesis liquidity implementation * add missing deposit event * fix CI issues * minor fixes * make math safer * fix fmt * make remove liquidity an authorized call * implement setting initial values for coins * add genesis liquidity test & misc fixes * updato develop latest * fix rotation test * Finish merging develop * Remove accidentally committed ETH files * fix pr comments * further bug fixes * fix last pr comments * tidy up * Misc --------- Co-authored-by: Luke Parker <lukeparker5132@gmail.com>
30 lines
937 B
Rust
30 lines
937 B
Rust
use crate::BlockNumber;
|
|
|
|
// 1 MB
|
|
pub const BLOCK_SIZE: u32 = 1024 * 1024;
|
|
// 6 seconds
|
|
pub const TARGET_BLOCK_TIME: u64 = 6;
|
|
|
|
/// Measured in blocks.
|
|
pub const MINUTES: BlockNumber = 60 / TARGET_BLOCK_TIME;
|
|
pub const HOURS: BlockNumber = MINUTES * 60;
|
|
pub const DAYS: BlockNumber = HOURS * 24;
|
|
pub const WEEKS: BlockNumber = DAYS * 7;
|
|
pub const MONTHS: BlockNumber = WEEKS * 4;
|
|
|
|
/// 6 months of blocks
|
|
pub const GENESIS_SRI_TRICKLE_FEED: u64 = MONTHS * 6;
|
|
|
|
// 100 Million SRI
|
|
pub const GENESIS_SRI: u64 = 100_000_000 * 10_u64.pow(8);
|
|
|
|
/// This needs to be long enough for arbitrage to occur and make holding any fake price up
|
|
/// sufficiently unrealistic.
|
|
#[allow(clippy::cast_possible_truncation)]
|
|
pub const ARBITRAGE_TIME: u16 = (2 * HOURS) as u16;
|
|
|
|
/// Since we use the median price, double the window length.
|
|
///
|
|
/// We additionally +1 so there is a true median.
|
|
pub const MEDIAN_PRICE_WINDOW_LENGTH: u16 = (2 * ARBITRAGE_TIME) + 1;
|