explaingit

dabberman456/coinbase-trading-api

Analysis updated 2026-05-18

128TypeScriptAudience · developerComplexity · 3/5Setup · moderate

TLDR

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

What do people build with it?

USE CASE 1

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

USE CASE 2

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

USE CASE 3

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

What is it built with?

TypeScriptNode.jsCoinbase Advanced Trade APIZod

How does it compare?

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 get it running?

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.

In plain English

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.

Copy-paste 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

What 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.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.