<?xml version='1.0' encoding='utf-8'?>
<sbe:messageSchema xmlns:sbe="http://fixprotocol.io/2016/sbe" package="kalshi_fix_sbe" id="3" version="1" semanticVersion="1.0" byteOrder="littleEndian" description="Kalshi binary FIX sessions">
  <types>
    <composite name="messageHeader">
      <type name="blockLength" primitiveType="uint16" />
      <type name="templateId" primitiveType="uint16" />
      <type name="schemaId" primitiveType="uint16" />
      <type name="version" primitiveType="uint16" />
      <type name="seqNum" primitiveType="uint32" minValue="1" maxValue="2147483647" />
      <type name="sendingTime" primitiveType="int64" semanticType="UTCTimestamp" description="UTC microseconds since the Unix epoch" />
    </composite>
    <composite name="groupSizeEncoding">
      <type name="blockLength" primitiveType="uint16" />
      <type name="numInGroup" primitiveType="uint32" maxValue="2147483647" />
    </composite>
    <composite name="utf8Data">
      <type name="length" primitiveType="uint32" maxValue="2097152" />
      <type name="varData" primitiveType="uint8" length="0" characterEncoding="UTF-8" />
    </composite>
    <type name="optionalInt64" primitiveType="int64" presence="optional" />
    <type name="optionalInt32" primitiveType="int32" presence="optional" />
    <type name="optionalUInt8" primitiveType="uint8" presence="optional" />
  </types>
  <sbe:message name="Logon" id="1" blockLength="8">
    <field name="profile" id="1" type="uint8" description="1 Predictions MD, 2 Predictions NR, 3 Margin MD, 4 Margin NR" />
    <field name="reset" id="2" type="uint8" description="Must be 1. New epoch starts at sequence 1." />
    <field name="heartbeatSeconds" id="3" type="uint16" description="At least 3 seconds." />
    <field name="presentOptions" id="4" type="uint16" description="Bits 0 cancel orders on disconnect, 1 skip pending, 2 IOC cancel report, 3 preserve order quantity, 4 expired status, 5 new before trade, 6 split collateral, 7 cap reservation, 8 auto transfer. MD permits no option bits; Margin NR also omits bits 7 and 8." />
    <field name="enabledOptions" id="5" type="uint16" description="Subset of presentOptions. Fixed-dollar pricing is inherent." />
    <data name="senderCompId" id="6" type="utf8Data" />
    <data name="targetCompId" id="7" type="utf8Data" />
    <data name="signatureBase64" id="8" type="utf8Data" />
  </sbe:message>
  <sbe:message name="LogonAck" id="2" blockLength="8">
    <field name="profile" id="1" type="uint8" description="1 Predictions MD, 2 Predictions NR, 3 Margin MD, 4 Margin NR" />
    <field name="reset" id="2" type="uint8" description="Must be 1. New epoch starts at sequence 1." />
    <field name="heartbeatSeconds" id="3" type="uint16" description="At least 3 seconds." />
    <field name="presentOptions" id="4" type="uint16" description="Bits 0 cancel orders on disconnect, 1 skip pending, 2 IOC cancel report, 3 preserve order quantity, 4 expired status, 5 new before trade, 6 split collateral, 7 cap reservation, 8 auto transfer. MD permits no option bits; Margin NR also omits bits 7 and 8." />
    <field name="enabledOptions" id="5" type="uint16" description="Subset of presentOptions. Fixed-dollar pricing is inherent." />
    <data name="clientCompId" id="6" type="utf8Data" />
    <data name="gatewayCompId" id="7" type="utf8Data" />
  </sbe:message>
  <sbe:message name="Logout" id="3" blockLength="0">
    <data name="text" id="1" type="utf8Data" />
  </sbe:message>
  <sbe:message name="Heartbeat" id="4" blockLength="0">
    <data name="testRequestId" id="1" type="utf8Data" />
  </sbe:message>
  <sbe:message name="TestRequest" id="5" blockLength="0">
    <data name="testRequestId" id="1" type="utf8Data" />
  </sbe:message>
  <sbe:message name="SessionReject" id="6" blockLength="12">
    <field name="refSeqNum" id="1" type="int32" description="-1 means absent." />
    <field name="refTagId" id="2" type="int32" description="-1 means absent." />
    <field name="reason" id="3" type="int32" description="-1 means absent." />
    <data name="refMsgType" id="4" type="utf8Data" />
    <data name="text" id="5" type="utf8Data" />
  </sbe:message>
  <sbe:message name="BusinessReject" id="7" blockLength="12">
    <field name="refSeqNum" id="1" type="int32" description="-1 means absent." />
    <field name="refTagId" id="2" type="int32" description="-1 means absent." />
    <field name="reason" id="3" type="int32" description="-1 means absent." />
    <data name="refMsgType" id="4" type="utf8Data" />
    <data name="text" id="5" type="utf8Data" />
  </sbe:message>
  <sbe:message name="SequenceReset" id="8" blockLength="4">
    <field name="newSeqNo" id="1" type="uint32" description="Gap-fill only. Resume at this sequence; recover the missing data." />
  </sbe:message>
  <sbe:message name="ResendRequest" id="9" blockLength="8">
    <field name="beginSeqNo" id="1" type="uint32" description="Inclusive." />
    <field name="endSeqNo" id="2" type="uint32" description="Inclusive. Zero requests through the current sequence." />
  </sbe:message>
  <sbe:message name="MarketDataRequest" id="100" blockLength="2" description="V. Empty symbols cancel all for unsubscribe.">
    <field name="subscriptionType" id="1" type="uint8" description="ASCII FIX 263: 0 snapshot, 1 subscribe, 2 unsubscribe." />
    <field name="feed" id="2" type="uint8" description="Bid=1, offer=2, trade=4. Zero selects all. Ignored for unsubscribe." />
    <group name="symbols" id="3" dimensionType="groupSizeEncoding">
      <data name="symbol" id="4" type="utf8Data" />
    </group>
  </sbe:message>
  <sbe:message name="MarketDataSnapshot" id="101" blockLength="9" description="W. Replace the subscribed sides atomically. Native FIX prices on both sides.">
    <field name="hasEntryTime" id="1" type="uint8" description="Zero for an empty ladder." />
    <field name="entryTimeMs" id="2" type="int64" description="FIX 272/273, UTC epoch milliseconds. Zero when absent." />
    <group name="levels" id="3" dimensionType="groupSizeEncoding">
      <field name="entryType" id="4" type="uint8" description="ASCII FIX 269 (0 bid, 1 offer)." />
      <field name="price" id="5" type="int64" description="Ten-thousandths of one US dollar." />
      <field name="size" id="6" type="int64" description="Hundredths of a contract." />
    </group>
    <data name="symbol" id="7" type="utf8Data" />
    <data name="mdExecId" id="8" type="utf8Data" description="Empty when unavailable and on Margin." />
  </sbe:message>
  <sbe:message name="MarketDataIncrementalRefresh" id="102" blockLength="8" description="X. All entries belong to one market event. Apply in order.">
    <field name="entryTimeMs" id="1" type="int64" description="FIX 272/273, UTC epoch milliseconds." />
    <group name="entries" id="2" dimensionType="groupSizeEncoding">
      <field name="entryType" id="3" type="uint8" description="ASCII FIX 269 (0 bid, 1 offer, 2 trade)." />
      <field name="action" id="4" type="uint8" description="ASCII FIX 279 (0 new trade, 1 change, 2 delete)." />
      <field name="price" id="5" type="int64" description="Ten-thousandths of one US dollar." />
      <field name="size" id="6" type="int64" description="Hundredths of a contract. Book entries carry the absolute resulting level size." />
      <field name="aggressorSide" id="7" type="uint8" description="ASCII FIX Side on a trade, zero for book entries." />
      <field name="isBlockTrade" id="8" type="uint8" description="One for TrdType=1, otherwise zero." />
      <field name="hasAllocAccount" id="9" type="uint8" description="One for an entitled owner entry with an account, including account zero." />
      <field name="allocAccount" id="10" type="int64" description="FIX 79 when present, otherwise zero." />
      <data name="tradeId" id="11" type="utf8Data" description="Empty on a book update." />
      <data name="clOrdId" id="12" type="utf8Data" description="Original text identifier for an entitled owner, otherwise empty." />
    </group>
    <data name="symbol" id="13" type="utf8Data" />
    <data name="mdExecId" id="14" type="utf8Data" description="Empty when unavailable and on Margin." />
  </sbe:message>
  <sbe:message name="MarketDataRequestReject" id="103" blockLength="1" description="Y.">
    <field name="reason" id="1" type="uint8" description="ASCII FIX 281 or zero when absent." />
    <data name="text" id="2" type="utf8Data" />
  </sbe:message>
  <sbe:message name="SecurityStatusRequest" id="104" blockLength="1" description="e. Predictions market lifecycle subscription.">
    <field name="subscriptionType" id="1" type="uint8" description="ASCII FIX 263: 1 subscribe, 2 unsubscribe." />
    <data name="symbol" id="2" type="utf8Data" />
  </sbe:message>
  <sbe:message name="MarketLifecycleStatus" id="105" blockLength="2" description="f. Predictions market lifecycle changes.">
    <field name="securityTradingStatus" id="1" type="uint16" description="Numeric FIX 326. Includes venue values 100 determined and 101 settled." />
    <data name="symbol" id="2" type="utf8Data" />
  </sbe:message>
  <sbe:message name="MarketDataSnapshotChunk" id="106" blockLength="33" description="Segment of one full W. Apply only after receiving every segment with one snapshotId, symbol, cursor and complete level count. Discard an incomplete snapshot on disconnect.">
    <field name="hasEntryTime" id="1" type="uint8" description="Zero for an empty ladder." />
    <field name="entryTimeMs" id="2" type="int64" description="FIX 272/273, UTC epoch milliseconds. Zero when absent." />
    <field name="snapshotId" id="9" type="uint64" />
    <field name="chunkIndex" id="10" type="uint32" description="Zero-based index." />
    <field name="chunkCount" id="11" type="uint32" />
    <field name="totalLevels" id="12" type="uint64" />
    <group name="levels" id="3" dimensionType="groupSizeEncoding">
      <field name="entryType" id="4" type="uint8" description="ASCII FIX 269 (0 bid, 1 offer)." />
      <field name="price" id="5" type="int64" description="Ten-thousandths of one US dollar." />
      <field name="size" id="6" type="int64" description="Hundredths of a contract." />
    </group>
    <data name="symbol" id="7" type="utf8Data" />
    <data name="mdExecId" id="8" type="utf8Data" description="Empty when unavailable and on Margin." />
  </sbe:message>
  <sbe:message name="NewOrderSingle" id="200" description="Limit order. Price in 1/10000 USD, quantity in 1/100 contract. Character values use classic FIX codes.">
    <field name="quantity" id="38" type="int64" description="Hundredths of a contract. Market-specific increments still apply." />
    <field name="price" id="44" type="int64" description="Ten-thousandths of a USD." />
    <field name="side" id="54" type="uint8" description="ASCII FIX 54: '1' buy, '2' sell." />
    <field name="ordType" id="40" type="uint8" description="ASCII FIX 40: '2' limit." />
    <field name="timeInForce" id="59" type="optionalUInt8" description="ASCII FIX 59; 255 means absent. Values are the venue's ordinary FIX time-in-force codes." />
    <field name="expireTimeMicros" id="126" type="optionalInt64" />
    <field name="allocAccount" id="79" type="optionalInt32" description="FIX 79 subaccount number, including zero. INT32_MIN means omitted." />
    <field name="destination" id="100" type="optionalInt32" description="FIX 100 exchange shard. INT32_MIN means omitted; -1 selects automatic routing when supported." />
    <field name="cancelOnPause" id="21006" type="uint8" />
    <field name="selfTradePrevention" id="2964" type="optionalInt32" description="FIX 2964 numeric policy." />
    <field name="maxExecutionCost" id="21009" type="optionalInt64" description="Ten-thousandths of a USD, null when omitted." />
    <data name="symbol" id="55" type="utf8Data" />
    <data name="clOrdId" id="11" type="utf8Data" description="FIX 11 client order ID, subject to the same input validation as classic FIX." />
    <data name="operatorId" id="50" type="utf8Data" />
    <data name="customerAccount" id="448" type="utf8Data" />
    <data name="orderGroupId" id="20130" type="utf8Data" />
    <data name="execInst" id="18" type="utf8Data" />
  </sbe:message>
  <sbe:message name="OrderCancelRequest" id="201" description="Cancel an order identified by its original client order ID.">
    <field name="side" id="54" type="uint8" description="ASCII FIX 54: '1' buy, '2' sell." />
    <field name="allocAccount" id="79" type="optionalInt32" description="FIX 79 subaccount number, including zero. INT32_MIN means omitted." />
    <field name="destination" id="100" type="optionalInt32" description="FIX 100 exchange shard. INT32_MIN means omitted; -1 selects automatic routing when supported." />
    <data name="symbol" id="55" type="utf8Data" />
    <data name="clOrdId" id="11" type="utf8Data" description="FIX 11 client order ID, subject to the same input validation as classic FIX." />
    <data name="origClOrdId" id="41" type="utf8Data" />
    <data name="operatorId" id="50" type="utf8Data" />
    <data name="customerAccount" id="448" type="utf8Data" />
  </sbe:message>
  <sbe:message name="OrderCancelReplaceRequest" id="202" description="Replace quantity, optional price and expiry on one existing order.">
    <field name="quantity" id="38" type="int64" description="Hundredths of a contract. Market-specific increments still apply." />
    <field name="price" id="44" type="optionalInt64" description="Ten-thousandths of a USD." />
    <field name="side" id="54" type="uint8" description="ASCII FIX 54: '1' buy, '2' sell." />
    <field name="timeInForce" id="59" type="optionalUInt8" description="ASCII FIX 59; 255 means absent. Values are the venue's ordinary FIX time-in-force codes." />
    <field name="expireTimeMicros" id="126" type="optionalInt64" />
    <field name="allocAccount" id="79" type="optionalInt32" description="FIX 79 subaccount number, including zero. INT32_MIN means omitted." />
    <field name="destination" id="100" type="optionalInt32" description="FIX 100 exchange shard. INT32_MIN means omitted; -1 selects automatic routing when supported." />
    <data name="symbol" id="55" type="utf8Data" />
    <data name="clOrdId" id="11" type="utf8Data" description="FIX 11 client order ID, subject to the same input validation as classic FIX." />
    <data name="origClOrdId" id="41" type="utf8Data" />
    <data name="orderId" id="37" type="utf8Data" />
    <data name="operatorId" id="50" type="utf8Data" />
    <data name="customerAccount" id="448" type="utf8Data" />
  </sbe:message>
  <sbe:message name="OrderMassCancelRequest" id="203" description="FIX q. The one-byte fields use the ASCII codes of classic FIX.">
    <field name="scope" id="530" type="uint8" description="ASCII FIX 530: '1' (0x31) market, '6' (0x36) session across shards." />
    <field name="allocAccount" id="79" type="optionalInt32" description="FIX 79 subaccount number, including zero. INT32_MIN means omitted." />
    <field name="destination" id="100" type="optionalInt32" description="FIX 100 exchange shard. INT32_MIN means omitted; -1 selects automatic routing when supported." />
    <data name="clOrdId" id="11" type="utf8Data" description="FIX 11 client order ID, subject to the same input validation as classic FIX." />
    <data name="symbol" id="55" type="utf8Data" />
    <data name="customerAccount" id="448" type="utf8Data" />
  </sbe:message>
  <sbe:message name="OrderGroupRequest" id="204" description="Create, reset, delete, trigger, or update contracts limit.">
    <field name="action" id="20131" type="int32" />
    <field name="contractsLimit" id="20132" type="optionalInt32" description="Whole contracts, not centicount. Null when omitted." />
    <field name="allocAccount" id="79" type="optionalInt32" description="FIX 79 subaccount number, including zero. INT32_MIN means omitted." />
    <field name="destination" id="100" type="optionalInt32" description="FIX 100 exchange shard. INT32_MIN means omitted; -1 selects automatic routing when supported." />
    <data name="orderGroupId" id="20130" type="utf8Data" />
  </sbe:message>
  <sbe:message name="EventResendRequest" id="205" description="Authorized historical execution-event replay by exchange execution ID.">
    <data name="beginExecId" id="21001" type="utf8Data" />
    <data name="endExecId" id="21002" type="utf8Data" />
  </sbe:message>
  <sbe:message name="ExecutionReport" id="210" description="Authorized order outcome, fills and balances. Prices in 1/10000 USD, quantity in 1/100 contract, fees and balances in 1/100000000 USD.">
    <field name="execType" id="150" type="uint8" />
    <field name="ordStatus" id="39" type="uint8" />
    <field name="side" id="54" type="uint8" description="ASCII FIX 54: '1' buy, '2' sell." />
    <field name="cumQty" id="14" type="int64" description="Hundredths of a contract." />
    <field name="leavesQty" id="151" type="int64" description="Hundredths of a contract." />
    <field name="orderQty" id="38" type="int64" description="Hundredths of a contract." />
    <field name="avgPxWholeUSD" id="6" type="int64" description="Integral USD part of AvgPx, after rounding to 10 decimal places." />
    <field name="avgPxFraction1e10" id="30001" type="int64" description="Signed fractional USD part in ten-billionths; add this divided by 10,000,000,000 to avgPxWholeUSD." />
    <field name="price" id="44" type="optionalInt64" description="Ten-thousandths of a USD." />
    <field name="lastPx" id="31" type="optionalInt64" description="Ten-thousandths of a USD." />
    <field name="lastQty" id="32" type="optionalInt64" description="Hundredths of a contract." />
    <field name="transactTimeMicros" id="60" type="optionalInt64" />
    <field name="expireTimeMicros" id="126" type="optionalInt64" />
    <field name="timeInForce" id="59" type="optionalUInt8" description="ASCII FIX 59; 255 means absent. Values are the venue's ordinary FIX time-in-force codes." />
    <field name="allocAccount" id="79" type="optionalInt32" description="FIX 79 subaccount number, including zero. INT32_MIN means omitted." />
    <field name="lastMarket" id="30" type="optionalInt32" />
    <field name="selfTradePrevention" id="2964" type="int32" description="FIX 2964 numeric policy." />
    <field name="aggressor" id="1057" type="optionalUInt8" />
    <field name="blockTrade" id="828" type="optionalUInt8" />
    <field name="longQty" id="704" type="optionalInt64" />
    <field name="shortQty" id="705" type="optionalInt64" />
    <field name="exchangeFee" id="137" type="optionalInt64" description="One hundred-millionth of a USD per unit. A present value denotes one absolute USD exchange fee." />
    <field name="balanceChange" id="21022" type="optionalInt64" />
    <field name="payoutChange" id="21023" type="optionalInt64" />
    <field name="singleMarketReturn" id="21030" type="optionalInt64" description="One hundred-millionth of a USD per unit after classic split-return rounding." />
    <field name="rangedMarketReturn" id="21031" type="optionalInt64" description="One hundred-millionth of a USD per unit after classic split-return rounding." />
    <field name="hasCollateralChanges" id="1703" type="uint8" description="1 if the collateral change group is present, even when empty; 0 otherwise." />
    <data name="orderId" id="37" type="utf8Data" />
    <data name="clOrdId" id="11" type="utf8Data" description="FIX 11 client order ID, subject to the same input validation as classic FIX." />
    <data name="origClOrdId" id="41" type="utf8Data" />
    <data name="execId" id="17" type="utf8Data" />
    <data name="symbol" id="55" type="utf8Data" />
    <data name="operatorId" id="50" type="utf8Data" />
    <data name="customerAccount" id="448" type="utf8Data" />
    <data name="tradeId" id="880" type="utf8Data" />
    <data name="clearingDate" id="715" type="utf8Data" />
    <data name="rejectReason" id="103" type="utf8Data" />
    <data name="text" id="58" type="utf8Data" />
  </sbe:message>
  <sbe:message name="OrderCancelReject" id="211" description="Request-specific refusal; original and replacement client IDs are preserved.">
    <field name="ordStatus" id="39" type="uint8" />
    <field name="responseTo" id="434" type="uint8" />
    <data name="orderId" id="37" type="utf8Data" />
    <data name="clOrdId" id="11" type="utf8Data" description="FIX 11 client order ID, subject to the same input validation as classic FIX." />
    <data name="origClOrdId" id="41" type="utf8Data" />
    <data name="rejectReason" id="102" type="utf8Data" />
    <data name="text" id="58" type="utf8Data" />
  </sbe:message>
  <sbe:message name="OrderMassCancelReport" id="212" description="Result of market or session mass cancel.">
    <field name="scope" id="530" type="uint8" description="ASCII FIX 530: '1' (0x31) market, '6' (0x36) session across shards." />
    <field name="response" id="531" type="uint8" description="ASCII FIX 531: '0' rejected, '1' market accepted, '6' session accepted." />
    <data name="clOrdId" id="11" type="utf8Data" description="FIX 11 client order ID, subject to the same input validation as classic FIX." />
    <data name="symbol" id="55" type="utf8Data" />
    <data name="rejectReason" id="532" type="utf8Data" />
    <data name="text" id="58" type="utf8Data" />
    <data name="orderId" id="37" type="utf8Data" />
  </sbe:message>
  <sbe:message name="OrderGroupResponse" id="213" description="Order group action result.">
    <field name="contractsLimit" id="20132" type="optionalInt32" description="Whole contracts, not centicount. Null when omitted." />
    <field name="allocAccount" id="79" type="optionalInt32" description="FIX 79 subaccount number, including zero. INT32_MIN means omitted." />
    <data name="orderGroupId" id="20130" type="utf8Data" />
  </sbe:message>
  <sbe:message name="EventResendComplete" id="214" description="Completion for an entitled U1; sequence refers to the requesting client frame.">
    <field name="refSeqNum" id="45" type="int32" />
    <field name="count" id="21003" type="int32" />
  </sbe:message>
  <sbe:message name="EventResendReject" id="215" description="Historical event resend refusal.">
    <field name="refSeqNum" id="45" type="int32" />
    <field name="reason" id="21004" type="int32" />
  </sbe:message>
  <sbe:message name="TradingSessionStatus" id="216" description="Unsolicited Margin trading session state.">
    <field name="tradingStatus" id="340" type="int32" />
    <field name="transactTimeMicros" id="60" type="optionalInt64" />
    <field name="estimatedResumeMicros" id="342" type="optionalInt64" />
    <data name="tradingSessionId" id="336" type="utf8Data" />
  </sbe:message>
  <sbe:message name="CorporateActionStatus" id="217" description="Unsolicited Margin corporate action; price/ratio and effective time follow existing FIX report semantics.">
    <field name="transactTimeMicros" id="60" type="int64" />
    <field name="settlementPrice" id="730" type="optionalInt64" />
    <data name="symbol" id="55" type="utf8Data" />
    <data name="reviewId" id="20190" type="utf8Data" />
    <data name="corporateAction" id="292" type="utf8Data" />
    <data name="text" id="58" type="utf8Data" />
  </sbe:message>
</sbe:messageSchema>
