Function getClosePrice

  • Returns the close price of the last completed candle for the given interval.

    Parameters

    • symbol: string

      Trading pair symbol (e.g., "BTCUSDT")

    • interval: CandleInterval

      Candle interval ("1m" | "3m" | "5m" | "15m" | "30m" | "1h" | "2h" | "4h" | "6h" | "8h")

    Returns Promise<number>

    Promise resolving to close price of the last candle

    const close = await getClosePrice("BTCUSDT", "1h");
    console.log(close); // 50125.43