Skip to main content

pyth_lazer_protocol/
feed_kind.rs

1use {
2    serde::{Deserialize, Serialize},
3    std::fmt::Display,
4};
5
6#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
7#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
8#[serde(rename_all = "camelCase")]
9pub enum FeedKind {
10    Price,
11    FundingRate,
12}
13
14impl Display for FeedKind {
15    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
16        match self {
17            FeedKind::Price => write!(f, "price"),
18            FeedKind::FundingRate => write!(f, "fundingRate"),
19        }
20    }
21}