Skip to content

Kalshi fetchTrades returns price: NaN and amount: undefined #60

@realfishsam

Description

@realfishsam

Bug

fetchTrades on Kalshi returns trades with price: NaN and amount: undefined:

const kalshi = new pmxt.Kalshi();
const trades = await kalshi.fetchTrades(outcomeId, { limit: 10 });
// Returns:
// { id: '587d4e7d-...', timestamp: 1772720166597, price: NaN, amount: undefined, side: 'sell' }

Expected

price and amount should be populated with numeric values from the Kalshi API response.

Root Cause

Likely a field mapping issue in the Kalshi normalizer/trade mapping — the raw API response fields don't match what the normalizer expects.

Reproduction

import pmxt from 'pmxt-core';
const kalshi = new pmxt.Kalshi();
const markets = await kalshi.fetchMarkets({ slug: 'KXFEDCHAIRNOM-29' });
const outcome = markets[0].outcomes[0];
const trades = await kalshi.fetchTrades(outcome.outcomeId, { limit: 5 });
console.log(trades); // price: NaN, amount: undefined

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions