An open source Rust high performance cryptocurrency trading API with support for multiple exchanges and language wrappers. written in rust(🦀) with ❤️

Overview

Les.rs - Rust Cryptocurrency Exchange Library

An open source Rust high performance cryptocurrency trading API with support for multiple exchanges and language wrappers. written in rust( 🦀 ) with ❤️ . This library provides a simple interface for interacting with cryptocurrency exchanges from Rust. It supports a wide range of exchanges and makes it easy to access their APIs and perform common tasks such as getting account balances and placing orders.

Installation

To install the library, add the following to your Cargo.toml file:

Copy code

[dependencies]
les = "0.1

You can then use the library in your Rust code by adding the following to your main.rs or lib.rs file:

Copy code

extern crate les;

Supported Exchanges

The following exchanges are currently supported by the library:

Exchange Available
Binance
Coinbase ⬜️
Bitfinex ⬜️
Kraken ⬜️

More exchanges will be added in future updates.

Usage

To use the library, you will need to create an instance of the Exchange struct, passing in the name of the exchange you want to use as a string. You will also need to provide your API key and secret key, which you can obtain from the exchange.

Copy code

let client = Binance::new(BinanceParameters {
        credentials: Some(BinanceCredentials {
            api_key: env::var("BINANCE_API_KEY").expect("Couldn't get environment variable"),
            api_secret: env::var("BINANCE_API_SECRET").expect("Couldn't get environment variable"),
        }),
        ..Default::default()
    })
    .await
    .expect("Failed to create Client")

You can then use the exchange object to call various methods to access the exchange's API. For example, to get the current balance of your account:

Copy code

let params = TradeHistoryReq {
                    paginator: None,
                    symbol: String::from("BNBBTC"),
                };
let binance_cli = client.inner_client().expect("Couldn't get inner time.");

let args = KlineParams{
            symbol: "BNBBTC".to_string(),
            interval: "1m".to_string(),
            paginator: None,
        };
let response = binance_cli.get_klines(&args).await.expect("Couldn't trade history.");

See the documentation for a full list of available methods and their usage.

Documentation

Full documentation for the library can be found here.

Contributing

We welcome contributions to the library! If you would like to contribute, please follow these steps:

  1. Fork the repository.
  2. Create a new branch for your changes.
  3. Make your changes and commit them to your branch.
  4. Push your branch to your fork on GitHub.
  5. Submit a pull request to the main branch of the crabby-ai/les repository.

Please make sure to follow the coding style and conventions used in the rest of the codebase, and make sure to test your changes thoroughly before submitting the pull request.

License

This library is released under the MIT License. See the LICENSE file for details.

Acknowledgements

I would like to thank the following individuals and organizations for their contributions to this project:

  • The Rust community for their support and guidance.
  • The developers of the various cryptocurrency exchanges provide APIs that allow us to access their platforms.
You might also like...
An open source desktop wallet for nano and banano with end-to-end encrypted, on chain messaging using the dagchat protocol.
An open source desktop wallet for nano and banano with end-to-end encrypted, on chain messaging using the dagchat protocol.

An open source wallet with end-to-end encrypted, on chain messaging for nano and banano using the dagchat protocol.

Automated security testing for open source libraries and applications.

autovet continuously searches for security breaches in open source libraries and applications. Recently processed packages package version channel las

Open-source tool to enforce privacy & security best-practices on Windows and macOS, because privacy is sexy 🍑🍆

privacy-sexy Open-source tool to enforce privacy & security best-practices on Windows and MacOs, because privacy is sexy 🍑 🍆 privacy-sexy is a data-

Torii ⛩️ is a simple, powerful and extensible open-source Internal Developer Portal

Torii ⛩️ Torii is a simple, powerful and extensible open-source Internal Developer Portal where developers can find all the tools and services they ne

A high performance blockchain kernel for enterprise users.
A high performance blockchain kernel for enterprise users.

English | 简体中文 What is CITA CITA is a fast and scalable blockchain kernel for enterprises. CITA supports both native contract and EVM contract, by whi

High Performance Blockchain Deserializer

bitcoin-explorer bitcoin_explorer is an efficient library for reading bitcoin-core binary blockchain file as a database (utilising multi-threading). D

A high performance blockchain kernel for enterprise users.
A high performance blockchain kernel for enterprise users.

English | 简体中文 What is CITA CITA is a fast and scalable blockchain kernel for enterprises. CITA supports both native contract and EVM contract, by whi

Glommio Messaging Framework (GMF) is a high-performance RPC system designed to work with the Glommio framework.

Glommio Messaging Framework (GMF) The GMF library is a powerful and innovative framework developed for facilitating Remote Procedure Calls (RPCs) in R

A high performance Remote Procedure Call system.

A high performance Remote Procedure Call (RPC) system. Usage Add this to your Cargo.toml file. [dependencies] frpc = { git = "https://github.com/nurmo

Owner
Crabby AI
Crabby AI
An open source, high performance limit order book for the Seaport smart contracts. Implemented in Rust using ethers-rs, this offers a turnkey option for digital asset marketplaces.

Quay Quay is an open source, high performance backend for the Seaport smart contracts. The project is implemented in Rust, using Postgres as a storage

Valorem Labs Inc. 169 Jun 23, 2023
⋰·⋰ Feeless is a Nano cryptocurrency node, wallet, tools, and Rust crate.

⋰·⋰ Feeless What is Feeless? Feeless is a Nano cryptocurrency node, wallet, tools, and Rust crate. This is not the official project for Nano, only an

null 127 Dec 5, 2022
A Rust library for generating cryptocurrency wallets

Table of Contents 1. Overview 2. Build Guide 2.1 Install Rust 2.2a Build from Homebrew 2.2b Build from Crates.io 2.2c Build from Source Code 3. Usage

Aleo 552 Dec 29, 2022
Open Protocol Indexer, OPI, is the best-in-slot open-source indexing client for meta-protocols on Bitcoin.

OPI - Open Protocol Indexer Open Protocol Indexer, OPI, is the best-in-slot open-source indexing client for meta-protocols on Bitcoin. OPI uses a fork

Best in Slot 33 Dec 16, 2023
An extremely high performance matching engine written in Rust.

Galois Introduction Galois is an extremely high performance matching engine written in Rust, typically used for the crypto currency exchange service.

UINB Tech 66 Jan 7, 2023
An easy-to-use, high-performance Interledger implementation written in Rust

Interledger implementation in Rust ?? Requirements All crates require Rust 2018 edition and are tested on the following channels: stable Connecting to

Interledger.rs 184 Dec 13, 2022
ZKP fork for rust-secp256k1, adds wrappers for range proofs, pedersen commitments, etc

rust-secp256k1 rust-secp256k1 is a wrapper around libsecp256k1, a C library by Peter Wuille for producing ECDSA signatures using the SECG curve secp25

null 53 Dec 19, 2022
A fast, simple and powerful open-source cross platform utility tool for generating strong, unique and random passwords

password-generator-pro A fast, simple and powerful open-source cross platform utility tool for generating strong, unique and random passwords. Feature

Sebastien Rousseau 3 Dec 16, 2022
Open source Rust implementation of the Witnet decentralized oracle protocol, including full node and wallet backend 👁️🦀

witnet-rust is an open source implementation of the Witnet Decentralized Oracle Network protocol written in Rust. Components witnet-rust implements ma

The Witnet Project 155 Nov 21, 2022
HyperCube is a free and open source blockchain project for everyone to use.

XPZ Public Chain HyperCube is a free and open source blockchain project for everyone to use. 日本語 简体中文 正體中文 HyperCube Wiki Wha is HyperCube HyperCube i

null 949 Dec 31, 2022