Explore/Trade Your Thesis
Ambush / Trade Your Thesis

Know what moves a market? Hear the moment it happens.

What it does

You already know which news moves your market. Ambush watches for it.

Describe the event you’re waiting for as a stream. When it happens, the headline reaches your phone, your Slack or your trading bot, often before the price has moved.

From insight to alert

Listen for your trigger. Take the trade.

These are real Ambush alerts. Each trader already knew what the news would mean; the stream only had to catch it the moment it broke. Where a bot needs more than the headline, post-processing pulls out the ticker to trade.

Your edge. Our speed.

Ambush finds the moment.
The insight is yours.

A stream doesn’t know whether a headline will move a price. It knows when the event you described happens, and it tells you first.

01

Know the second-order effect

The best streams watch for news that doesn’t name your market: a pipeline deal for oil, a financing filing for a stock, a data release for crypto. Fewer people connect those dots quickly.

02

Decide the trade in advance

Write down what you’ll do when the alert arrives, and how you’ll know you were wrong. Speed only helps if the decision is already made.

03

Let your bot act, within limits

Send alerts to a webhook with structured fields and let your own code place the order, with your size, slippage and loss limits.

Run it yourself

From an idea to an order.

You’ll need an Ambush API key and an HTTPS endpoint for deliveries. You can also write the stream in the app and attach a destination there.

1

Write your thesis as a stream

The prompt describes the headlines you want, nothing more: it decides what matches and doesn’t write anything. Post-processing runs on each match and returns the fields you define, such as the ticker to trade.

curl https://api.ambush.ai/api/v1/feeds \
  -H "Authorization: Bearer $AMBUSH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Automakers raising or cutting delivery guidance.",
    "post_processing": {
      "prompt": "Return the stock ticker and the direction.",
      "output_schema": {
        "type": "object",
        "properties": {
          "ticker": { "type": "string" },
          "guidance": {
            "type": "string",
            "enum": ["raised", "cut"]
          }
        },
        "required": ["ticker", "guidance"]
      }
    }
  }'
2

Send its alerts to your bot

Create a webhook destination with a signing secret, then route the stream to it so each alert arrives the moment it matches. Your bot needs the same AMBUSH_WHSEC in its environment to check each delivery. Ambush signs every delivery and keeps a log you can replay from. An instant alert gets one delivery attempt, so keep your bot running. You can add Slack or email too, so you see what your bot sees.

export AMBUSH_WHSEC="whsec_$(openssl rand -base64 32)"

curl https://api.ambush.ai/api/v1/channels \
  -H "Authorization: Bearer $AMBUSH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "webhook",
    "url": "https://your.app/hooks/ambush",
    "secret": "'"$AMBUSH_WHSEC"'"
  }'
# The response's id is your CHANNEL_ID.

curl https://api.ambush.ai/api/v1/feeds/$FEED_ID/channels \
  -H "Authorization: Bearer $AMBUSH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "emission_channel_id": "'"$CHANNEL_ID"'",
    "minimum_delivery_interval_minutes": 0
  }'

# Once your bot from the next step is running, verify the webhook:
curl -X POST https://api.ambush.ai/api/v1/channels/$CHANNEL_ID/test \
  -H "Authorization: Bearer $AMBUSH_API_KEY"
3

Trade on the alert

Reject anything without a valid signature before you read it. The verifier in the developer guide checks the signature and timestamp against the AMBUSH_WHSEC secret from the last step. Then read the fields you asked for and place the order you planned, with your own limits in code: size, slippage, and a check that the price hasn’t already moved.

import { verifyStandardWebhook } from "./standard-webhooks";

app.post("/hooks/ambush", async (c) => {
  const rawBody = await c.req.text();
  const verified = verifyStandardWebhook({
    rawBody,
    headers: c.req.raw.headers,
    secret: process.env.AMBUSH_WHSEC
  });
  if (!verified.ok) return c.body(null, 401);

  const event = JSON.parse(rawBody);
  // Each alert arrives on its own. Answer 2xx to anything else,
  // such as the test event that verifies the webhook.
  if (event.type === "feed.news_item.emitted") {
    const { ticker, guidance } =
      event.data.post_processed_output.content;
    await placeOrder({
      ticker,
      side: guidance === "raised" ? "buy" : "sell",
      maxSize: 1,
      maxSlippage: 0.005
    });
  }
  return c.body(null, 200);
});