1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
use injective_math::FPDecimal;
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub struct MetadataStatistics {
pub group_count: u32,
pub records_sample_size: u32,
pub mean: FPDecimal,
pub twap: FPDecimal,
pub first_timestamp: i64,
pub last_timestamp: i64,
pub min_price: FPDecimal,
pub max_price: FPDecimal,
pub median_price: FPDecimal,
}
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub struct TradeHistoryOptions {
pub trade_grouping_sec: u64,
pub max_age: u64,
pub include_raw_history: bool,
pub include_metadata: bool,
}
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub struct PriceRecord {
timestamp: i64,
price: FPDecimal,
}
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub struct TradeRecord {
timestamp: i64,
price: FPDecimal,
quantity: FPDecimal,
}