/*
* Bluefin API
*
* Bluefin API
*
* The version of the OpenAPI document: 1.0.0
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct TickerResponse {
/// Market symbol.
#[serde(rename = "symbol")]
pub symbol: String,
/// Last trade quantity (e9 format).
#[serde(rename = "lastQuantityE9")]
pub last_quantity_e9: String,
/// Last trade time in milliseconds.
#[serde(rename = "lastTimeAtMillis")]
pub last_time_at_millis: i64,
/// Last trade price (e9 format).
#[serde(rename = "lastPriceE9")]
pub last_price_e9: String,
/// Funding rate value (e9 format).
#[serde(rename = "lastFundingRateE9")]
pub last_funding_rate_e9: String,
/// Time in milliseconds of next funding rate update.
#[serde(rename = "nextFundingTimeAtMillis")]
pub next_funding_time_at_millis: i64,
/// 8 hr average funding rate (e9 format).
#[serde(rename = "avgFundingRate8hrE9")]
pub avg_funding_rate8hr_e9: String,
/// Oracle price of the asset (e9 format).
#[serde(rename = "oraclePriceE9")]
pub oracle_price_e9: String,
/// Direction of oracle price computed by comparing current oracle price to last oracle price. 0 = no change, -1 = negative trend (current < last), 1 positive trend (current > last).
#[serde(rename = "oraclePriceDirection")]
pub oracle_price_direction: i64,
/// Mark price on the exchange (e9 format).
#[serde(rename = "markPriceE9")]
pub mark_price_e9: String,
/// Direction of mark price computed by comparing current mark price to last mark price. 0 = no change, -1 = negative trend (current < last), 1 positive trend (current > last).
#[serde(rename = "markPriceDirection")]
pub mark_price_direction: i64,
/// Simple average of bestBid and bestAsk. lastPrice if either is not present (e9 format).
#[serde(rename = "marketPriceE9")]
pub market_price_e9: String,
/// Direction of market price computed by comparing current market price to last market price. 0 = no change, -1 = negative trend (current < last), 1 positive trend (current > last).
#[serde(rename = "marketPriceDirection")]
pub market_price_direction: i32,
/// Best bid price (e9 format).
#[serde(rename = "bestBidPriceE9")]
pub best_bid_price_e9: String,
/// Best bid quantity (e9 format).
#[serde(rename = "bestBidQuantityE9")]
pub best_bid_quantity_e9: String,
/// Best ask price (e9 format).
#[serde(rename = "bestAskPriceE9")]
pub best_ask_price_e9: String,
/// Best ask quantity (e9 format).
#[serde(rename = "bestAskQuantityE9")]
pub best_ask_quantity_e9: String,
/// Open interest value (e9 format).
#[serde(rename = "openInterestE9")]
pub open_interest_e9: String,
/// Highest Price in the last 24hrs (e9 format).
#[serde(rename = "highPrice24hrE9")]
pub high_price24hr_e9: String,
/// Lowest Price in the last 24hrs (e9 format).
#[serde(rename = "lowPrice24hrE9")]
pub low_price24hr_e9: String,
/// Total market volume in last 24hrs of asset (e9 format).
#[serde(rename = "volume24hrE9")]
pub volume24hr_e9: String,
/// Total market volume in last 24hrs in USDC (e9 format).
#[serde(rename = "quoteVolume24hrE9")]
pub quote_volume24hr_e9: String,
/// Close price 24hrs ago (e9 format).
#[serde(rename = "closePrice24hrE9")]
pub close_price24hr_e9: String,
/// Open price in the last 24hrs (e9 format).
#[serde(rename = "openPrice24hrE9")]
pub open_price24hr_e9: String,
/// 24 hour close time in milliseconds.
#[serde(rename = "closeTime24hrAtMillis")]
pub close_time24hr_at_millis: i64,
/// 24 hour open time in milliseconds.
#[serde(rename = "openTime24hrAtMillis")]
pub open_time24hr_at_millis: i64,
/// First trade id in 24hr.
#[serde(rename = "firstId24hr")]
pub first_id24hr: i64,
/// Last trade id in 24hr.
#[serde(rename = "lastId24hr")]
pub last_id24hr: i64,
/// Total number of trades in 24hr.
#[serde(rename = "count24hr")]
pub count24hr: String,
/// 24hr Market price change (e9 format).
#[serde(rename = "priceChange24hrE9")]
pub price_change24hr_e9: String,
/// 24hr Market price change in percentage (e9 format).
#[serde(rename = "priceChangePercent24hrE9")]
pub price_change_percent24hr_e9: String,
/// Last update time in milliseconds.
#[serde(rename = "updatedAtMillis")]
pub updated_at_millis: i64,
/// Live estimated funding rate based on current hour's average market and oracle prices (e9 format).
#[serde(rename = "estimatedFundingRateE9")]
pub estimated_funding_rate_e9: String,
}
impl TickerResponse {
pub fn new(symbol: String, last_quantity_e9: String, last_time_at_millis: i64, last_price_e9: String, last_funding_rate_e9: String, next_funding_time_at_millis: i64, avg_funding_rate8hr_e9: String, oracle_price_e9: String, oracle_price_direction: i64, mark_price_e9: String, mark_price_direction: i64, market_price_e9: String, market_price_direction: i32, best_bid_price_e9: String, best_bid_quantity_e9: String, best_ask_price_e9: String, best_ask_quantity_e9: String, open_interest_e9: String, high_price24hr_e9: String, low_price24hr_e9: String, volume24hr_e9: String, quote_volume24hr_e9: String, close_price24hr_e9: String, open_price24hr_e9: String, close_time24hr_at_millis: i64, open_time24hr_at_millis: i64, first_id24hr: i64, last_id24hr: i64, count24hr: String, price_change24hr_e9: String, price_change_percent24hr_e9: String, updated_at_millis: i64, estimated_funding_rate_e9: String) -> TickerResponse {
TickerResponse {
symbol,
last_quantity_e9,
last_time_at_millis,
last_price_e9,
last_funding_rate_e9,
next_funding_time_at_millis,
avg_funding_rate8hr_e9,
oracle_price_e9,
oracle_price_direction,
mark_price_e9,
mark_price_direction,
market_price_e9,
market_price_direction,
best_bid_price_e9,
best_bid_quantity_e9,
best_ask_price_e9,
best_ask_quantity_e9,
open_interest_e9,
high_price24hr_e9,
low_price24hr_e9,
volume24hr_e9,
quote_volume24hr_e9,
close_price24hr_e9,
open_price24hr_e9,
close_time24hr_at_millis,
open_time24hr_at_millis,
first_id24hr,
last_id24hr,
count24hr,
price_change24hr_e9,
price_change_percent24hr_e9,
updated_at_millis,
estimated_funding_rate_e9,
}
}
}