Explore/Kalshi Position Watch
Ambush / Kalshi Position Watch

Sell shares when news affects your prediction.

What it does

Your portfolio knows what you’re betting on. Now your news feed does too.

Connect Kalshi to Ambush. Your agent reads each position’s market rules and creates a stream for the events that could change its outcome. Relevant headlines arrive with the context your agent needs to help you respond.

Explore the code
From position to perspective

Watch what could change the outcome.

Hold a position for weeks or months without tracking every development yourself. When news materially changes its outlook, your agent connects it to your holding and the market’s rules.

Example positions 3 markets
Example market

One focused stream per market.
Built from its actual settlement rules.

Your Ambush stream

Will the government fall before year-end?

NO

You’ve held NO for weeks, expecting the coalition to survive. A key partner withdrawing support changes that outlook.

Resolution
The government leaves office before the contract’s deadline, under the conditions specified in its rules. Losing a coalition partner alone does not resolve the market.
Watch for
Coalition defections, confidence votes, resignations, and agreements that restore parliamentary support. Follow developments that threaten or preserve the government.
Leave out
Routine political commentary, unrelated elections, and polling without a concrete change in parliamentary support.
Read the stream prompt

Monitor developments that could cause the government named in this market to leave office before the specified deadline. Include coalition partners withdrawing or restoring support, scheduled and completed confidence votes, the prime minister’s resignation, and agreements securing a governing majority. Use the contract’s exact definition of leaving office. Exclude unrelated elections and routine commentary. Distinguish a threat to the coalition from a confirmed departure from office.

News arrives
Party statement · Parliamentary schedule

Coalition partner withdraws support as parliament schedules a confidence vote.

Your agent connects the dots
Against your NO position

Your position depends on the government staying in office. Losing a coalition partner puts that assumption under pressure, although a new agreement could still keep it in power.

Check next Check the vote date, parliamentary numbers, and possible replacement support. Compare the changed outlook with your holding and the current order book before deciding whether to reduce or exit.

Your agent. Your permissions.

Stay informed.
Decide how far it goes.

Ambush finds the news. The local bot adds market context. You decide what your agent can do with it.

01

Monitor your positions

On by default

Receive the headline, source, settlement rules, and an explanation of what may have changed. Keep the final decision with you. The bot makes no Kalshi order requests.

02

Let your agent act

Connect your own agent’s trading tools and explicitly enable trading handoff. Define allowed markets, spending and position limits, slippage, and approval rules. Your agent must verify fresh prices and enforce those limits before submitting an order.

See the agent contract
Run it yourself

From your account to your first alert.

Give your coding agent the setup instructions above, or follow the steps below. You’ll need Bun, a Kalshi account, an Ambush account, a model API key, and an HTTPS endpoint for deliveries.

1

Connect the accounts you want to watch

Clone the repo and add your Kalshi API key ID and private-key file path, an Ambush API key, and a model API key to your local .env. Choose your demo or production Kalshi account. Your credentials stay on your machine.

git clone https://github.com/Ambush-AI/kalshi-position-watch.git
cd kalshi-position-watch
bun install
cp .env.example .env
2

Turn your positions into a plan

The planner reads all open positions in your selected subaccount and each market’s settlement rules. A model writes a focused stream prompt for each market. Review .local/plan.json: edit the prompts, check skipped markets, and confirm the stream count before creating anything.

bun run plan
3

Connect the webhook and start watching

Expose localhost:3000 through an HTTPS tunnel. Set WEBHOOK_URL to its /ambush endpoint and generate a signing secret as described in the repo. Create the destination, start the receiver in another terminal, then test delivery and apply your reviewed plan.

bun run channel
bun start
# In another terminal:
bun run test-delivery
bun run apply
4

Keep the portfolio and your agent in sync

Rerun plan and apply when your positions change. Once you’re happy with the generated prompts, you can schedule sync --apply. Add --prune to pause only this bot’s streams for exited positions. To hand reports to your agent, set MODE=agent, AGENT_URL and AGENT_TOKEN; start with monitoring permission.

# Review changes first:
bun run plan
bun run apply --prune
# Optional unattended sync, after authorizing it:
bun run sync --apply --prune

A few useful details.

Does every market get a stream?

The planner reads every open position in the selected subaccount and flags markets that cannot be meaningfully watched through news. Some outcomes need a live price, weather, or sports data feed. The default cap is 20 positions; you can deliberately raise it. Skipped markets appear in the plan.

What happens when I buy or sell a position?

Sync reuses existing streams, creates watches for new markets, and can pause watches for exited positions with --prune. It does not touch unrelated streams. Before processing a headline, the bot checks that you still hold the position. Run it on an always-on machine and schedule sync if you want this to happen automatically.

What does it cost?

Each position watch uses your normal Ambush stream allowance and usage. The model is called when planning a new or changed watch and when assessing an incoming headline. Your agent and hosting may add their own costs. Review the stream count and prompt scope before applying a plan.

Where do my credentials and data go?

Kalshi credentials stay in your local environment and key file. Market titles and rules go to the model to write prompts; those prompts go to Ambush. Incoming news is assessed by the model. Current holdings are attached locally to reports for your agent. Credentials and portfolio sizes are not placed in stream prompts.

Will a headline settle the market or trigger a trade?

A headline is evidence to investigate. Kalshi’s settlement rules determine the outcome. The included bot never places orders. Trading handoff is optional and requires your own configured agent, a policy file, and explicit permission. The receiving agent is responsible for checking sources, current positions, liquidity, and order limits.