/*
 * Ethereal Exchange API
 *
 * Ethereal HTTP API for real-time trading, order management, and market data access.
 *
 * The version of the OpenAPI document: 0.1.0
 *
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct TickerWsDataDto {
    /// Symbol for the market (e.g. BTCUSD, ETHUSD)
    #[serde(rename = "s")]
    pub s: String,
    /// BBO timestamp (ms since Unix Epoch)
    #[serde(rename = "t", skip_serializing_if = "Option::is_none")]
    pub t: Option<f64>,
    /// Best bid price in USD expressed as a decimal (precision: 9)
    #[serde(rename = "bidPx", skip_serializing_if = "Option::is_none")]
    pub bid_px: Option<String>,
    /// Best ask price in USD expressed as a decimal (precision: 9)
    #[serde(rename = "askPx", skip_serializing_if = "Option::is_none")]
    pub ask_px: Option<String>,
    /// Best bid quantity expressed as a decimal (precision: 9)
    #[serde(rename = "bidAmt", skip_serializing_if = "Option::is_none")]
    pub bid_amt: Option<String>,
    /// Best ask quantity expressed as a decimal (precision: 9)
    #[serde(rename = "askAmt", skip_serializing_if = "Option::is_none")]
    pub ask_amt: Option<String>,
    /// Oracle price in USD expressed as a decimal (precision: 9)
    #[serde(rename = "markPx", skip_serializing_if = "Option::is_none")]
    pub mark_px: Option<String>,
    /// Price of product 24hrs ago in USD expressed as a decimal (precision: 9)
    #[serde(rename = "markPx24h", skip_serializing_if = "Option::is_none")]
    pub mark_px24h: Option<String>,
    /// 24-hour trading volume in base token native units (precision: 9)
    #[serde(rename = "vol24h", skip_serializing_if = "Option::is_none")]
    pub vol24h: Option<String>,
    /// Open interest of both sides in native units (precision: 9)
    #[serde(rename = "oi", skip_serializing_if = "Option::is_none")]
    pub oi: Option<String>,
    /// Projected funding rate for end of current hour (precision: 9)
    #[serde(rename = "fr1h", skip_serializing_if = "Option::is_none")]
    pub fr1h: Option<String>,
}

impl TickerWsDataDto {
    pub fn new(s: String) -> TickerWsDataDto {
        TickerWsDataDto {
            s,
            t: None,
            bid_px: None,
            ask_px: None,
            bid_amt: None,
            ask_amt: None,
            mark_px: None,
            mark_px24h: None,
            vol24h: None,
            oi: None,
            fr1h: None,
        }
    }
}
