Example bot: Layer Whales#
Layer Whales is an example bot built on the Python SDK (client.whales). Clone it, run it on your machine, and change it however you like. The code is on GitHub at uselayer/layer-whales, under the MIT license.
It answers one question: what are the best traders buying right now, and can I still get in? It reads traders on Kalshi and Polymarket and copies their trades in a sandbox: real prices and fees, no real money. A Polymarket trader is copied on the same Polymarket market, a Kalshi trader on the same Kalshi market. It never sends a real order.
What it does#
Three tabs:
- Feed. What the traders worth following just bought, newest first: what they paid, the price now, and whether you can still get in (at most 3¢ above their price). Tap a trade to see a payout preview and copy it.
- Traders. Polymarket traders sorted by whether they're worth copying, each with a one-line reason and the evidence, plus the top traders on Kalshi and Polymarket and big trades as they happen. It checks about 200 traders: the leaderboards, and wallets trading in busy markets that no leaderboard lists.
- My trades. Every trade you copied: your price, open, won or lost, and the profit after fees, with the total at the top. Also the traders you copy.

The Feed on Oct 9: what the traders worth following just bought, and whether you can still get in near their price. Trader names are blurred here; the app shows them.
How it judges a trader#
Every trader's trades from the last 30 days are checked against Polymarket's own price history. Six rules, in plain words:
- Beats the price. After they buy, the price moves their way within 5 minutes. This is the main test of skill.
- Enough trades to trust it. One trade per market, and trades on the same event count once. Confidence is high, medium or low.
- Steady. The edge holds without their two best trades, and their profit holds without their biggest win.
- Copyable. Buying the same thing a few minutes later and paying Polymarket's taker fee still gains.
- Takes a side. Market makers and arbitrage have no view to copy, so they're left out. Bots are fine.
- Where their edge is. The same test per category (sports, crypto…), so you can copy someone only there.
| Segment | What to do |
|---|---|
| Proven sharps | Follow: a long record that passes every rule |
| Quiet sharps | Follow: the same, from small accounts no leaderboard lists |
| Rising | Watch: good early signs, not enough evidence yet |
| Sharp but too fast | Signal only: a real edge, gone by the time a copier gets in |
| Lucky big bettors | Don't follow: big profit, but the price doesn't move their way |
The Feed shows trades from Proven sharps, Quiet sharps and Rising traders.

A trader's page, in an earlier design: every rule's check, with the numbers behind it.
What we found on Oct 7: of 200 traders, 1 proven sharp and 1 quiet sharp; 58 lucky big bettors; 44 market makers or arbitrage. Copying a few minutes late, after fees, comes out about even for most traders. A score reads the last 30 days; it isn't a promise.
What runs where#
| Piece | Where it runs |
|---|---|
| Top traders, trades, scores | The SDK, on your machine, reading Kalshi's and Polymarket's public data. No venue key. |
| Sandbox copies of Polymarket trades | The SDK, on your machine: filled at Polymarket's best price, with its taker fee, from its public market data |
| Sandbox copies of Kalshi trades | The SDK, on your machine, against Kalshi's real order book. Needs your Kalshi key. |
| Whether a trader has an account on the other venue | Layer's hosted matching, called by the SDK with your Layer key |
| The app | Your machine, 127.0.0.1:8790. It answers only this machine. |
Nothing is hosted. Layer gets your Layer key and market ids. It never sees the traders you copy, your trades or your positions.
Set up#
You need uv; it fetches Python 3.11+ if you don't have it.
git clone https://github.com/uselayer/layer-whales
cd layer-whales
uv sync
LAYER_API_KEY=lyr_... uv run whales-demoOpen http://127.0.0.1:8790. WHALES_PORT changes the port. The Layer key is optional: without it, everything works except finding a trader's account on the other venue. To copy Kalshi traders, also set KALSHI_KEY_ID and KALSHI_PRIVATE_KEY_PATH.
The first check of who's worth following reads about 200 traders and the prices after each of their trades, so it takes about half an hour, sometimes longer. The Feed fills in when it's done, and the result is refreshed every 6 hours.
Try it in the sandbox#
- Copy a trade. On the Feed, a trade you can still get into has a Copy trade button. Choose how much to put in ($10, $50, $100 or any amount, fee included). The preview updates as you type: what you pay, the fee, what you get if it wins and what you lose if it doesn't. Copy this trade buys exactly that, on the same market at the price now, if it's still at most 3¢ above what they paid.
- Copy a trader. Copy trader copies their next trades from now on: 5 contracts each, at most 3¢ above their price, held until the market settles. Trades they made before are never copied this way; use Copy trade for those.
- My trades. The total at the top, then one row per copy. A trade that can't be copied near their price, or a market that isn't taking orders, is skipped, and the page says why.
- Start over. Reset the sandbox clears your positions and copied trades and keeps the traders you copy.

My trades, in an earlier design: every copy is held until its market settles.
Good to know#
- It's a sandbox. Copies use real prices and fees and fake money. Nothing reaches a venue.
- A copy fills at Polymarket's best price. Polymarket's public market data shows the best price but not how many contracts are for sale there, so a large amount might not really fill at it.
- Copying a trader lands minutes late. Polymarket's public trade feed runs a few minutes behind, and the app checks it while it's running. Trades made while it's off are missed.
- Kalshi's trader data can change. It comes from the public endpoints behind kalshi.com's Leaderboard and profile pages, which Kalshi doesn't document. Many Kalshi traders hide their trades.
- A link across venues is a guess. It shows the evidence, and never says two accounts are the same person.