Built This Week/Builds

Builds

ChatGPT Trading Bot on the Public API

A ChatGPT trading bot on Public's API took Jordan three to six hours in Replit. It made 10 to 12 trades on the Bitcoin ETF and ended about breakeven: $300 in, $299 out.

Jordan built a trading bot in Replit that lets ChatGPT decide when to buy and sell, and places the trades through Public's newly launched brokerage API. It traded one stock, IBIT (the Bitcoin ETF), with a decision every 30 seconds. Total build time was three to six hours. He showed it in Episode 8 (August 15, 2025) to two people from Public: Emily Kurtz, head of product, and Jake Trefethen, who leads AI.

Why we built it

Public had just released its API, which Emily described as a "fourth front end" for people who want to trade programmatically. Jordan is no day trader; he manages his own portfolio and that's it. That was the point: test how easy it is for a non-expert to get a working trading app on the API.

The stack

  • Replit: vibe coded the entire front end and back end. It already knew most of Public's API.
  • Public API: account data, holdings, order history and trade execution.
  • ChatGPT (OpenAI API): the decision maker, with confidence scores for each call. Jordan also thinks he may have used ChatGPT to write a product requirements doc first.
  • Polygon.io: a free price feed polled about every 15 seconds, with Public as backup if he hit the rate limit.

How we built it, step by step

  1. Maybe write a PRD. Jordan "probably" used ChatGPT for a product requirements doc.
  2. Vibe code it in Replit. When Replit didn't know something, he pasted in parts of Public's documentation.
  3. Create API keys for Public and OpenAI.
  4. Get prices cheaply. Polygon's free API every 15 seconds, falling back to Public when rate-limited.
  5. Write the prompt. Every 30 seconds ChatGPT gets the price, portfolio value, share count, aggressiveness, trade history, buying power and cash float. Adding trade history was an improvement over his first version, which only sent the cash balance.
  6. Add guardrails. A stop-loss percentage, a max position size, an aggressiveness setting and a cash float so the bot never runs out of money.
  7. Add the dashboard. Confidence scores, technical performance, live monitoring, and dark, light and "disco" modes.
And then ChatGPT actually does some analysis and decides whether or not I should buy or sell.

— Jordan Metzner, Episode 8

How it turned out

The bot "went a little bit crazy," buying and selling over and over. On the day of recording it traded four shares and lost about 11 cents before Jordan switched it off for the show. Overall it made roughly 10 to 12 trades and turned $300 into $299. Jordan's view: breakeven on that many trades is "actually pretty good," especially "because I don't know what I'm doing." Jake noted ChatGPT didn't know the account only got two round-trip trades a day, so it wasn't optimizing for that. Some pages, like AI predictions, didn't fully work.

This is not investment advice. I would not trade real I would not trade real money at scale using this algorithm, but the cool part is you could trade it against the history and you kind of see how well it would perform.

— Jordan Metzner, Episode 8

Disco mode was a hit. Jake said it should be a default on all browsers.

What we'd do differently

  • Send charts, not just numbers. Jake said multimodal models do well at visual price-action analysis, even across multiple time frames with indicators overlaid.
  • Know when markets are open. Jordan hadn't thought about holidays; Emily added that asset classes keep different hours. A market-hours API fixes both.
  • Stream prices. WebSockets instead of polling, which Public was working on.
  • Ask more than one model. Jordan wanted to compare Gemini and Claude and trade on consensus.
  • Use a real back end. Supabase, a React front end and better cron jobs.
  • Choose speed or thinking. Giving a model minutes to reason only works if you trade hourly or daily, not every 30 seconds.

Jordan built a second bot months later, for prediction markets: see the Kalshi prediction market trading bot. More on the industry: AI in Finance.

FAQ

How do you build a ChatGPT trading bot?

Jordan vibe coded a web app in Replit that pulls the price of one stock every 15 seconds, sends the price, portfolio, holdings, trade history, buying power and risk settings to ChatGPT every 30 seconds, and lets ChatGPT decide to buy or sell through Public's API.

Can you build a trading bot on the Public.com API?

Yes. Public had just launched a REST API for programmatic trading. Replit already knew much of it, and Jordan pasted in pieces of Public's docs when needed. He created a Public API key and an OpenAI API key.

Does a ChatGPT trading bot make money?

Ours didn't, but it didn't lose much either. It made about 10 to 12 trades and turned $300 into $299. Jordan was clear it is not investment advice and said he would not trade real money at scale with it.

How long does it take to vibe code a trading bot in Replit?

Jordan put the total build time at somewhere between three and six hours.

How can you improve an LLM stock trading bot?

Public's AI lead Jake Trefethen suggested sending price-chart images across multiple time frames to a multimodal model. Jordan also wanted multi-model consensus, WebSockets for streaming prices and a market-hours API.