fu.ily
Explorer
ghx
← back

Before You Trade Polymarket, Build a Data Layer

2025-01-06

I've seen it. You've seen it. We've all seen it.

Anon trader has a system that crushes on Polymarket. It's the hot new thing and everyone wants in. You're probably asking yourself, "How do I get started?"

Well, I'm here to help.

Since the rise of AI, data has always been important. Computer vision, LLMs—you name it—all run on a plethora of data. A good dataset helps them make good decisions.

Polymarket is no different.

In this article, I'm going to walk you through setting up your own server and creating your own data layer. What you build on top of it is up to you.

I just want to help you make good decisions.


What's a Server?

This sounds a lot more complicated than it really is.

People used to tell me they had a server and I'd be immediately in awe. But it's simple.

A server is just a computer you rent that runs scripts and stays on indefinitely. No need to keep your Mac charging 24/7.

Here's how to set one up:

DigitalOcean Setup (5 minutes)

  • Go to digitalocean.com and create an account
  • Click "Create" → "Droplets"
  • Choose:
  • - **Ubuntu 24.04**
  • - **Basic plan** → $6/month (1GB RAM is fine)
  • - **Region** → wherever's closest to you
  • Under "Authentication," choose **Password** (simpler for now)
  • Click "Create Droplet"

That's it. You now have a server.

You'll get an IP address (something like 143.198.xx.xx). That's your server's address.

To connect to it, open your terminal and type:

ssh root@YOUR_IP_ADDRESS

Enter your password. You're in.


Build Your Data Layer

Alright, you've got a server. Now let's get the code on it.

I've put together a starter repo that handles all the Polymarket data collection for you. Here's the link:

https://github.com/afdelacruz/polymarket-data-starter

While connected to your server:

git clone https://github.com/afdelacruz/polymarket-data-starter.git
cd polymarket-data-starter
./setup.sh

That's it. The script installs everything you need.

Now test it:

source venv/bin/activate
python scripts/record.py --once

If you see "Recorded X market snapshots" — it's working.

Under the hood

The script asked Polymarket "what are all the markets and their prices?" and saved the answers to a database. That's it.


Keep It Running

Right now, if you close your terminal, the script stops. That's not useful.

You want this thing running 24/7, collecting data while you sleep.

./run-forever.sh

That's it. Your server is now collecting Polymarket data around the clock.

To check if it's working:

systemctl status polymarket-recorder

You should see "active (running)."

Close your laptop. Go to sleep. Go outside. It keeps running.

*(Curious what the script does? Open it up and read it. No magic, just a few commands that tell your server to keep the recorder running.)*


Now What?

You've got a server. It's collecting data.

The rest is up to you.

The data is sitting in a SQLite database at data/snapshots.db. Every 60 seconds, it saves:

  • Market prices (YES/NO)
  • Volume and liquidity
  • Bid/ask spreads
  • Timestamps

Over time, you'll have a history of how markets moved. You'll have data.

Like I said, I'm not going to tell you what to build. I'm just here to give you a good foundation. From here you can make your own decisions.


Here's the thing nobody talks about.

The traders making money on Polymarket? They're not smarter than you. They just started earlier. They collected data while everyone else was watching from the sidelines.

Data won't make you money. But you can't make money without it.

You now have a server running 24/7, collecting real market data. Most people will never get this far.

Be curious.