今日已更新 133 条资讯 | 累计 37382 条内容
关于我们

标签:#polymarket

找到 25 篇相关文章

开发者

Polymarket Paper Trading Bot: Build One in Python

Polymarket Paper Trading Bot: Build One in Python A real-money trading bot is the wrong place to discover that your signal logic, order-book handling, or position accounting is broken. A Polymarket paper trading bot gives you a safer engineering environment: consume real market data, generate real signals, simulate orders and fills, and measure hypothetical performance before connecting execution credentials. The important distinction is that paper trading should simulate the execution layer , not fabricate market data. Polymarket currently exposes public market data without authentication, while its public WebSocket market channel provides real-time order-book and price updates. This article builds that architecture in Python. What You'll Learn How a paper-trading architecture differs from a live bot How to discover markets through the public API How to consume CLOB order-book data How to simulate limit-order fills How to track positions and P&L How to test arbitrage, market-making, and directional strategies How to graduate from paper trading to production safely About the Author Soulcrancerdev Contact: X: @soulcrancerdev Telegram: soulcrancerdev YouTube: YouTube channel The Architecture A useful design separates data, strategy, simulation, and accounting : flowchart LR A[Gamma Market Discovery] --> B[Market Metadata] C[CLOB REST / WebSocket] --> D[Market Data Engine] B --> D D --> E[Strategy Engine] E --> F[Paper Execution Engine] F --> G[Virtual Portfolio] G --> H[P&L / Risk Metrics] D --> I[Logger / Metrics] The key design decision is that PaperExecutionEngine should implement the same interface your live execution engine eventually uses. That means the strategy does not know whether an order is simulated or real. 1. Discover Markets Polymarket's Gamma API provides public market discovery. The current documentation exposes keyset pagination through: https://gamma-api.polymarket.com/markets/keyset Markets include fields such as conditionId , clobTokenIds , outco

2026-08-25 原文 →
AI 资讯

Build a Real-Time Polymarket Order Book Monitor with Python

Build a Real-Time Polymarket Order Book Monitor A trading bot should not make decisions from stale snapshots. If you want to understand liquidity, spread, depth, or changes in market structure, you need a continuously updated view of the Polymarket order book. This tutorial builds a lightweight Polymarket order book Python monitor using the public CLOB Market WebSocket. Polymarket documents this channel as a real-time feed for order-book, price, and market lifecycle updates. The implementation intentionally focuses on market data—not order execution—so it can be used as the foundation for research, dashboards, alerts, or an automated trading system. What You'll Learn How Polymarket token IDs relate to order-book subscriptions How to connect to the CLOB Market WebSocket How to process book and price_change events How to calculate best bid, best ask, and spread How to handle reconnects and heartbeats How to detect stale market data How to turn raw WebSocket events into trading signals Architecture flowchart LR A[Polymarket CLOB] --> B[Market WebSocket] B --> C[Python Async Client] C --> D[Order Book State] D --> E[Spread / Depth Metrics] D --> F[Trading Signal Engine] D --> G[Logging / Monitoring] The important design decision is separating transport from state . The WebSocket delivers events; your application maintains the current book. 1. Install the Dependencies For this monitor, authentication is not required because the Market WebSocket is public. pip install websockets You need a Polymarket asset ID/token ID for the outcome you want to monitor. The Market Channel subscribes using assets_ids . For example: TOKEN_ID = " YOUR_TOKEN_ID " Do not hard-code credentials into a market-data monitor. In this example, there are no credentials at all. 2. Connect to the Market WebSocket The documented Market Channel endpoint is: wss://ws-subscriptions-clob.polymarket.com/ws/market The subscription message contains type: "market" and one or more asset IDs. A minimal monitor lo

2026-08-22 原文 →
AI 资讯

Dockerize Your LLM Proxy: One Container for Free Multi-Provider Access

Dockerize Your LLM Proxy: One Container for Free Multi-Provider Access Want free LLM access in a repeatable, portable way? Run it as a container. Why Docker Single command to deploy anywhere Isolated environment with consistent deps Easy to put behind a reverse proxy DAVIL Cod in Docker DAVIL Cod ships a Dockerfile. Build and run with provider keys as env vars: docker build -t davil-cod . docker run -p 4000:4000 \ -e PROVIDER_GROQ_APIKEY = ... \ -e PROVIDER_MISTRAL_APIKEY = ... \ davil-cod Features you get Provider rotation with circuit breaker Disk cache for repeated prompts Dashboard on port 4000 FAQ Does it persist the cache? Yes — mount a volume for the cache directory. Can I expose it to my team? Yes — it's a normal HTTP service with token auth.

2026-08-21 原文 →
AI 资讯

Building a Trading Bot Is Easy. Building a Testable Trading System Is Hard.

When building a Polymarket bot, the first version can be surprisingly small: market data ↓ strategy ↓ order That's enough to demonstrate an idea. It isn't enough to prove that the idea works. Once you care about realistic execution, the architecture becomes more interesting. Market Data ↓ Data Validation ↓ Signal Engine ↓ Risk Engine ↓ Execution Engine ↓ Trade Events ↓ Analytics This separation is what allows me to test the strategy independently from the infrastructure. 1. Don't backtest the API call One mistake I see in trading-bot development is mixing the strategy with execution. For example: if ( signal ) { await placeOrder (); } This is convenient for a prototype. But how do you test the strategy without sending an order? Instead: const signal = strategy . evaluate ( marketState ); const decision = riskEngine . check ( signal , portfolio ); if ( decision . allowed ) { await executionEngine . submit ( signal ); } Now each component can be tested independently. 2. Model execution separately A backtest shouldn't assume: signal price === fill price Instead, the execution simulator should model things such as: signal price spread slippage available liquidity fees latency Then: expected PnL ↓ execution model ↓ realistic PnL estimate The difference can be substantial. Polymarket's CLOB exposes order-book data and executable prices, making the order book an important part of any execution-aware strategy. 3. Separate in-sample and out-of-sample data Don't optimize and evaluate on the same dataset. A simple structure: Dataset ├── Train └── Test The strategy is developed using Train . Parameters are frozen. Then Test is used only for evaluation. For time-series trading, I prefer chronological splits rather than random shuffling: Past ───────────────────────> Future [ Training ][ Validation ][ Test ] This better represents the actual information flow of a trading system. 4. Measure more than win rate Win rate is useful, but insufficient. I want to measure: trades wins los

2026-08-17 原文 →
AI 资讯

Legged Arbitrage on Polymarket: Buying Cheap Now, Hedging Later

Not every arb opportunity is simultaneous. My bot uses a “legged” approach: it buys one side when it’s heavily underpriced, then waits for market sentiment to shift and buys the other side later for a total cost under $1.00. This strategy shines in volatile non-crypto markets (elections, sports playoffs, news-driven events). Careful inventory and timing controls turned it into a consistent contributor to the bot’s $130k+ track record. The sample source is in https://github.com/cryptomoonday/polymarket-arbitrage-bot

2026-07-27 原文 →
AI 资讯

How I built a real-time whale tracker for Polymarket using Node.js and a CLI

The 2026 World Cup has $3.89 billion bet on it across Polymarket. That's not retail money — that's whales. I built WhaleTrack to track exactly what those big wallets are doing. Here's the stack: Backend: Node.js server fetching live data via Bullpen CLI Frontend: Vanilla JS, real-time updates Data: Polymarket CLOB API via Bullpen Analytics: Google Analytics for traffic tracking The hardest part wasn't the code — it was getting users. Pure SEO and content distribution (Reddit, Twitter, IH). The site is live at whaletrack.app — would love feedback from devs on the UX and performance. Happy to open source parts of it if there's interest.

2026-07-05 原文 →
AI 资讯

Exploring Polymarket's 1-Hour Markets: Data Analysis, Mispricing Opportunities, and Automated Trading Strategies

Prediction markets have become increasingly popular among traders looking for alternative ways to speculate on asset movements. While much of the attention has been focused on short-term 5-minute and 15-minute markets, I believe one of the most overlooked opportunities right now is the 1-hour market on Polymarket. In this article, I'll share some of my ongoing research, explain how I'm collecting and analyzing market data, discuss potential arbitrage and mispricing opportunities, and show how automation can help traders capitalize on these inefficiencies. Why I'm Focusing on the 1-Hour Market Many traders are currently concentrated on the 15-minute Bitcoin prediction markets. While these markets can be profitable, competition has increased significantly, and recent fee changes have made certain strategies less attractive. The 1-hour markets, however, present a different opportunity. These markets offer: Longer trading windows More time to manage positions Higher flexibility for order placement Potentially lower competition No trading fees on some hourly markets Because of the longer duration, traders have more time to identify inefficiencies and execute strategies that may be difficult to implement in shorter timeframes. Collecting Market Data Directly from Polymarket One of the projects I've been working on involves collecting market data directly from Polymarket and monitoring token price movements in real time. Rather than relying solely on the displayed market prices, I use blockchain-based data sources that can provide updates faster than the front-end interface. This allows me to analyze: YES token price swings NO token price swings Order book movements Temporary mispricings Combined token costs The goal is to understand how both sides of a market move throughout the trading period and identify situations where the combined cost of YES and NO tokens falls below $1. Understanding YES and NO Token Swings One interesting metric I track is the lowest price reached

2026-06-24 原文 →
AI 资讯

My Polymarket Trading Bot in Rust After TypeScript Kept Missing Fills

A trader I was talking to recently said something that stuck with me: "I've blown accounts just from slow fills or missed order cancellations." He was talking about CEX perpetuals. But the problem is identical on Polymarket's CLOB - just measured in seconds instead of milliseconds. My TypeScript bot was averaging 340ms from signal detection to order placement on Polymarket's Central Limit Order Book. On a 5-minute market with a ~2.7-second mispricing window, that's 12% of the entire opportunity window consumed before a single byte hits Polymarket's servers. I was consistently entering at 74¢ when I'd detected the signal at 70¢. The market had already repriced against me. So I rewrote it in Rust. This article documents exactly what I found, what changed, and - critically - what didn't. Background: What My Bot Was Doing If you've read my earlier posts in this series ( architecture , Kelly Criterion sizing , last-60-seconds capture ), you know the context. But the short version: The bot targets Polymarket's 5-minute and 15-minute crypto up/down binary markets (BTC, ETH, XRP, SOL, DOGE, BNB). The strategy is simple: find markets that are briefly mispriced relative to real-time spot momentum, enter at a discount to fair value, hold to resolution. A 5-minute "XRP Up" market priced at 70¢ when spot momentum suggests 82% probability = +12¢ edge per dollar wagered. Do that 50 times a day with disciplined sizing and the math works - if you can actually get filled at the price you detected. The problem: by the time my TypeScript code detected the signal, formatted the order, opened an HTTP connection to Polymarket's CLOB API, waited for TLS handshake, serialized the payload, and received confirmation, the market had often moved to 74-76¢. I was paying for an edge I wasn't capturing. Profiling the TypeScript Bot: Where Was the 340ms Going? Before rewriting anything, I instrumented every stage of the order path. Here's what I found across 500 sampled trades: Stage Average time %

2026-06-18 原文 →