trading-manifold
Place bets on Manifold Markets using their REST API
What this skill does
# Manifold Markets Trading Skill
Real, working methods to bet on Manifold Markets using Mana (play money that can be donated to charity).
## Setup
Get your API key from: https://manifold.markets/profile (API key section)
```python
import os
import requests
API_URL = "https://api.manifold.markets/v0"
API_KEY = os.getenv("MANIFOLD_API_KEY")
def headers():
return {
"Authorization": f"Key {API_KEY}",
"Content-Type": "application/json"
}
```
## Search Markets
```python
def search_markets(query: str, limit: int = 10):
"""Search for markets"""
r = requests.get(f"{API_URL}/search-markets", params={
"term": query,
"limit": limit,
"filter": "open",
"sort": "liquidity"
})
r.raise_for_status()
markets = r.json()
for m in markets[:5]:
prob = m.get("probability", 0.5)
print(f"\nMarket: {m['question']}")
print(f"ID: {m['id']}")
print(f"Probability: {prob*100:.1f}%")
print(f"URL: {m.get('url', '')}")
return markets
markets = search_markets("AI")
```
## Get Market by ID or Slug
```python
def get_market(id_or_slug: str):
"""Get market details"""
# Try by ID first
r = requests.get(f"{API_URL}/market/{id_or_slug}")
if r.status_code == 404:
# Try by slug
r = requests.get(f"{API_URL}/slug/{id_or_slug}")
r.raise_for_status()
return r.json()
market = get_market("will-gpt5-be-released-before-2025")
print(f"Question: {market['question']}")
print(f"Probability: {market.get('probability', 0.5)*100:.1f}%")
```
## Place a Bet
```python
def place_bet(
market_id: str,
amount: int, # Mana amount to bet
outcome: str = "YES", # "YES" or "NO"
limit_prob: float = None # Optional limit order probability
):
"""
Place a bet on Manifold
Args:
market_id: The market ID (not slug!)
amount: Amount of Mana to bet
outcome: "YES" or "NO"
limit_prob: Optional - if set, creates a limit order at this probability
"""
payload = {
"contractId": market_id,
"amount": amount,
"outcome": outcome
}
if limit_prob is not None:
payload["limitProb"] = limit_prob
r = requests.post(f"{API_URL}/bet", headers=headers(), json=payload)
r.raise_for_status()
result = r.json()
print(f"Bet placed!")
print(f"Shares: {result.get('shares', 0):.2f}")
print(f"Probability after: {result.get('probAfter', 0)*100:.1f}%")
return result
# Market bet - buys at current price
result = place_bet(
market_id="abc123",
amount=100, # 100 Mana
outcome="YES"
)
# Limit order - only fills at 40% or below
result = place_bet(
market_id="abc123",
amount=100,
outcome="YES",
limit_prob=0.40
)
```
## Cancel Bet (Limit Orders Only)
```python
def cancel_bet(bet_id: str):
"""Cancel a limit order"""
r = requests.post(f"{API_URL}/bet/cancel/{bet_id}", headers=headers())
r.raise_for_status()
return True
cancel_bet("bet123")
```
## Sell Shares
```python
def sell_shares(
market_id: str,
outcome: str = "YES",
shares: float = None # None = sell all
):
"""
Sell shares in a market
Args:
market_id: The market ID
outcome: "YES" or "NO" - which shares to sell
shares: Number of shares to sell (None = all)
"""
payload = {
"contractId": market_id,
"outcome": outcome
}
if shares is not None:
payload["shares"] = shares
r = requests.post(f"{API_URL}/market/{market_id}/sell", headers=headers(), json=payload)
r.raise_for_status()
return r.json()
# Sell all YES shares
sell_shares("abc123", "YES")
# Sell specific amount
sell_shares("abc123", "YES", shares=50.0)
```
## Get Your Bets
```python
def get_my_bets(market_id: str = None):
"""Get your bets"""
params = {}
if market_id:
params["contractId"] = market_id
r = requests.get(f"{API_URL}/bets", headers=headers(), params=params)
r.raise_for_status()
bets = r.json()
for b in bets[:10]:
print(f"Bet: {b['outcome']} {b['amount']}M @ {b.get('probBefore', 0)*100:.0f}%")
return bets
bets = get_my_bets()
```
## Get Your Positions
```python
def get_positions():
"""Get current positions across all markets"""
# Get user info first
r = requests.get(f"{API_URL}/me", headers=headers())
r.raise_for_status()
user = r.json()
# Get bets to calculate positions
r = requests.get(f"{API_URL}/bets", headers=headers(), params={"limit": 1000})
bets = r.json()
# Aggregate by market
positions = {}
for bet in bets:
mid = bet["contractId"]
if mid not in positions:
positions[mid] = {"yes": 0, "no": 0, "invested": 0}
if bet["outcome"] == "YES":
positions[mid]["yes"] += bet.get("shares", 0)
else:
positions[mid]["no"] += bet.get("shares", 0)
if not bet.get("isSold", False):
positions[mid]["invested"] += bet["amount"]
return positions, user.get("balance", 0)
positions, balance = get_positions()
print(f"Balance: {balance} Mana")
for mid, pos in positions.items():
if pos["yes"] > 0 or pos["no"] > 0:
print(f"Market {mid}: YES={pos['yes']:.1f}, NO={pos['no']:.1f}")
```
## Get Balance
```python
def get_balance():
"""Get your Mana balance"""
r = requests.get(f"{API_URL}/me", headers=headers())
r.raise_for_status()
user = r.json()
return user.get("balance", 0)
balance = get_balance()
print(f"Balance: {balance} Mana")
```
## Complete Trading Bot Example
```python
#!/usr/bin/env python3
"""
Manifold arbitrage bot - finds mispriced markets
"""
import os
import time
import requests
API_URL = "https://api.manifold.markets/v0"
API_KEY = os.getenv("MANIFOLD_API_KEY")
def h():
return {"Authorization": f"Key {API_KEY}", "Content-Type": "application/json"}
def search(query):
r = requests.get(f"{API_URL}/search-markets",
params={"term": query, "limit": 20, "filter": "open"})
return r.json()
def bet(market_id, amount, outcome, limit_prob=None):
payload = {"contractId": market_id, "amount": amount, "outcome": outcome}
if limit_prob:
payload["limitProb"] = limit_prob
r = requests.post(f"{API_URL}/bet", headers=h(), json=payload)
return r.json()
def get_balance():
r = requests.get(f"{API_URL}/me", headers=h())
return r.json().get("balance", 0)
# Strategy: Buy extreme probabilities (likely to revert)
MIN_LIQUIDITY = 1000 # Only trade liquid markets
while True:
try:
balance = get_balance()
print(f"\nBalance: {balance} Mana")
# Search trending markets
markets = search("2024")
for m in markets:
prob = m.get("probability", 0.5)
liquidity = m.get("totalLiquidity", 0)
if liquidity < MIN_LIQUIDITY:
continue
# Buy YES on very low probability (< 10%)
if prob < 0.10:
print(f"LOW: {m['question'][:50]} at {prob*100:.1f}%")
if balance > 50:
bet(m["id"], 50, "YES", limit_prob=0.15)
# Buy NO on very high probability (> 90%)
elif prob > 0.90:
print(f"HIGH: {m['question'][:50]} at {prob*100:.1f}%")
if balance > 50:
bet(m["id"], 50, "NO", limit_prob=0.85)
time.sleep(300) # Check every 5 minutes
except Exception as e:
print(f"Error: {e}")
time.sleep(60)
```
## Multiple Choice Markets
```python
def bet_multiple_choice(market_id: str, answer_id: str, amount: int):
"""Bet on a multiple choice market"""
payload = {
"contractId": market_id,
"amount": amount,
"answerId": answer_id
}
r = requests.post(f"{API_URL}/bet", headers=headers(), json=payload)
r.raise_for_status()
return r.json()
# GRelated in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.