examples/

directory
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 25, 2026 License: MIT

README

MMT API Go Client Library Examples

This directory contains example applications demonstrating how to use the MMT API Go client library.

Prerequisites

All examples require a valid MMT API key. Set it as an environment variable before running any example:

export MMT_API_KEY="your-api-key-here"

Get your API key at https://mmt.gg.

Examples

1. REST Basic (rest_basic/)

Demonstrates basic usage of the REST API client:

  • Getting candles (single exchange and aggregated)
  • Getting market stats and open interest
  • Getting volume delta and volume distribution
  • Getting heatmaps and orderbook data
  • Listing available markets
cd rest_basic
export MMT_API_KEY="your-api-key-here"
go run main.go
2. WebSocket Basic (websocket_basic/)

Demonstrates WebSocket client usage:

  • Connecting to WebSocket with callbacks
  • Subscribing to real-time data streams
  • Handling different message types (candles, trades, stats, orderbook, flat heatmap)
  • Graceful shutdown with cleanup
cd websocket_basic
export MMT_API_KEY="your-api-key-here"
go run main.go

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL