Skip to content

Commit f440b35

Browse files
committed
feat: made market ticket derived dynamically from input, this program can now access any kalshi data
1 parent b704168 commit f440b35

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

scripts/post-dr.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ async function main() {
1616
method: 'none'
1717
},
1818
execProgramId: process.env.ORACLE_PROGRAM_ID,
19-
execInputs: Buffer.from('eth-usdc'),
19+
execInputs: Buffer.from("KXPRESPERSON-28-JVAN"),
2020
tallyInputs: Buffer.from([]),
2121
memo: Buffer.from(new Date().toISOString()),
2222
};

src/execution_phase.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ pub fn execution_phase() -> Result<()> {
2828
// Retrieve the input parameters for the data request (DR).
2929
// Expected to be a series ticker (e.g., "KXGDP").
3030
let dr_inputs_raw = String::from_utf8(Process::get_inputs())?;
31-
let series_ticker = dr_inputs_raw.trim();
31+
let market_ticker = dr_inputs_raw.trim();
3232

33-
log!("Fetching Kalshi market data for series: {}", series_ticker);
33+
log!("Fetching Kalshi market data for series: {}", market_ticker);
3434

3535
// Step 1: Get series information
3636
let series_response = http_fetch(
37-
"https://api.elections.kalshi.com/trade-api/v2/markets/KXBOXING-25SEP13CALVTCRA-CALV",
37+
format!("https://api.elections.kalshi.com/trade-api/v2/markets/{}", market_ticker),
3838
None,
3939
);
4040

0 commit comments

Comments
 (0)