paoloboni / binance-scala-client

A functional Scala client for Binance

Version Matrix

Scala client for Binance API

All Contributors

Build Status Latest version License: MIT Join the chat at

A functional Scala client for Binance, powered by cats-effect 3.x.

This client is rate limited, based on Binance API specification.

Getting started

If you use sbt add the following dependency to your build file:

libraryDependencies += "io.github.paoloboni" %% "binance-scala-client" % "<version>"

APIs supported

Spot API


Future API



  • Aggregate trade streams: The Aggregate Trade Streams push trade information that is aggregated for a single taker order every 100 milliseconds.
  • Kline/Candlestick Streams: The Kline/Candlestick Stream push updates to the current klines/candlestick every 250 milliseconds (if existing).


This is a sample app to monitor the exchange prices (fetch every 5 seconds).

import cats.effect.{ExitCode, IO, IOApp}
import fs2.Stream
import io.github.paoloboni.binance.BinanceClient
import io.github.paoloboni.binance.common.SpotConfig
import log.effect.LogWriter
import log.effect.fs2.SyncLogWriter.consoleLog

import scala.concurrent.duration.DurationInt

object PriceMonitor extends IOApp {

  val config = SpotConfig.Default(
    apiKey = "***",
    apiSecret = "***"

  override def run(args: List[String]): IO[ExitCode] = {
    implicit val log: LogWriter[IO] = consoleLog[IO]

      .use { client =>
          .evalMap(_ => client.getPrices())
          .evalMap(prices =>"Current prices: " + prices))
        { t =>
          log.error("Something went wrong", t)
        _ => ExitCode.Success


Thanks goes to these wonderful people (emoji key):



This project follows the all-contributors specification. Contributions of any kind welcome!