A lightweight OCaml library for interacting with the Binance API.
I do not guarantee the correctness of the code! ❌
-
🧑💻 Professor Michael R. Clarkson - https://cs3110.github.io/textbook/cover.html
-
🧑💻 Professor Marius Minea - http://staff.cs.upt.ro/~marius/curs/lsd/index.html
The purpose of the library is really only for trading and not to implement the entire API of the Binance platform. The library will grow over time and primarily implement APIs for trading on Future and Spot accounts.
To build the entire Binance API in Ocaml will take a lot of time and effort, and first of all I need the transaction placement APIs for some private projects in Ocaml.
After these, the rest of the APIs can be implemented.
The programs can be build with Dune build system and Ocaml compiler (native or bytecode compiler). 🐪
- Operating System: MacOS, Linux(Ubuntu for example), Windows Subsystem for Linux. (WSL) // I do not recommend installing on Windows, it is not natively supported.
- Package Manager: Opam for Ocaml programming language and other packages.
- Programming Language: Ocaml
- Code Editor: Visual Studio Code
Personally, I made use of WSL with Visual Studio Code, and most of time i used the ocaml interpreter to evaluate my programs for single file programs. Now if you want run, test and debug the library you must make use of Dune commands. (dune build, dune exec project, dune test)
- Install opam and ocaml
https://ocaml.org/docs/up-and-running
- Select the latest version of Ocaml
opam switch create 5.0.0
- Install OCAML packages
opam install merlin ocp-indent ocamlformat lwt domainslib ezjsonm cohttp cohttp-lwt cohttp-lwt-unix tls tls-lwt ssl lwt-ssl alcotest alcotest-lwt nocrypto http-lwt-client cohttp-lwt-unix
- Configure Visual Studio Code to run OCaml code.
Install OCaml extenions from VSCode marketplace.
I had to change the setting "ocaml.merlinPath": "ocamlmerlin" in the OCaml VSCode extension settings to "ocaml.merlinPath": "ocamlmerlin-server" to get the extension to work. (Maybe this is obsolete)
- Go inside the library
cd ../binance-ocaml-api
- Clean the library
dune clean
- Build the library
dune build
- Install the library in the local opam environment
dune install
opam install .
https://cs3110.github.io/textbook/cover.html
http://staff.cs.upt.ro/~marius/curs/lsd/index.html
http://labs.cs.upt.ro/~oose/pmwiki.php/LSD/LogicaSiStructuriDiscrete
https://dev.realworldocaml.org/
https://www.greenteapress.com/thinkocaml/index.html
https://ocaml.github.io/ocamlunix/index.html
http://pauillac.inria.fr/~ddr/
https://mukulrathi.com/ocaml-tooling-dune/
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Denis Gruia
- Twitter - @denisgruiax
- Email - denis.gruiax@icloud.com
- Project Link - https://github.com/denisgruiax