cr0sh / grasshopper-public

Rust-based Lua runtime for cryptocurrency trading

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Grasshopper

Grasshopper is a Rust-based Lua runtime for cryptocurrency trading. It offers these features:

  • Periodic, asynchronous HTTP polling (gh.subscribe())
    • Event loop based on subscription: see library/router.lua
    • Note: On-demand HTTP requests are performed synchronously
  • Native Decimals support(gh.decimal()) - don't panic on handling precision and arithmetic errors like on CCXT!
  • Type annotations based on lua-language-server(aka sumneko-lua): see library/types.lua
  • Supports six cryptocurrency exchanges: Binance, Bithumb, Bybit, Gate.io, OKX, UPbit. More to come!
  • Logging experience with tracing bindings on lua (gh.info, gh.debug, gh.warn, ...)
  • Supports execution of multiple strategies at once (which are traced individually with tracing)

Release strategy

I maintain this on my private repository and periodically synchronize to here. Feel free to ping me with the issue tracker if you want to use this library and it seems to be too outdated.

How to use

Write down your own strategy(multiple strategies supported) on scripts/ and it will be the entrypoint of the runtime. You can import modules from library/ with require(), e.g. local binance = require("binance");

Special Thanks

Thanks to khvzak for the amazing mlua crate, the ultimate Lua bindings for Rust.

Thanks to actboy168 for the json.lua library.

Thanks to the CCXT team for inspiration of this project.

About

Rust-based Lua runtime for cryptocurrency trading

License:MIT License


Languages

Language:Lua 66.0%Language:Rust 33.3%Language:Shell 0.3%Language:Dockerfile 0.3%Language:C++ 0.0%