#[cfg(feature = "serde")]
use market_maker_rs::prelude::*;
#[cfg(feature = "serde")]
fn main() {
println!("=== Display (Compact JSON) vs Debug (Pretty JSON) ===\n");
let quote = Quote {
bid_price: dec!(100.0),
bid_size: dec!(10.0),
ask_price: dec!(101.0),
ask_size: dec!(10.0),
timestamp: 1234567890,
};
println!("Quote Display (compact):");
println!("{}", quote);
println!("\nQuote Debug (pretty):");
println!("{:?}\n", quote);
let config = StrategyConfig::new(dec!(0.5), dec!(1.5), 3600000, dec!(0.01)).unwrap();
println!("Strategy Config Display (compact):");
println!("{}", config);
println!("\nStrategy Config Debug (pretty):");
println!("{:?}\n", config);
let position = InventoryPosition {
quantity: dec!(100.0),
avg_entry_price: dec!(99.5),
last_update: 1234567890,
};
println!("Inventory Position Display (compact):");
println!("{}", position);
println!("\nInventory Position Debug (pretty):");
println!("{:?}\n", position);
let pnl = PnL {
realized: dec!(500.0),
unrealized: dec!(150.0),
total: dec!(650.0),
};
println!("PnL Display (compact):");
println!("{}", pnl);
println!("\nPnL Debug (pretty):");
println!("{:?}\n", pnl);
let market_state = MarketState::new(dec!(100.5), dec!(0.25), 1234567890);
println!("Market State Display (compact):");
println!("{}", market_state);
println!("\nMarket State Debug (pretty):");
println!("{:?}", market_state);
}
#[cfg(not(feature = "serde"))]
fn main() {
println!("This example requires the 'serde' feature to be enabled.");
println!("Run with: cargo run --example display_example --features serde");
}