The most powerful way to trade prediction markets.

The most powerful way to trade prediction markets.

Dawn translates your ideas into executable code, performing

how you want, when you want, on any source of data on the internet.

Dawn translates your ideas into executable code, performing how you want, when you want, on any source of data on the internet.

You describe.

We execute.

Dawn is an infinitely custom AI trading copilot that actually works.


Purpose-built for prediction markets, Dawn translates your ideas into executable code that performs trades on your behalf 24/7.

You describe.

We execute.

Dawn is an infinitely custom AI trading copilot that actually works.


Purpose-built for prediction markets, Dawn translates your ideas into executable code that performs trades on your behalf 24/7.

You describe.

We execute.

Dawn is an infinitely custom AI trading copilot that actually works.


Purpose-built for prediction markets, Dawn translates your ideas into executable code that performs trades on your behalf 24/7.

Snipe Any Market

Snipe Any Market

We track every headline, feed, and signal in real time — and act before anyone else can

We track every headline, feed, and signal in real time — and act before anyone else can

The

The

way to trade.

way to trade.

Step 1

Describe Your Strategy

Tell Dawn what you want to do in plain English. No coding experience required - just describe your trading idea.

Describe Your Strategy

Describe Your Strategy

Build prediction market strategies in minutes with a single prompt.

Another 7.0 or above earthquake by October 31?

Another 7.0 or above earthquake by October 31?

Another 7.0 or above earthquake by October 31?

49% Chance

Step 2

Generate Code

Dawn converts your strategy into production-ready code, handling the technical complexity.

src/strategy.py
src/test_strategy.py
Edit & Save
  • class MyStrategy(Strategy):
    @cron(interval="1m")
    def monitor_usgs_and_buy_yes_on_7_plus_earthquake(self) -> None:
    """Execution rule running every 1 minute.
    Steps:
    1) Pull last-hour earthquakes from USGS feed.
    2) If any magnitude >= 7.0 exists, evaluate capital and price constraints.
    3) If price <= 0.95 and simulated slippage <= 5%, execute buy with all available capital.
    """
    # 1) Fetch USGS last-hour earthquakes (live data)
    usgs_url: str = "https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/all_hour.geojson"
    with urlopen(usgs_url) as resp:
    if resp.status != 200:
    raise RuntimeError(f"USGS feed HTTP status {resp.status}")
    data_bytes = resp.read()
    feed = json.loads(data_bytes)
    # Validate feed structure
    if not isinstance(feed, dict):
    raise ValueError("USGS feed is not a JSON object")
    if "features" not in feed:
    raise KeyError("USGS feed missing 'features'")
    features = feed["features"]
    if not isinstance(features, list):
    raise TypeError("USGS 'features' must be a list")
    # 2) Check for any earthquake with magnitude >= 7.0
    mags: list[float] = []
    for feature in features:
    if not isinstance(feature, dict):
    raise TypeError("USGS feature must be a dict")
    if "properties" not in feature:
    raise KeyError("USGS feature missing 'properties'")
    props = feature["properties"]
    if not isinstance(props, dict):
    raise TypeError("USGS 'properties' must be a dict")
    # USGS may use None for mag for some entries; enforce explicit validation
    if "mag" not in props:
    raise KeyError("USGS properties missing 'mag'")
    mag_val = props["mag"]
    if mag_val is None:
    continue
    if not isinstance(mag_val, (int, float)):
    raise TypeError("USGS 'mag' must be number or None")
    mags.append(float(mag_val))
    has_major: bool = any(m >= 7.0 for m in mags)
    if not has_major:
    return
    # 3a) Read portfolio to determine existing exposure for this market
    portfolio = read_portfolio()
    if "wallet" not in portfolio:
    raise KeyError("Portfolio missing 'wallet'")
    wallet = portfolio["wallet"]
    if "positions" not in wallet:
    raise KeyError("Wallet missing 'positions'")
    positions = wallet["positions"]
    if not isinstance(positions, list):
    raise TypeError("Wallet 'positions' must be a list")
    invested_cost_basis: Decimal = Decimal("0")
    for pos in positions:
    if not isinstance(pos, dict):
    raise TypeError("Position must be a dict")
    if pos.get("market_id") == market_id:
    if "cost_basis" not in pos:
    raise KeyError("Position missing 'cost_basis'")
    invested_cost_basis += Decimal(str(pos["cost_basis"]))
    print(f" Invested cost basis for market {market_id}: {invested_cost_basis}")
    available_capital: Decimal = initial_allocation - invested_cost_basis
    print(f" Calculated available_capital = initial_allocation - invested_cost_basis = {available_capital}")
    if available_capital <= Decimal("0"):
    print(" No available capital remaining. No action taken.")
    print("[Rule Exit] monitor_usgs_and_buy_yes_on_7_plus_earthquake")
    return
    # 3b) Get current YES token price and validate price constraints
    print(f" Fetching Polymarket prices for market_id={market_id}")
    prices_resp = get_polymarket_prices(market_id)
    if "prices" not in prices_resp:
    raise KeyError("Prices response missing 'prices'")
    prices = prices_resp["prices"]
    if not isinstance(prices, dict):
    raise TypeError("'prices' must be a dict")
    if yes_token_id not in prices:
    raise KeyError("YES token id not found in prices response")
    token_prices = prices[yes_token_id]
    if not isinstance(token_prices, dict):
    raise TypeError("Token price entry must be a dict")
    if "BUY" not in token_prices:
    raise KeyError("Token prices missing 'BUY'")
    current_buy_price: Decimal = Decimal(str(token_prices["BUY"]))
    print(f" Current YES BUY price: {current_buy_price}")
    print(f" Price cap check => {current_buy_price} <= {price_cap} ?")
    if current_buy_price > price_cap:
    print(" Price exceeds cap ($0.95). No action taken.")
    print("[Rule Exit] monitor_usgs_and_buy_yes_on_7_plus_earthquake")
    return
    # 3c) Pre-simulate to assess slippage before executing live
    print(f" Pre-simulating buy for slippage check. Amount={available_capital}")
    sim_result = polymarket_buy_token(yes_token_id, available_capital, type="SIM")
    if "result" not in sim_result:
    raise KeyError("SIM trade response missing 'result'")
    sim_details = sim_result["result"]
    if not isinstance(sim_details, dict):
    raise TypeError("SIM result must be a dict")
    if "executed_price" not in sim_details or "executed_amount" not in sim_details:
    raise KeyError("SIM result missing executed_price or executed_amount")
    sim_executed_price: Decimal = Decimal(str(sim_details["executed_price"]))
    sim_executed_amount: Decimal = Decimal(str(sim_details["executed_amount"]))
    print(f" SIM executed_price={sim_executed_price}, executed_amount={sim_executed_amount}")
    max_allowed_price = min(price_cap, (current_buy_price * max_slippage_multiplier))
    print(
    " Slippage check => executed_price <= min(price_cap, current_price*1.05) => "
    f"{sim_executed_price} <= {max_allowed_price} ?"
    )
    if sim_executed_price > max_allowed_price:
    print(" Slippage exceeds 5% or price cap in SIM. No action taken.")
    print("[Rule Exit] monitor_usgs_and_buy_yes_on_7_plus_earthquake")
    return
    # 3d) Execute live trade with EXEC
    print(f" Executing live buy (EXEC). Amount={available_capital}")
    exec_result = polymarket_buy_token(yes_token_id, available_capital, type="EXEC")
    if "result" not in exec_result:
    raise KeyError("EXEC trade response missing 'result'")
    exec_details = exec_result["result"]
    if not isinstance(exec_details, dict):
    raise TypeError("EXEC result must be a dict")







src/strategy.py
src/test_strategy.py
Edit & Save
  • class MyStrategy(Strategy):
    @cron(interval="1m")
    def monitor_usgs_and_buy_yes_on_7_plus_earthquake(self) -> None:
    """Execution rule running every 1 minute.
    Steps:
    1) Pull last-hour earthquakes from USGS feed.
    2) If any magnitude >= 7.0 exists, evaluate capital and price constraints.
    3) If price <= 0.95 and simulated slippage <= 5%, execute buy with all available capital.
    """
    # 1) Fetch USGS last-hour earthquakes (live data)
    usgs_url: str = "https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/all_hour.geojson"
    with urlopen(usgs_url) as resp:
    if resp.status != 200:
    raise RuntimeError(f"USGS feed HTTP status {resp.status}")
    data_bytes = resp.read()
    feed = json.loads(data_bytes)
    # Validate feed structure
    if not isinstance(feed, dict):
    raise ValueError("USGS feed is not a JSON object")
    if "features" not in feed:
    raise KeyError("USGS feed missing 'features'")
    features = feed["features"]
    if not isinstance(features, list):
    raise TypeError("USGS 'features' must be a list")
    # 2) Check for any earthquake with magnitude >= 7.0
    mags: list[float] = []
    for feature in features:
    if not isinstance(feature, dict):
    raise TypeError("USGS feature must be a dict")
    if "properties" not in feature:
    raise KeyError("USGS feature missing 'properties'")
    props = feature["properties"]
    if not isinstance(props, dict):
    raise TypeError("USGS 'properties' must be a dict")
    # USGS may use None for mag for some entries; enforce explicit validation
    if "mag" not in props:
    raise KeyError("USGS properties missing 'mag'")
    mag_val = props["mag"]
    if mag_val is None:
    continue
    if not isinstance(mag_val, (int, float)):
    raise TypeError("USGS 'mag' must be number or None")
    mags.append(float(mag_val))
    has_major: bool = any(m >= 7.0 for m in mags)
    if not has_major:
    return
    # 3a) Read portfolio to determine existing exposure for this market
    portfolio = read_portfolio()
    if "wallet" not in portfolio:
    raise KeyError("Portfolio missing 'wallet'")
    wallet = portfolio["wallet"]
    if "positions" not in wallet:
    raise KeyError("Wallet missing 'positions'")
    positions = wallet["positions"]
    if not isinstance(positions, list):
    raise TypeError("Wallet 'positions' must be a list")
    invested_cost_basis: Decimal = Decimal("0")
    for pos in positions:
    if not isinstance(pos, dict):
    raise TypeError("Position must be a dict")
    if pos.get("market_id") == market_id:
    if "cost_basis" not in pos:
    raise KeyError("Position missing 'cost_basis'")
    invested_cost_basis += Decimal(str(pos["cost_basis"]))
    print(f" Invested cost basis for market {market_id}: {invested_cost_basis}")
    available_capital: Decimal = initial_allocation - invested_cost_basis
    print(f" Calculated available_capital = initial_allocation - invested_cost_basis = {available_capital}")
    if available_capital <= Decimal("0"):
    print(" No available capital remaining. No action taken.")
    print("[Rule Exit] monitor_usgs_and_buy_yes_on_7_plus_earthquake")
    return
    # 3b) Get current YES token price and validate price constraints
    print(f" Fetching Polymarket prices for market_id={market_id}")
    prices_resp = get_polymarket_prices(market_id)
    if "prices" not in prices_resp:
    raise KeyError("Prices response missing 'prices'")
    prices = prices_resp["prices"]
    if not isinstance(prices, dict):
    raise TypeError("'prices' must be a dict")
    if yes_token_id not in prices:
    raise KeyError("YES token id not found in prices response")
    token_prices = prices[yes_token_id]
    if not isinstance(token_prices, dict):
    raise TypeError("Token price entry must be a dict")
    if "BUY" not in token_prices:
    raise KeyError("Token prices missing 'BUY'")
    current_buy_price: Decimal = Decimal(str(token_prices["BUY"]))
    print(f" Current YES BUY price: {current_buy_price}")
    print(f" Price cap check => {current_buy_price} <= {price_cap} ?")
    if current_buy_price > price_cap:
    print(" Price exceeds cap ($0.95). No action taken.")
    print("[Rule Exit] monitor_usgs_and_buy_yes_on_7_plus_earthquake")
    return
    # 3c) Pre-simulate to assess slippage before executing live
    print(f" Pre-simulating buy for slippage check. Amount={available_capital}")
    sim_result = polymarket_buy_token(yes_token_id, available_capital, type="SIM")
    if "result" not in sim_result:
    raise KeyError("SIM trade response missing 'result'")
    sim_details = sim_result["result"]
    if not isinstance(sim_details, dict):
    raise TypeError("SIM result must be a dict")
    if "executed_price" not in sim_details or "executed_amount" not in sim_details:
    raise KeyError("SIM result missing executed_price or executed_amount")
    sim_executed_price: Decimal = Decimal(str(sim_details["executed_price"]))
    sim_executed_amount: Decimal = Decimal(str(sim_details["executed_amount"]))
    print(f" SIM executed_price={sim_executed_price}, executed_amount={sim_executed_amount}")
    max_allowed_price = min(price_cap, (current_buy_price * max_slippage_multiplier))
    print(
    " Slippage check => executed_price <= min(price_cap, current_price*1.05) => "
    f"{sim_executed_price} <= {max_allowed_price} ?"
    )
    if sim_executed_price > max_allowed_price:
    print(" Slippage exceeds 5% or price cap in SIM. No action taken.")
    print("[Rule Exit] monitor_usgs_and_buy_yes_on_7_plus_earthquake")
    return
    # 3d) Execute live trade with EXEC
    print(f" Executing live buy (EXEC). Amount={available_capital}")
    exec_result = polymarket_buy_token(yes_token_id, available_capital, type="EXEC")
    if "result" not in exec_result:
    raise KeyError("EXEC trade response missing 'result'")
    exec_details = exec_result["result"]
    if not isinstance(exec_details, dict):
    raise TypeError("EXEC result must be a dict")







src/strategy.py
src/test_strategy.py
Edit & Save
  • class MyStrategy(Strategy):
    @cron(interval="1m")
    def monitor_usgs_and_buy_yes_on_7_plus_earthquake(self) -> None:
    """Execution rule running every 1 minute.
    Steps:
    1) Pull last-hour earthquakes from USGS feed.
    2) If any magnitude >= 7.0 exists, evaluate capital and price constraints.
    3) If price <= 0.95 and simulated slippage <= 5%, execute buy with all available capital.
    """
    # 1) Fetch USGS last-hour earthquakes (live data)
    usgs_url: str = "https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/all_hour.geojson"
    with urlopen(usgs_url) as resp:
    if resp.status != 200:
    raise RuntimeError(f"USGS feed HTTP status {resp.status}")
    data_bytes = resp.read()
    feed = json.loads(data_bytes)
    # Validate feed structure
    if not isinstance(feed, dict):
    raise ValueError("USGS feed is not a JSON object")
    if "features" not in feed:
    raise KeyError("USGS feed missing 'features'")
    features = feed["features"]
    if not isinstance(features, list):
    raise TypeError("USGS 'features' must be a list")
    # 2) Check for any earthquake with magnitude >= 7.0
    mags: list[float] = []
    for feature in features:
    if not isinstance(feature, dict):
    raise TypeError("USGS feature must be a dict")
    if "properties" not in feature:
    raise KeyError("USGS feature missing 'properties'")
    props = feature["properties"]
    if not isinstance(props, dict):
    raise TypeError("USGS 'properties' must be a dict")
    # USGS may use None for mag for some entries; enforce explicit validation
    if "mag" not in props:
    raise KeyError("USGS properties missing 'mag'")
    mag_val = props["mag"]
    if mag_val is None:
    continue
    if not isinstance(mag_val, (int, float)):
    raise TypeError("USGS 'mag' must be number or None")
    mags.append(float(mag_val))
    has_major: bool = any(m >= 7.0 for m in mags)
    if not has_major:
    return
    # 3a) Read portfolio to determine existing exposure for this market
    portfolio = read_portfolio()
    if "wallet" not in portfolio:
    raise KeyError("Portfolio missing 'wallet'")
    wallet = portfolio["wallet"]
    if "positions" not in wallet:
    raise KeyError("Wallet missing 'positions'")
    positions = wallet["positions"]
    if not isinstance(positions, list):
    raise TypeError("Wallet 'positions' must be a list")
    invested_cost_basis: Decimal = Decimal("0")
    for pos in positions:
    if not isinstance(pos, dict):
    raise TypeError("Position must be a dict")
    if pos.get("market_id") == market_id:
    if "cost_basis" not in pos:
    raise KeyError("Position missing 'cost_basis'")
    invested_cost_basis += Decimal(str(pos["cost_basis"]))
    print(f" Invested cost basis for market {market_id}: {invested_cost_basis}")
    available_capital: Decimal = initial_allocation - invested_cost_basis
    print(f" Calculated available_capital = initial_allocation - invested_cost_basis = {available_capital}")
    if available_capital <= Decimal("0"):
    print(" No available capital remaining. No action taken.")
    print("[Rule Exit] monitor_usgs_and_buy_yes_on_7_plus_earthquake")
    return
    # 3b) Get current YES token price and validate price constraints
    print(f" Fetching Polymarket prices for market_id={market_id}")
    prices_resp = get_polymarket_prices(market_id)
    if "prices" not in prices_resp:
    raise KeyError("Prices response missing 'prices'")
    prices = prices_resp["prices"]
    if not isinstance(prices, dict):
    raise TypeError("'prices' must be a dict")
    if yes_token_id not in prices:
    raise KeyError("YES token id not found in prices response")
    token_prices = prices[yes_token_id]
    if not isinstance(token_prices, dict):
    raise TypeError("Token price entry must be a dict")
    if "BUY" not in token_prices:
    raise KeyError("Token prices missing 'BUY'")
    current_buy_price: Decimal = Decimal(str(token_prices["BUY"]))
    print(f" Current YES BUY price: {current_buy_price}")
    print(f" Price cap check => {current_buy_price} <= {price_cap} ?")
    if current_buy_price > price_cap:
    print(" Price exceeds cap ($0.95). No action taken.")
    print("[Rule Exit] monitor_usgs_and_buy_yes_on_7_plus_earthquake")
    return
    # 3c) Pre-simulate to assess slippage before executing live
    print(f" Pre-simulating buy for slippage check. Amount={available_capital}")
    sim_result = polymarket_buy_token(yes_token_id, available_capital, type="SIM")
    if "result" not in sim_result:
    raise KeyError("SIM trade response missing 'result'")
    sim_details = sim_result["result"]
    if not isinstance(sim_details, dict):
    raise TypeError("SIM result must be a dict")
    if "executed_price" not in sim_details or "executed_amount" not in sim_details:
    raise KeyError("SIM result missing executed_price or executed_amount")
    sim_executed_price: Decimal = Decimal(str(sim_details["executed_price"]))
    sim_executed_amount: Decimal = Decimal(str(sim_details["executed_amount"]))
    print(f" SIM executed_price={sim_executed_price}, executed_amount={sim_executed_amount}")
    max_allowed_price = min(price_cap, (current_buy_price * max_slippage_multiplier))
    print(
    " Slippage check => executed_price <= min(price_cap, current_price*1.05) => "
    f"{sim_executed_price} <= {max_allowed_price} ?"
    )
    if sim_executed_price > max_allowed_price:
    print(" Slippage exceeds 5% or price cap in SIM. No action taken.")
    print("[Rule Exit] monitor_usgs_and_buy_yes_on_7_plus_earthquake")
    return
    # 3d) Execute live trade with EXEC
    print(f" Executing live buy (EXEC). Amount={available_capital}")
    exec_result = polymarket_buy_token(yes_token_id, available_capital, type="EXEC")
    if "result" not in exec_result:
    raise KeyError("EXEC trade response missing 'result'")
    exec_details = exec_result["result"]
    if not isinstance(exec_details, dict):
    raise TypeError("EXEC result must be a dict")







Step 3

Deploy Agent

Launch your strategy with one click. Your agent trades automatically 24/7, executing your vision on our cloud infra while you sleep.

Generating

Deploying

Executing

Generating

Deploying

Executing

Generating

Deploying

Executing

0% Fees

The all-in-one terminal

at your fingertips.

The all-in-one terminal

at your fingertips.

The all-in-one terminal

at your fingertips.

Research

Research

Research

Real-time market analysis and data insights

Real-time market analysis and data insights

Real-time market analysis and data insights

Live code testing and debugging

Live code testing and debugging

Live code testing and debugging

Test strategies risk-free with paper trading

Test strategies risk-free with paper trading

Test strategies risk-free with paper trading

Get Markets

Get Prices

Simulate Order

Test Cron

Debug

Get Markets

Get Prices

Simulate Order

Test Cron

Debug

Get Markets

Get Prices

Simulate Order

Test Cron

Debug

Check Website

Buy Token

Take Profit

Check Website

Buy Token

Take Profit

Check Website

Buy Token

Take Profit

Execution

Execution

Execution

Sub-second order execution and fills

Sub-second order execution and fills

Sub-second order execution and fills

No platform fees, keep 100% of profits

No platform fees, keep 100% of profits

No platform fees, keep 100% of profits

Custom conditions and event triggers

Custom conditions and event triggers

Custom conditions and event triggers

Infrastructure

Infrastructure

Infrastructure

Seamless wallet management and security

Seamless wallet management and security

Seamless wallet management and security

Real time sports book integrations

Real time sports book integrations

Real time sports book integrations

24/7 web and market data surveillance

24/7 web and market data surveillance

24/7 web and market data surveillance

Anything you'd do yourself,

you can do better on Dawn.

Anything you'd do yourself,

you can do better on Dawn.

Anything you'd do yourself,

you can do better on Dawn.

Build Faster. Trade Smarter.

Build Faster.
Trade Smarter.

Join the 30,000+ others on the waitlist.