Skip to main content

px_core/models/
crypto.rs

1use serde::{Deserialize, Serialize};
2
3#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
4#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
5#[serde(rename_all = "lowercase")]
6pub enum CryptoPriceSource {
7    Binance,
8    Chainlink,
9}
10
11#[derive(Debug, Clone, Serialize, Deserialize)]
12#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
13pub struct CryptoPrice {
14    pub symbol: String,
15    pub timestamp: u64,
16    pub value: f64,
17    pub source: CryptoPriceSource,
18}