gitwtfhub

wtf is coinbase-trading-api?

dabberman456/coinbase-trading-api — explained in plain English

Analysis updated 2026-05-18

128TypeScriptAudience · developerComplexity · 3/5Setup · moderate

TL;DR

A TypeScript trading bot for Coinbase that buys and sells crypto using an EMA crossover trend following strategy, with paper trading on by default.

Mindmap

mindmap
  root((Coinbase EMA Bot))
    What it does
      EMA crossover strategy
      Paper trading default
      Logs ATR volatility
    Tech stack
      TypeScript
      Node.js
      Coinbase Advanced Trade API
      Zod
    Use cases
      Automate a trading rule
      Learn systematic trading
    Audience
      Self directed traders
      Developers

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Automate a simple EMA crossover trading rule against a real exchange.

REASON 2

Paper trade a strategy to see what it would have done before risking real money.

REASON 3

Extend the bot with your own risk engine, stop losses, or additional strategies.

What's in the stack?

TypeScriptNode.jsCoinbase Advanced Trade APIZod

How it stacks up

dabberman456/coinbase-trading-apisimular-ai/simulangagutinbaigo28/financial-agent-api
Stars128128129
LanguageTypeScriptTypeScriptTypeScript
Setup difficultymoderatemoderatehard
Complexity3/53/54/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · moderate Time to first run · 30min

Requires a Coinbase Advanced Trade account and API key, live trading needs an explicit opt-in flag.

The README does not state a license.

Wtf does this do

This project is a trading bot for Coinbase's Advanced Trade API, written in TypeScript and built to run on Node.js version 20 or later. It follows a systematic trend following strategy based on exponential moving averages, commonly called EMAs, rather than any kind of automated prediction or artificial intelligence. The strategy compares a shorter EMA against a longer EMA on candle closes. A buy signal happens when the shorter EMA crosses above the longer one and the price is also above a long term trend filter EMA, which defaults to a 200 period average. A sell signal happens when the shorter EMA crosses back below the longer one. The bot also calculates and logs the Average True Range, a measure of price volatility, on every cycle, which a user could use to add features like stop losses later. Paper trading, meaning the bot only logs what it would have done without placing real orders, is turned on by default. Placing live orders requires explicitly opting in through a single configuration flag. Risk is controlled through a per trade risk fraction and an optional maximum amount per order, both set by the user rather than guessed by the bot. Configuration is read from an .env file and validated at startup using a library called Zod, so invalid settings are caught immediately instead of causing problems later. To run it, a user installs dependencies with npm, copies an .env file with their Coinbase API keys and settings, and starts the bot with npm run dev, which runs the TypeScript source directly, or builds it first with npm run build and runs the compiled output with npm start. The README links to three related projects in the same family: a Binance spot trading bot, a Bybit trend following bot, and an AI based trading agent. It also states plainly that the project does not promise profits, that trading involves risk of loss, and that the user is responsible for their own API keys, fees, and compliance with Coinbase's terms and local law.

Yoink these prompts

Prompt 1
Help me set up a .env file and API keys to run this bot in paper mode.
Prompt 2
Explain how the EMA crossover and trend filter decide when to buy or sell here.
Prompt 3
Show me how to add a stop loss using the ATR value this bot already logs.

Frequently asked questions

wtf is coinbase-trading-api?

A TypeScript trading bot for Coinbase that buys and sells crypto using an EMA crossover trend following strategy, with paper trading on by default.

What language is coinbase-trading-api written in?

Mainly TypeScript. The stack also includes TypeScript, Node.js, Coinbase Advanced Trade API.

What license does coinbase-trading-api use?

The README does not state a license.

How hard is coinbase-trading-api to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is coinbase-trading-api for?

Mainly developer.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.