POLY DAY LIVE
กนง. (ธนาคารแห่งประเทศไทย) จะปรับลดอัตราดอกเบี้ยนโยบายลงอย่างน้อย 0.25% ภายในปี 2026 หรือไม่? (ใช่ 66% · 66¢ · 24h $1.5M) ดอกเบี้ย Fed & กนง., ₿ เป้าหมายราคา Bitcoin (BTC), การเมืองโลก & พรีเมียร์ลีก/แชมเปียนส์ลีก เรดาร์วาฬ Smart-Money แบบเรียลไทม์: ติดตามคำสั่งซื้อขายขนาดใหญ่ >$1,000 USDC · Limit Order ค่าธรรมเนียม 0% กนง. (ธนาคารแห่งประเทศไทย) จะปรับลดอัตราดอกเบี้ยนโยบายลงอย่างน้อย 0.25% ภายในปี 2026 หรือไม่? (ใช่ 66% · 66¢ · 24h $1.5M) ดอกเบี้ย Fed & กนง., ₿ เป้าหมายราคา Bitcoin (BTC), การเมืองโลก & พรีเมียร์ลีก/แชมเปียนส์ลีก เรดาร์วาฬ Smart-Money แบบเรียลไทม์: ติดตามคำสั่งซื้อขายขนาดใหญ่ >$1,000 USDC · Limit Order ค่าธรรมเนียม 0%
P.DAY p.day
Poly Day · ทำนายผลวันนี้ p.day
ติดตามเม็ดเงินจริง · เรดาร์วาฬ · สูตร Kelly
← Back to Quant Hub & GitHub Repos
05 · AI LLM PROBABILITY CALIBRATION & HALF-KELLY L3 Pro Quant Dev 12 min read 2026-10-26

AI LLM Probability Calibration + Half-Kelly Sizing: Step-by-Step DeepSeek / OpenAI / Ollama API Integration for +EV Orders

Complete step-by-step guide to connecting DeepSeek, OpenAI GPT-4o, or local Ollama LLMs via Python to parse breaking news into structured Bayesian likelihood ratios and Half-Kelly position sizes.

0.5x KELLY +EV > 4% LLM Calibrated

3-Minute Beginner Pre-Flight Checklist

  • ✓An LLM API Key from DeepSeek (platform.deepseek.comคัดลอก), OpenAI (gpt-4o-miniคัดลอก), OpenRouter, or a free local Ollama server
  • ✓Run pip install openai requestsคัดลอก in your VPS or local Python environment
  • ✓Pairs directly with P.DAY's 'JEV True Prob' and 'Calc Kelly' buttons
  • ✓Core rule: only enter when p* > P_mkt + 4%คัดลอก
Beginner VPS Setup: Why You Need a 24/7 Cloud Server (and How to Pick One in 3 Minutes)

Never run a live trading bot on a home laptop that sleeps or drops Wi-Fi! We recommend RAKsmart Cloud VPS: (1) Choose Tokyo, Singapore, or Silicon Valley for ultra-low millisecond latency to OKX/Binance & Polygon RPCs; (2) Select Ubuntu 22.04 LTS (2 vCPU / 4GB RAM) for Docker Compose; (3) Bind your dedicated static IPv4 address to your exchange API whitelist.

Provision Your RAKsmart Quant VPS Now ↗
STEP 0 FOR BEGINNERS · HOW TO CONNECT TO YOUR VPS VIA SSH & ENTER COMMANDS

Just Bought a VPS? How to Connect via SSH & Run Commands on Windows / Mac (3-Minute Guide)

Many first-time users get stuck right after buying a cloud server: 'Where do I type these terminal commands?' Follow these 5 simple steps:

Step ①: Grab Your 4 Server Credentials (IP + SSH Port + Username + Password)
After provisioning an Ubuntu 22.04 server on RAKsmart Cloud VPS ↗, copy four items from your welcome email or control panel:
• Server IPv4 Address (e.g., 198.51.100.88คัดลอก)
• SSH Port: Usually 22คัดลอก, or a custom security port like 22022คัดลอก / 62134คัดลอก shown in your panel
• Username: Always rootคัดลอก on Ubuntu
• Root Password: Your initial server password
Step ②: Open the Built-in Terminal on Your Computer (No Extra Software Needed)
• On Windows 10 / 11: Press Win + R, type powershellคัดลอก, and hit Enter.
• On Mac: Press Command ⌘ + Space, type Terminalคัดลอก, and hit Enter.
Step ③: Type the SSH Connection Command with Port (`-p`)
In your terminal window, run ssh -p PORT root@SERVER_IPคัดลอก (note lowercase -pคัดลอก; omitting a custom port causes Connection refusedคัดลอก):
• Standard Port 22: ssh -p 22 root@198.51.100.88คัดลอก
• Custom SSH Port (e.g. 62134คัดลอก): ssh -p 62134 root@198.51.100.88คัดลอก
Step ④: Pass the Two Classic Beginner Hurdles (`yes` + Invisible Password)
• Prompt 1 (Fingerprint check): When asked Are you sure you want to continue connecting (yes/no)?คัดลอก, type the full word yesคัดลอก and press Enter.
• Prompt 2 ([!] Why doesn't the cursor move when I type my password?!): When asked for password:คัดลอก, Linux hides all characters (not even * asterisks appear) for security! Simply right-click in PowerShell (or press Cmd + Vคัดลอก on Mac) to paste your password invisibly, then press Enter!
Step ⑤: You're In (`root@ubuntu:~#`)! Run the 1-Minute Docker & Python Setup
Once your prompt changes to root@ubuntu:~#คัดลอก, you are inside your cloud server! Paste these setup commands once to install Docker, Git, and Python:
Step ⑥: How to Save Python Code on Your VPS & Run It 24/7 in the Background
• For docker compose ...คัดลอก commands: Simply right-click to paste into your SSH window and press Enter.
• For Python (.pyคัดลอก) scripts: Type nano bot.pyคัดลอก and hit Enter → Right-click to paste the code → Press Ctrl + O then Enter to save → Press Ctrl + X to exit → Run nohup python3 bot.py > bot.log 2>&1 &คัดลอก so your bot keeps running 24/7 even after you close your laptop!
root@raksmart-ubuntu:~# (First-Time Server Initialization Commands)
Need a VPS? Get RAKsmart Cloud VPS Here ↗
# 1. Update Ubuntu packages and install Git, Curl, and Python3
apt update -y && apt install -y curl git python3-pip python3-venv

# 2. One-line official Docker & Docker Compose installation
curl -fsSL https://get.docker.com | sh && systemctl enable --now docker

# 3. Verify Docker Compose is ready
docker compose version
Pro Tip: To paste commands into Windows PowerShell/SSH, simply Right-Click inside the window (or press Ctrl+Shift+V), then hit Enter!
INTERACTIVE LLM QUANT CODE GENERATOR · PASTE API KEY & COPY READY-TO-RUN CODE 100% Client-Side Privacy: Your API Key is assembled locally inside your browser via JavaScript and is never transmitted to any server.

Interactive AI LLM × Half-Kelly Quant Bot Code Generator

No manual coding required! Select your LLM provider and model below, enter your API Key, and instantly generate a customized, ready-to-run Python script plus a one-click SSH terminal deployment command.

Output B: One-Click SSH Terminal Command (Auto-Installs SDK, Creates File & Runs Bot)
Connected to your VPS via SSH? Click the button below, Right-Click inside your SSH terminal to paste, and press Enter to install and run immediately!
Output A: Customized Python Source Code (llm_bayesian_kelly_bot.py)
llm_bayesian_kelly_bot.py (End-to-End LLM API + Bayesian + Half-Kelly Pipeline)
# 0. 安装依赖并配置大模型 API 密钥 (支持 DeepSeek / OpenAI / Claude / 本地 Ollama)
# pip install openai requests
# export LLM_API_KEY="sk-你的大模型API密钥"
# export LLM_BASE_URL="https://api.deepseek.com/v1"  # 或 https://api.openai.com/v1 或本地 http://127.0.0.1:11434/v1

import os, json, math
from openai import OpenAI

# 1. 初始化大模型客户端 (兼容所有 OpenAI 格式接口)
llm_client = OpenAI(
    api_key=os.environ.get("LLM_API_KEY", "sk-your-api-key"),
    base_url=os.environ.get("LLM_BASE_URL", "https://api.deepseek.com/v1"),
)

def get_llm_catalyst_likelihood(market_question: str, resolution_rules: str, breaking_news: str) -> dict:
    """调用大模型 API 分析突发新闻对盘口结算的边际影响,强制返回 JSON 格式似然比 (0.50 ~ 2.00)"""
    system_prompt = (
        "You are a quantitative prediction-market analyst. Compare the breaking news against the exact "
        "UMA resolution rules. Output ONLY valid JSON: "
        '{"likelihood_ratio": float_between_0.5_and_2.0, "confidence": float_0_to_1, "reason": "short summary"} '
        "where 1.0 = neutral noise, >1.15 = bullish YES catalyst, <0.85 = bearish NO catalyst."
    )
    user_prompt = f"Market: {market_question}\nRules: {resolution_rules}\nBreaking News: {breaking_news}"
    resp = llm_client.chat.completions.create(
        model=os.environ.get("LLM_MODEL", "deepseek-chat"),  # 或 gpt-4o-mini / qwen-plus / gemma4:31b
        messages=[
            {"role": "system", "content": system_prompt},
            {"role": "user", "content": user_prompt},
        ],
        response_format={"type": "json_object"},
        temperature=0.1,
    )
    return json.loads(resp.choices[0].message.content)

def bayesian_update_prob(prior_mkt_prob: float, whale_net_flow_usd: float, llm_likelihood_ratio: float) -> float:
    """融合盘口先验概率、Polygon 巨鲸净流入与 AI 催化剂似然比,输出校准后真实胜率 p*"""
    p0 = max(0.01, min(0.99, prior_mkt_prob))
    log_odds = math.log(p0 / (1.0 - p0))
    whale_shift = max(-0.45, min(0.45, whale_net_flow_usd / 150000.0))
    llm_shift = math.log(max(0.5, min(2.0, llm_likelihood_ratio)))
    post_odds = math.exp(log_odds + whale_shift + llm_shift)
    return round(post_odds / (1.0 + post_odds), 4)

# 2. 实战串联:调用大模型 -> 贝叶斯校准 p* -> 计算半凯利最优仓位
p_mkt = 0.35
ai_res = get_llm_catalyst_likelihood(
    market_question="Will the Fed cut rates by 25 bps at the next FOMC meeting?",
    resolution_rules="Resolves YES if official FOMC statement lowers target federal funds rate.",
    breaking_news="US Core CPI prints 0.1% below consensus; two Fed governors signal dovish shift.",
)
lr = float(ai_res.get("likelihood_ratio", 1.0))
p_star = bayesian_update_prob(prior_mkt_prob=p_mkt, whale_net_flow_usd=85000, llm_likelihood_ratio=lr)
half_kelly = max(0.0, 0.5 * ((p_star - p_mkt) / (1.0 - p_mkt)))
print(f"[AI 诊断] 似然比={lr:.2f} ({ai_res.get('reason')}) -> 校准胜率 p*={p_star:.1%} | 建议半凯利仓位={half_kelly:.1%}")

Line-by-Line Plain-English Code & Command Breakdown

Code / Command Line Plain-English Explanation (What Does This Do?)
pip install openai requests
Installs the standard OpenAI Python SDK (compatible with DeepSeek, OpenAI, OpenRouter, and local Ollama via base_urlคัดลอก).
llm_client = OpenAI(api_key=..., base_url=...)
Initializes the LLM API client using your LLM_API_KEYคัดลอก and endpoint URL (https://api.deepseek.com/v1คัดลอก, https://api.openai.com/v1คัดลอก, or http://127.0.0.1:11434/v1คัดลอก).
response_format={"type": "json_object"}, temperature=0.1
Forces the LLM to return deterministic, machine-parseable JSON containing likelihood_ratioคัดลอก rather than unstructured prose.
log_odds = math.log(p0 / (1.0 - p0))
Converts current Polymarket price (e.g., 0.35) into prior log-odds.
whale_shift = ...
Adds bounded positive weight when >75%-win-rate Polygon whales accumulate shares.
llm_shift = ...
Incorporates the LLM API's news catalyst likelihood ratio (clamped to 0.5–2.0) into posterior odds.
half_kelly = max(0.0, 0.5 * ((p_star - p_mkt) / (1.0 - p_mkt)))
Computes the exact Half-Kelly position fraction.

[!] Top 3 Beginner Pitfalls & Troubleshooting Guide

✕ Pitfall 1: Asking an LLM to Guess Raw Probabilities Without Market Priors or JSON Schema

Never ask for raw percentages in free text. Always use response_format={'type': 'json_object'}คัดลอก to extract a bounded likelihood ratio (0.5–2.0) and update the market prior via Bayes' rule.

✕ Pitfall 2: Leaving LLM temperatureคัดลอก at Default 1.0

Always set temperature=0.1คัดลอก (or 0.0คัดลอก) so your quantitative signal pipeline is deterministic and reproducible.

✕ Pitfall 3: Betting Full Kelly Instead of Half-Kelly

Always divide Kelly by 2 and cap single-event exposure at 15%.

Step 1: Obtain an LLM API Key & Install the Python SDK (pip install openaiคัดลอก)

Create an API key on DeepSeek (platform.deepseek.comคัดลอก), OpenAI (platform.openai.comคัดลอก), OpenRouter, or run a free local model via Ollama (http://127.0.0.1:11434/v1คัดลอก). Run pip install openai requestsคัดลอก on your VPS and export LLM_API_KEYคัดลอก and LLM_BASE_URLคัดลอก in your .envคัดลอก file.

Step 2: Enforce Structured JSON Output (response_format={'type': 'json_object'}คัดลอก)

Trading bots cannot parse free-form essays. Set temperature=0.1คัดลอก and response_format={'type': 'json_object'}คัดลอก so the LLM strictly returns {"likelihood_ratio": 1.35, "confidence": 0.88, "reason": "..."}คัดลอก bounded between 0.50คัดลอก and 2.00คัดลอก.

Step 3: Combine Market Prior + LLM Likelihood Ratio + Whale Flow via Bayes' Rule

Anchor on the live Polymarket mid-price (p_mktคัดลอก) as your prior log-odds, then add math.log(likelihood_ratio)คัดลอก from the LLM and the 4-hour Polygon smart-money net inflow (whale_net_flow_usdคัดลอก) to compute calibrated true probability p*คัดลอก.

Step 4: Filter for p* - p_mkt >= +4%คัดลอก Edge & Size with Half-Kelly

Only execute when your calibrated edge clears +4%คัดลอก, apply 0.5 * (p* - p_mkt) / (1 - p_mkt)คัดลอก with a hard 15% cap, and pass the share count directly to py-clob-clientคัดลอก to post a 0%-fee limit order.

QUANT HEADLINE DIRECTORY · GRADED BY READING LEVEL (L1 -> L4) & READING TIME

Headline Quant Guides Directory (With Reading Level, Time & Code Stack)

Start from L1 Beginner Essentials and progress to L4 Institutional Tick Backtesting. Every guide includes reading difficulty, estimated reading time, and production-ready code:

L1 新手 L2 进阶 L3 硬核 L4 极客
HEADLINE PICK #01 L1 Beginner Essential
8 min read 2026-11-01
$1,000 USDC 98.5¢→$1 +12%/mo

Beginner $1,000 Quant Starter Combo Deep-Dive: How Much Can You Earn Monthly Running Polymarket Penny Clipper & LP Bots?

Complete quantitative breakdown for first-time algorithmic traders starting with $1,000 USDC: ranking all 4 Polymarket open-source bot strategies by risk-adjusted edge, modeling 3 realistic monthly profit tiers ($60–$180/mo or 6%–18% monthly ROI) using 5×$200 position splitting, and enforcing the 3 iron survival rules.

portfolio_1000u_penny_lp_combo.py Read Full Deployment & Backtest Guide →
HEADLINE PICK #02 L1 Beginner Comparison
7 min read 2026-11-01
PIONEX AI 0-Code Cloud VS POLY VPS 98.5¢ Sniper

Pionex Cloud AI Bots vs. Self-Hosted Polymarket Bots (CloddsBot / Grok Desk): 6 Key Differences & Dual-Engine Allocation Guide

Both are called 'quant trading bots,' yet Pionex's 16 built-in cloud bots and self-hosted open-source Polymarket bots (`CloddsBot`, `polymarket_lp_tool`, `Grok 4-Step Desk`) operate on completely different market mechanics. Pionex harvests crypto volatility and perpetual funding rates with zero code and massive liquidity capacity, while self-hosted Polymarket bots snipe $1.00 deterministic event settlement discounts and Daily LP Rewards with zero correlation to Bitcoin price swings.

dual_engine_portfolio_allocator.py Read Full Deployment & Backtest Guide →
HEADLINE PICK #03 L1 Zero-Code Starter
6 min read 2026-10-30
92% AI GRID + 8% POLY HEDGE

Pionex AI Quantitative Trading Complete Guide: 16 Free Built-In Grid Bots, Funding-Rate Arbitrage & Polymarket Delta Hedging

Don't want to maintain a Linux VPS? Master Pionex's 16 free built-in AI trading bots (PionexGPT strategy generator, AI Infinity Grid, Spot-Futures Funding Rate Arbitrage, and 0.05% maker/taker fees) and learn how to pair Pionex BTC/ETH grids with Polymarket event tail-hedges.

pionex_grid_polymarket_hedge_calc.py Read Full Deployment & Backtest Guide →
HEADLINE PICK #04 L2 Intermediate Setup
10 min read 2026-11-01
119 SKILLS CLIPPER 98¢ LP REWARDS KALSHI ARB

CloddsBot & Polymarket LP Bot Complete Guide: Deploy 119-Skill AI Arbitrage, Penny Clipper & Daily Liquidity Rewards Bots

Why pay $5,000+ for black-box bots when the best Polymarket trading engines are MIT open-source on GitHub? Full deployment guide to `alsk1992/CloddsBot` (3.1k⭐, 119+ skills including cross-market arbitrage, Penny Clipper expiry decay, and smart-money copy trading) and `lihanyu81/polymarket_lp_tool` (passive LP market-making for daily USDC rewards).

cloddsbot_and_lp_deploy.sh Read Full Deployment & Backtest Guide →
1. SCAN (100 Leads) 2. VERIFY (90% SKIP) 3. EXECUTE 4. EXIT LADDER
#05 L2 Intermediate Desk 12 min read Updated 2026-11-01

Grok × Polymarket 4-Step Multi-Agent Trading Desk: SCAN · VERIFY · EXECUTE · EXIT Pipeline That Filters Out 90% of Bad Trades

The best agent on a quantitative trading desk has never placed a trade — its entire job is to say NO. Learn how to replace fragile single-prompt FOMO bots with an institutional 4-Agent Desk (SCAN -> VERIFY -> EXECUTE -> EXIT) for Polymarket CLOB & crypto markets: run free deterministic code filters first, invoke Grok `x_search` only on survivors, size off live cash + pool depth, and enforce 5 pre-written exit rules (`exits.py`) with full `tasks.csv` skip auditing.

Read Full Deployment & Backtest Guide →
CLOB 0% FEE MAKER
#06 L2 Intermediate SDK 10 min read Updated 2026-10-28

Polymarket CLOB Quant Guide: Deploy a 0%-Fee Maker & Whale Copy-Trading Bot with py-clob-client

Complete engineering walkthrough: derive Polygon L2 CLOB credentials, query Gamma condition token IDs, subscribe to whale fills, and place gasless 0%-fee EIP-712 limit orders.

Read Full Deployment & Backtest Guide →
VPS DOCKER NO-WD KILL-SW
#07 L2 Security & Risk 9 min read Updated 2026-10-27

Quant VPS Security, API IP Whitelisting & Hard Drawdown Kill-Switch Engineering Guide

Production security checklist for quant traders: low-latency VPS selection, exchange API IP whitelisting, withdrawal-disabled keys, and automated 5% daily drawdown kill-switches.

Read Full Deployment & Backtest Guide →
0.5x KELLY +EV > 4% LLM Calibrated
#08 L3 Pro Quant Dev 12 min read Updated 2026-10-26

AI LLM Probability Calibration + Half-Kelly Sizing: Step-by-Step DeepSeek / OpenAI / Ollama API Integration for +EV Orders

Complete step-by-step guide to connecting DeepSeek, OpenAI GPT-4o, or local Ollama LLMs via Python to parse breaking news into structured Bayesian likelihood ratios and Half-Kelly position sizes.

Read Full Deployment & Backtest Guide →
FreqAI 44.5k★
#09 L3 Pro Backtesting 14 min read Updated 2026-10-25

Freqtrade + FreqAI Docker Tutorial: Connect OKX / Binance, Download Historical Data & Audit Lookahead Bias

Step-by-step guide to deploying Freqtrade via Docker Compose, downloading multi-year OKX and Binance OHLCV data, running realistic fee-adjusted backtests, and running `lookahead-analysis`.

Read Full Deployment & Backtest Guide →
POLY CLOB YES ARB OKX/BN PERP 1X
#10 L3 Pro Market-Making 15 min read Updated 2026-10-24

Hummingbot Market Making & Delta-Hedging Guide: Arbitraging Polymarket Odds vs. OKX / Binance Perps

How institutional desks combine Hummingbot V2 market-making controllers on OKX/Binance with Polymarket event contracts to construct delta-neutral macro volatility hedges.

Read Full Deployment & Backtest Guide →
RUST L2 TICK REPLAY
#11 L4 Institutional Tick 18 min read Updated 2026-10-23

NautilusTrader L2 Orderbook Backtesting Guide: Eliminating Slippage Illusions & Queue-Position Bias

How to run high-fidelity L2 orderbook tick backtests in NautilusTrader with realistic queue-position fills, latency modeling, and Walk-Forward validation.

Read Full Deployment & Backtest Guide →
คำค้นหายอดนิยมในไทย: Polymarket คืออะไร, วิธีเทรด, เรดาร์วาฬ & วิธีฝาก USDC

Polymarket คืออะไร? คู่มือเทรดตลาดคาดการณ์ระดับโลก, ตามรอยวาฬ On-Chain และวิธีฝาก USDC สำหรับเทรดเดอร์ไทย

คู่มือใช้งาน Polymarket ฉบับภาษาไทย, อัตราต่อรอง CLOB แบบเรียลไทม์, การคำนวณ Half-Kelly และการโอน USDC ผ่านเครือข่าย Polygon

ในกลุ่มนักเทรดคริปโตและนักลงทุนชาวไทย คำค้นหาอย่าง «Polymarket คืออะไร», «วิธีเล่น Polymarket» และ «ตลาดคาดการณ์ Web3» กำลังได้รับความนิยมอย่างสูง Polymarket คือแพลตฟอร์มตลาดคาดการณ์แบบกระจายศูนย์ (Decentralized Prediction Market) ที่ใหญ่ที่สุดในโลกบนเครือข่าย Polygon ซึ่งผู้ใช้งานสามารถซื้อขายหุ้นความน่าจะเป็น ('ใช่' หรือ 'ไม่ใช่') ในราคาตั้งแต่ 1¢ ถึง 99¢ USDC สำหรับเหตุการณ์สำคัญทั่วโลก เช่น การปรับลดอัตราดอกเบี้ยของธนาคารกลางสหรัฐฯ (Fed), เป้าหมายราคา Bitcoin ทะลุ $150,000, การเลือกตั้งระดับโลก ไปจนถึงศึกฟุตบอลพรีเมียร์ลีกและยูฟ่าแชมเปียนส์ลีก

ผ่านเทอร์มินัล Poly Day ประเทศไทย (p.day/th/) คุณสามารถตรวจสอบความลึกของสมุดคำสั่งซื้อขาย CLOB แบบเรียลไทม์, ติดตามสัญญาณกระเป๋าวาฬ Smart-Money ที่ชนะมากกว่า 80%, คำนวณขนาดไม้ลงทุนด้วยสูตร Half-Kelly และเรียนรู้วิธีโอนเหรียญ USDC ผ่านเครือข่าย Polygon จาก Binance หรือ OKX ด้วยค่าธรรมเนียมเกือบเป็นศูนย์

P.DAY
Poly Day · ทำนายผลวันนี้ (p.day)
★ ติดตามเม็ดเงินจริง · เรดาร์วาฬ · สูตร Kelly