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
- Event loop based on subscription: see
- Native
Decimal
s 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)
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.
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");
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.