> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agg.market/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> To integrate AGG, start with Quickstart: REST (https://docs.agg.market/quickstart/rest), then Order lifecycle & statuses (https://docs.agg.market/concepts/order-lifecycle).
> Track every trade until it reaches a terminal status. Before retrying a failed or timed-out call, read Errors, retries & idempotency (https://docs.agg.market/concepts/errors).
> The API reference is generated from https://docs.agg.market/openapi/openapi.json.

# Kalshi

> How AGG trades Kalshi: the user's own Kalshi account and API key, cash held at Kalshi, and no on-chain step.

AGG trades Kalshi through Kalshi's REST API, using the user's own Kalshi API key. The user's positions and cash stay in their Kalshi account. Nothing is tokenized, and no part of a Kalshi trade runs on a chain. The slug is `kalshi`. Every venue is compared on [Venues](/venues/overview).

## What the user needs first

1. A Kalshi account with an API key: a key id and its RSA private key.
2. A provisioned trading wallet. Call [Get deposit addresses](/api-reference/funding/get-deposit-addresses) (`client.getDepositAddresses()`) once. Storing the key fails without one.
3. The key stored with [Venue keys](/recipes/venue-keys). AGG reads the Kalshi balance with it before saving. A key that cannot read the balance returns `400` and is not stored.
4. Cash in the Kalshi account. The user deposits on Kalshi. AGG does not deposit to or withdraw from a Kalshi account.

AGG runs no KYC for Kalshi. `POST /kyc/kalshi` returns `not_applicable`. See [KYC](/recipes/kyc).

## Funding

A Kalshi leg spends the user's Kalshi cash. There is no bridge, approval, or deposit step, so a Kalshi fill is one REST order. Read that cash as `venueCash` on the balances call. It is in integer US cents.

<CodeGroup>
  ```ts SDK theme={null}
  const { venueCash } = await client.getManagedBalances();
  const kalshi = venueCash?.find((v) => v.venue === "kalshi");
  // kalshi?.balanceCents: 1234 = $12.34. No kalshi entry without a readable key.
  ```

  ```bash cURL theme={null}
  curl -s -H "x-app-id: $APP_ID" -H "Authorization: Bearer $ACCESS_TOKEN" \
    "$API/execution/balances"
  ```
</CodeGroup>

[Get balances](/api-reference/portfolio/get-balances).

A quote for a buy that routes to Kalshi checks that cash. When the stored key reads a balance below the Kalshi leg's cost, the quote carries a warning with `reason: "low_balance"`. The quote still returns. At fill, a buy whose Kalshi cash is short fails with `quote_insufficient_balance`. That includes a user with no stored key, so leave `kalshi` out of `allowedVenues` for those users.

A managed limit buy checks the same cash and returns `409` when it is short.

## Self-custody

A self-custody route can include a Kalshi leg. It runs the same way: the user's Kalshi key signs and their Kalshi cash pays, with no wallet prompt. Self-custody limit orders are not supported on Kalshi. Fee rules for a Kalshi-only self-custody fill are on [Self-custody](/recipes/self-custody#venue-and-funding-support).

## Orders

* A market fill is sent as an immediate-or-cancel order. Size that does not fill is cancelled, not left on the book.
* Each order carries AGG's order id as Kalshi's client order id, so a retried submit does not place a second order.
* An order on `No` is placed on Kalshi's `Yes` book at the complementary price. You still pass the `No` outcome's `venueMarketOutcomeId`.
* Limit prices must sit on Kalshi's \$0.01 tick, for example `530000` (0.53 in 6-decimal units).
* Limit orders accept `GTC`, `GTD`, `FOK`, and `IOC`, with post-only. See [Limit orders](/recipes/limit-orders).
* `skipQuote` is not available on Kalshi. See [Direct order execution](/recipes/direct-order-execution#skipping-the-quote).

## Fees

Kalshi charges its own trading fee, rounded up to the cent on each order. See [Venue fees](/recipes/venue-fees).

A user-paid referral on a route that fills only on Kalshi cannot be paid. The quote carries a warning with `reason: "referral_unpaid_on_solana"`. See [Where a referral cannot be paid](/concepts/fees#where-a-referral-cannot-be-paid).

## Where it can be traded

AGG blocks Kalshi fills from the United States as platform policy, although Kalshi itself accepts US users. Kalshi's own restricted countries are blocked too. Read the live list on [Venue geo availability](/recipes/venue-geo-availability). Do not hard-code it.

## Settlement

Kalshi pays a settled position into the user's Kalshi cash itself. There is no redeem step, and `POST /execution/redeem` does not apply. A cancelled or postponed market settles at a fair price instead of voiding. See [Market resolution](/concepts/market-resolution#by-venue).

## IDs

`externalIdentifier` is Kalshi's ticker: the event ticker on an event, and the market ticker on a market. Kalshi puts the market ticker on the `Yes` outcome only. The `No` outcome's `externalIdentifier` is `null`, so find its `id` in the market's `venueMarketOutcomes[]`. See [IDs](/concepts/ids).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.