日本語で読む ›

Making CFTC COT Reports Readable: A Full-Stack Visualization Dashboard

December 07, 2024

Table of Contents

Background and Problem

The COT (Commitments of Traders) report published weekly by the U.S. Commodity Futures Trading Commission (CFTC) is an important indicator of the positioning of each trader category in the commodity futures market. What is published, however, is raw data in text/CSV form — and to see how each category is trending or whether it is overheated, you have to download it each time and process it in a spreadsheet.

"I want to look at the weekly data as-is, without processing, and grasp how the market is moving." To meet that need, I designed and built a web dashboard that continuously visualizes the COT report.

Live URL: https://cftc-dashboard.com/

Approach: Architecture and Technology Choices

To handle everything from fetching and processing the raw data to displaying it end to end, I chose the technology best suited to each role.

Frontend

  • Next.js 15 — Adopted to keep initial rendering fast even on heavy screens with time-series charts, by leveraging SSR/SSG. A React framework built for production operation.
  • TypeScript — Because financial data tends to have complex data structures, type safety guarantees code quality and maintainability.

Backend

  • Go — Adopted for the API server to process the weekly batch and read-path APIs with high throughput and low resource usage.
  • GraphQL — Built as a query layer that flexibly fetches multi-axis data — product, trader category, time range — according to what the screen requests.
  • Python — Used for the processing pipeline that fetches and preprocesses (cleans, computes indicators from) the CFTC raw data.

Infrastructure (Google Cloud Platform)

  • Cloud Run — Deploys the API serverlessly and auto-scales with traffic, balancing operating cost and stability.
  • Cloud Load Balancing — Distributes traffic to ensure availability.
  • Cloud Storage — Stores the fetched raw data and intermediate data.
  • Cloud SQL (MySQL) — A managed database that persists processed data and serves queries.

By standardizing the infrastructure on GCP managed services, the setup keeps server-management overhead low while withstanding the steady-state operation of weekly updates.

Implementation Highlights

A "Don't Over-Process" Data Design

In financial-data visualization, arbitrary processing invites misinterpretation. This dashboard puts transparency first and limits processing to well-known methods that leave little room for interpretation.

  • Net calculation — the difference between long and short (basic arithmetic)
  • Averaging — computing annual averages
  • Z-score — expressing overheating as a heatmap

Interpretive information that might imply causation is deliberately excluded; the policy throughout is to preserve the integrity of the source data and add only "readability."

An Intuitive UI

  • Time-series data shown via interactive charts
  • Multi-device support through responsive design
  • A clean, low-strain presentation, including dark mode

Results

Analysis of the COT report — which used to require downloading raw data and processing it by hand — has been replaced by something you complete just by opening a browser. I designed and implemented everything from data fetching, preprocessing, and the API to the frontend, running it as a full-stack web application that withstands weekly updates.

It is currently published for free, and I am considering expanding its analytical features going forward — CSV download, coverage of more products, and AI-generated overviews, among others.

Closing

This is one example of full-stack development that covers everything from data acquisition to visualization and API delivery. For consultation on data-visualization platforms or web application development, use the contact form.


This dashboard is for informational purposes only. For official data, please refer to the CFTC official website.


Please share it if you like!

Profile picture

Written by 松坂 龍 松坂総合研究所 代表 / フリーランスITエンジニア(クラウド・機械学習・データ基盤) 統計・データ分析の解説をYouTubeでも発信しています。