Skip to content

Commit ac94241

Browse files
fix(kalshi): remove synthetically constructed outputs (#2677)
* fix(kalshi): remove synthetically constructed outputs * fix api interface
1 parent 195e0e8 commit ac94241

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

apps/sim/tools/kalshi/get_balance.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ export interface KalshiGetBalanceResponse {
88
success: boolean
99
output: {
1010
balance: number // In cents
11-
portfolioValue?: number // In cents
12-
balanceDollars: number // Converted to dollars
13-
portfolioValueDollars?: number // Converted to dollars
11+
portfolioValue: number // In cents
1412
}
1513
}
1614

@@ -51,24 +49,20 @@ export const kalshiGetBalanceTool: ToolConfig<KalshiGetBalanceParams, KalshiGetB
5149
handleKalshiError(data, response.status, 'get_balance')
5250
}
5351

54-
const balance = data.balance || 0
55-
const portfolioValue = data.portfolio_value
52+
const balance = data.balance ?? 0
53+
const portfolioValue = data.portfolio_value ?? 0
5654

5755
return {
5856
success: true,
5957
output: {
6058
balance,
6159
portfolioValue,
62-
balanceDollars: balance / 100,
63-
portfolioValueDollars: portfolioValue ? portfolioValue / 100 : undefined,
6460
},
6561
}
6662
},
6763

6864
outputs: {
6965
balance: { type: 'number', description: 'Account balance in cents' },
7066
portfolioValue: { type: 'number', description: 'Portfolio value in cents' },
71-
balanceDollars: { type: 'number', description: 'Account balance in dollars' },
72-
portfolioValueDollars: { type: 'number', description: 'Portfolio value in dollars' },
7367
},
7468
}

apps/sim/tools/kalshi/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export interface KalshiEvent {
8282
// Balance type
8383
export interface KalshiBalance {
8484
balance: number // In cents
85-
portfolio_value?: number // In cents
85+
portfolio_value: number // In cents
8686
}
8787

8888
// Position type

0 commit comments

Comments
 (0)