use serde::{Deserialize, Serialize};

use crate::market::{SpotMarketTradingFee, SpotMarketTradingSettings};
use crate::{AssetAmount, AssetId, MarketId};

/// Register market
#[derive(Clone, Debug, Eq, PartialEq, Deserialize, Serialize)]
pub struct RegisterSpotMarket {
    /// Base asset id
    pub base_asset_id: AssetId,

    /// Base asset quantity
    pub base_asset_quantity: AssetAmount,

    /// Quote asset id
    pub quote_asset_id: AssetId,

    /// Quote asset quantity
    pub quote_asset_quantity: AssetAmount,

    /// Market trading settings
    pub trading_settings: SpotMarketTradingSettings,
}

/// Update spot market trading settings
#[derive(Clone, Debug, Eq, PartialEq, Deserialize, Serialize)]
pub struct UpdateSpotMarketTradingSettings {
    /// Market id
    pub market_id: MarketId,

    /// Market trading settings
    pub trading_settings: SpotMarketTradingSettings,
}

/// Update spot market initial fee
#[derive(Clone, Debug, Eq, PartialEq, Deserialize, Serialize)]
pub struct UpdateSpotMarketInitialFee {
    /// Fee
    pub fee: SpotMarketTradingFee,
}

/// Update market fee
#[derive(Clone, Debug, Eq, PartialEq, Deserialize, Serialize)]
pub struct UpdateSpotMarketFee {
    /// Market id
    pub market_id: MarketId,

    /// Fee
    pub fee: SpotMarketTradingFee,
}
