pub fn fetch_l2_snapshot(symbol: &str) -> Result<String> {
        let without_date = &symbol[..(symbol.len() - 8)];
        let settle = if without_date.ends_with("_USD_") {
            "btc"
        } else if without_date.ends_with("_USDT_") {
            "usdt"
        } else {
            panic!("Unknown symbol {}", symbol);
        };
        gen_api!(format!(
            "/delivery/{}/order_book?contract={}&limit=50",
            settle, symbol
        ))
    }
/// Get the latest Level2 snapshot of orderbook.
///
/// Top 50 asks and bids are returned.
///
/// For example:
///
/// - <https://api.gateio.ws/api/v4/delivery/usdt/order_book?contract=BTC_USDT_20210625&limit=50>
Get the latest Level2 snapshot of orderbook.
Top 50 asks and bids are returned.

For example.


Get the latest Level2 snapshot of orderbook . Top 50 asks and bids are returned . For example .
pub fn fetch_l2_snapshot(symbol: &str) -> Result<String> {
        let without_date = &symbol[..(symbol.len() - 8)];
        let settle = if without_date.ends_with("_USD_") {
            "btc"
        } else if without_date.ends_with("_USDT_") {
            "usdt"
        } else {
            panic!("Unknown symbol {}", symbol);
        };
        gen_api!(format!(
            "/delivery/{}/order_book?contract={}&limit=50",
            settle, symbol
        ))
    }
pub fn fetch_l2_snapshot ( symbol : & str ) -> Result < String > { let without_date = & symbol [ .. ( symbol . len ( ) - 8 ) ] ; let settle = if without_date . ends_with ( " " ) { " " } else if without_date . ends_with ( " " ) { " " } else { panic ! ( " " symbol ) ; } ; gen_api ! ( format ( " " settle symbol ) ) }
Get the latest Level2 snapshot of orderbook.
Get the latest Level2 snapshot of orderbook .
symbol
&str