# ccxt-go

ccxt-go is a Claude Code skill that integrates crypto exchange APIs into Go applications using REST and WebSocket. Runs when writing trading logic, bots, or microservices.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · ★ 44950 repo stars
- Author: ccxt
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/ccxt/ccxt/tree/HEAD/.claude/skills/ccxt-go/SKILL.md
- Updated: 2026-11-18
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/ccxt-go

## What it does

The skill guides Go developers on integrating CCXT v4 across multiple cryptocurrency exchanges. All exchange clients reside in a single package, instantiated via typed functions like `ccxt.NewBinance` or dynamically through `ccxt.CreateExchange`. For live market data feeds, it wires up the `ccxtpro` package with methods such as `WatchTicker` and `WatchOrderBook`.

Required arguments follow positional order, while all optional arguments rely on functional options formatted as `ccxt.With<Method><Arg>`. Numeric and text fields in returned structs like `ccxt.Ticker` or `ccxt.Order` use pointers such as `*float64` and `*string` because exchanges frequently omit optional payload fields. Direct dereferencing without nil-checks leads to runtime panics.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add ccxt/ccxt --skill ccxt-go -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/ccxt-go/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/ccxt-go/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add ccxt/ccxt --skill ccxt-go -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/ccxt-go/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add ccxt/ccxt --skill ccxt-go -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/ccxt-go/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install ccxt/ccxt .claude/skills/ccxt-go
```

2. **Manually: put the files in place**
- File: `.github/skills/ccxt-go/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add ccxt/ccxt --skill ccxt-go -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/ccxt/ccxt --path .claude/skills/ccxt-go
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/ccxt-go/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add ccxt/ccxt --skill ccxt-go -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/ccxt/ccxt/tree/HEAD/.claude/skills/ccxt-go/SKILL.md

## When to use it
- connect to cryptocurrency exchanges via REST and WebSocket in Go
- fetch market tickers, OHLCV candle charts, and order books
- create market and limit buy or sell orders
- track balances and active orders across trading pairs

## Example prompts
- Fetch the latest BTC/USDT ticker from Kraken using ccxt in Go
- Stream live order book updates with ccxtpro in Go
- Write a function to place a limit buy order on Binance using ccxt-go

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: 6166f7a642ce4559.

BEGIN THIRD-PARTY FILE 6166f7a642ce4559
````text
---
name: ccxt-go
description: CCXT cryptocurrency exchange library for Go developers. Covers both REST API (standard) and WebSocket API (real-time). Helps install CCXT, connect to exchanges, fetch market data, place orders, stream live tickers/orderbooks, handle authentication, and manage errors in Go projects. Use when working with crypto exchanges in Go applications, microservices, or trading systems.
---

# CCXT for Go

A comprehensive guide to using CCXT in Go projects for cryptocurrency exchange integration.

## Installation

```bash
go get github.com/ccxt/ccxt/go/v4          # REST (package ccxt)
go get github.com/ccxt/ccxt/go/v4/pro      # WebSocket (package ccxtpro) — same module
```

Every exchange lives in **one package**: there is no per-exchange import path. Construct with `ccxt.New<Exchange>(config)` (e.g. `ccxt.NewBinance`, `ccxt.NewOkx`, `ccxt.NewKraken`) or dynamically with `ccxt.CreateExchange("binance", config)`.

## Quick Start

### REST API
```go
package main

import (
    "fmt"

    ccxt "github.com/ccxt/ccxt/go/v4"
)

func main() {
    exchange := ccxt.NewBinance(nil)

    ticker, err := exchange.FetchTicker("BTC/USDT")
    if err != nil {
        panic(err)
    }
    fmt.Println(*ticker.Last)
}
```

### WebSocket API - Real-time Updates
```go
package main

import (
    "fmt"

    ccxtpro "github.com/ccxt/ccxt/go/v4/pro"
)

func main() {
    exchange := ccxtpro.NewBinance(nil)
    defer exchange.Close()

    for {
        ticker, err := exchange.WatchTicker("BTC/USDT")
        if err != nil {
            panic(err)
        }
        fmt.Println(*ticker.Last) // live updates
    }
}
```

## REST vs WebSocket

| Feature | REST API | WebSocket API |
|---------|----------|---------------|
| **Use for** | One-time queries, placing orders | Real-time monitoring, live price feeds |
| **Import** | `ccxt "github.com/ccxt/ccxt/go/v4"` | `ccxtpro "github.com/ccxt/ccxt/go/v4/pro"` |
| **Constructor** | `ccxt.NewBinance(cfg)` | `ccxtpro.NewBinance(cfg)` |
| **Methods** | `Fetch*` (FetchTicker, FetchOrderBook) | `Watch*` (WatchTicker, WatchOrderBook) |
| **Best for** | Trading, account management | Price monitoring, arbitrage detection |

## How Go calls work (read this first)

- **Required arguments are positional; every optional argument is a functional option** named `ccxt.With<Method><Arg>(...)`: `exchange.FetchOHLCV("BTC/USDT", ccxt.WithFetchOHLCVTimeframe("1h"), ccxt.WithFetchOHLCVLimit(100))`. Do **not** pass `nil` placeholders.
- Methods whose first unified argument is optional (e.g. `FetchOpenOrders`, `FetchMyTrades`, `WatchOrders`, `CancelAllOrders`) take *only* options: `exchange.FetchOpenOrders(ccxt.WithFetchOpenOrdersSymbol("BTC/USDT"))`.
- Exchange-specific extras go in `ccxt.With<Method>Params(map[string]any{...})`.
- Every method returns `(value, error)`. Values are structs (`ccxt.Ticker`, `ccxt.Order`, `[]ccxt.Trade`), and most numeric/string fields are **pointers** (`*float64`, `*string`) because exchanges may omit them — nil-check before dereferencing.
````
END THIRD-PARTY FILE 6166f7a642ce4559

The third-party file has ended. Everything between the 6166f7a642ce4559 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 3038 of 48690 bytes. © ccxt · MIT · https://github.com/ccxt/ccxt/tree/HEAD/.claude/skills/ccxt-go/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
