pmxt-core 2.52.0 → 2.53.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/BaseExchange.d.ts +2 -2
- package/dist/exchanges/baozi/errors.js +4 -4
- package/dist/exchanges/kalshi/api.d.ts +1 -1
- package/dist/exchanges/kalshi/api.js +1 -1
- package/dist/exchanges/limitless/api.d.ts +1 -1
- package/dist/exchanges/limitless/api.js +1 -1
- package/dist/exchanges/limitless/utils.js +26 -27
- package/dist/exchanges/myriad/api.d.ts +1 -1
- package/dist/exchanges/myriad/api.js +1 -1
- package/dist/exchanges/opinion/api.d.ts +1 -1
- package/dist/exchanges/opinion/api.js +1 -1
- package/dist/exchanges/polymarket/api-clob.d.ts +1 -1
- package/dist/exchanges/polymarket/api-clob.js +1 -1
- package/dist/exchanges/polymarket/api-data.d.ts +1 -1
- package/dist/exchanges/polymarket/api-data.js +1 -1
- package/dist/exchanges/polymarket/api-gamma.d.ts +1 -1
- package/dist/exchanges/polymarket/api-gamma.js +1 -1
- package/dist/exchanges/probable/api.d.ts +1 -1
- package/dist/exchanges/probable/api.js +1 -1
- package/dist/router/types.d.ts +13 -0
- package/dist/server/openapi.yaml +1 -1
- package/package.json +3 -3
package/dist/BaseExchange.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { AxiosInstance } from 'axios';
|
|
|
2
2
|
import { SubscribedAddressSnapshot, SubscriptionOption } from './subscriber/base';
|
|
3
3
|
import { Balance, BuiltOrder, CandleInterval, CreateOrderParams, Order, OrderBook, Position, PriceCandle, Trade, UnifiedEvent, UnifiedMarket, UnifiedSeries, UserTrade } from './types';
|
|
4
4
|
import { ExecutionPriceResult } from './utils/math';
|
|
5
|
-
import type { FetchMarketMatchesParams, FetchMatchesParams, FetchEventMatchesParams, FetchArbitrageParams, FetchMatchedMarketsParams, FetchMatchedPricesParams, MatchResult, EventMatchResult, PriceComparison, ArbitrageOpportunity, MatchedMarketPair, MatchedPricePair } from './router/types';
|
|
5
|
+
import type { FetchMarketMatchesParams, FetchMatchesParams, FetchEventMatchesParams, FetchArbitrageParams, FetchMatchedMarketsParams, FetchMatchedPricesParams, MatchResult, EventMatchResult, PriceComparison, CompareMarketPricesParams, ArbitrageOpportunity, MatchedMarketPair, MatchedPricePair } from './router/types';
|
|
6
6
|
export interface ApiEndpoint {
|
|
7
7
|
/** HTTP verb for the endpoint (e.g. GET, POST). */
|
|
8
8
|
method: string;
|
|
@@ -818,7 +818,7 @@ export declare abstract class PredictionMarketExchange {
|
|
|
818
818
|
* @param params - Match filter parameters (uses relation: 'identity' internally)
|
|
819
819
|
* @returns Array of price comparisons across venues
|
|
820
820
|
*/
|
|
821
|
-
compareMarketPrices(params:
|
|
821
|
+
compareMarketPrices(params: CompareMarketPricesParams): Promise<PriceComparison[]>;
|
|
822
822
|
/**
|
|
823
823
|
* Find related markets across venues. Discovers subset/superset market relationships
|
|
824
824
|
* where one market's outcome implies another, with live prices.
|
|
@@ -7,11 +7,11 @@ const errors_1 = require("../../errors");
|
|
|
7
7
|
const PROGRAM_ERRORS = {
|
|
8
8
|
6000: { type: 'bad_request', message: 'Unauthorized' },
|
|
9
9
|
6001: { type: 'bad_request', message: 'Market not found' },
|
|
10
|
+
6013: { type: 'bad_request', message: 'Betting is closed' }, // Changed from 6018
|
|
11
|
+
6014: { type: 'bad_request', message: 'Betting is frozen' }, // Changed from 6040
|
|
10
12
|
6015: { type: 'bad_request', message: 'Market is not open for betting' },
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
6040: { type: 'bad_request', message: 'Betting is frozen' },
|
|
14
|
-
6041: { type: 'invalid_order', message: 'Bet amount too large' },
|
|
13
|
+
6023: { type: 'invalid_order', message: 'Bet amount too small' }, // Changed from 6020
|
|
14
|
+
6024: { type: 'invalid_order', message: 'Bet amount too large' }, // Changed from 6041
|
|
15
15
|
};
|
|
16
16
|
/**
|
|
17
17
|
* Maps Solana/Anchor errors to pmxt unified error types.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Auto-generated from /home/runner/work/pmxt/pmxt/core/specs/kalshi/Kalshi.yaml
|
|
3
|
-
* Generated at: 2026-07-
|
|
3
|
+
* Generated at: 2026-07-18T01:30:24.099Z
|
|
4
4
|
* Do not edit manually -- run "npm run fetch:openapi" to regenerate.
|
|
5
5
|
*/
|
|
6
6
|
export declare const kalshiApiSpec: {
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.kalshiApiSpec = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* Auto-generated from /home/runner/work/pmxt/pmxt/core/specs/kalshi/Kalshi.yaml
|
|
6
|
-
* Generated at: 2026-07-
|
|
6
|
+
* Generated at: 2026-07-18T01:30:24.099Z
|
|
7
7
|
* Do not edit manually -- run "npm run fetch:openapi" to regenerate.
|
|
8
8
|
*/
|
|
9
9
|
exports.kalshiApiSpec = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Auto-generated from /home/runner/work/pmxt/pmxt/core/specs/limitless/Limitless.yaml
|
|
3
|
-
* Generated at: 2026-07-
|
|
3
|
+
* Generated at: 2026-07-18T01:30:24.137Z
|
|
4
4
|
* Do not edit manually -- run "npm run fetch:openapi" to regenerate.
|
|
5
5
|
*/
|
|
6
6
|
export declare const limitlessApiSpec: {
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.limitlessApiSpec = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* Auto-generated from /home/runner/work/pmxt/pmxt/core/specs/limitless/Limitless.yaml
|
|
6
|
-
* Generated at: 2026-07-
|
|
6
|
+
* Generated at: 2026-07-18T01:30:24.137Z
|
|
7
7
|
* Do not edit manually -- run "npm run fetch:openapi" to regenerate.
|
|
8
8
|
*/
|
|
9
9
|
exports.limitlessApiSpec = {
|
|
@@ -173,39 +173,38 @@ function mapIntervalToFidelity(interval) {
|
|
|
173
173
|
async function paginateLimitlessMarkets(fetcher, requestedLimit, sortBy) {
|
|
174
174
|
const PAGE_SIZE = 25;
|
|
175
175
|
const targetLimit = requestedLimit || PAGE_SIZE;
|
|
176
|
-
|
|
177
|
-
|
|
176
|
+
// Over-fetch by 70% because ~30% of markets lack tokens and get filtered out
|
|
177
|
+
// This ensures enough raw markets survive the token filter
|
|
178
|
+
const OVER_FETCH_FACTOR = 1.7;
|
|
179
|
+
const rawTargetLimit = Math.ceil(targetLimit * OVER_FETCH_FACTOR);
|
|
180
|
+
if (rawTargetLimit <= PAGE_SIZE) {
|
|
178
181
|
const response = await fetcher.getActiveMarkets({
|
|
179
|
-
limit:
|
|
182
|
+
limit: rawTargetLimit,
|
|
180
183
|
page: 1,
|
|
181
184
|
sortBy: sortBy,
|
|
182
185
|
});
|
|
183
186
|
return response.data || [];
|
|
184
187
|
}
|
|
185
|
-
//
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
const
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
188
|
+
// Sequential pagination using totalMarketsCount
|
|
189
|
+
const allMarkets = [];
|
|
190
|
+
let page = 1;
|
|
191
|
+
const MAX_PAGES = 50; // Safety limit
|
|
192
|
+
while (page <= MAX_PAGES && allMarkets.length < rawTargetLimit) {
|
|
193
|
+
const response = await fetcher.getActiveMarkets({
|
|
194
|
+
limit: PAGE_SIZE,
|
|
195
|
+
page: page,
|
|
196
|
+
sortBy: sortBy,
|
|
197
|
+
});
|
|
198
|
+
const markets = response.data || [];
|
|
199
|
+
if (markets.length === 0)
|
|
200
|
+
break;
|
|
201
|
+
allMarkets.push(...markets);
|
|
202
|
+
// Use totalMarketsCount to check if we're done
|
|
203
|
+
const totalCount = response.totalMarketsCount;
|
|
204
|
+
if (totalCount && allMarkets.length >= totalCount)
|
|
205
|
+
break;
|
|
206
|
+
page++;
|
|
193
207
|
}
|
|
194
|
-
|
|
195
|
-
try {
|
|
196
|
-
const response = await fetcher.getActiveMarkets({
|
|
197
|
-
limit: PAGE_SIZE,
|
|
198
|
-
page: page,
|
|
199
|
-
sortBy: sortBy,
|
|
200
|
-
});
|
|
201
|
-
return response.data || [];
|
|
202
|
-
}
|
|
203
|
-
catch (e) {
|
|
204
|
-
return [];
|
|
205
|
-
}
|
|
206
|
-
}));
|
|
207
|
-
const allMarkets = pages.flat();
|
|
208
|
-
// Don't slice here - let the caller handle limiting after filtering
|
|
209
|
-
// This ensures we return enough raw markets for the caller to filter
|
|
208
|
+
// Return raw markets - caller will filter tokens and apply actual limit
|
|
210
209
|
return allMarkets;
|
|
211
210
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Auto-generated from /home/runner/work/pmxt/pmxt/core/specs/myriad/myriad.yaml
|
|
3
|
-
* Generated at: 2026-07-
|
|
3
|
+
* Generated at: 2026-07-18T01:30:24.144Z
|
|
4
4
|
* Do not edit manually -- run "npm run fetch:openapi" to regenerate.
|
|
5
5
|
*/
|
|
6
6
|
export declare const myriadApiSpec: {
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.myriadApiSpec = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* Auto-generated from /home/runner/work/pmxt/pmxt/core/specs/myriad/myriad.yaml
|
|
6
|
-
* Generated at: 2026-07-
|
|
6
|
+
* Generated at: 2026-07-18T01:30:24.144Z
|
|
7
7
|
* Do not edit manually -- run "npm run fetch:openapi" to regenerate.
|
|
8
8
|
*/
|
|
9
9
|
exports.myriadApiSpec = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Auto-generated from /home/runner/work/pmxt/pmxt/core/specs/opinion/opinion-openapi.yaml
|
|
3
|
-
* Generated at: 2026-07-
|
|
3
|
+
* Generated at: 2026-07-18T01:30:24.149Z
|
|
4
4
|
* Do not edit manually -- run "npm run fetch:openapi" to regenerate.
|
|
5
5
|
*/
|
|
6
6
|
export declare const opinionApiSpec: {
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.opinionApiSpec = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* Auto-generated from /home/runner/work/pmxt/pmxt/core/specs/opinion/opinion-openapi.yaml
|
|
6
|
-
* Generated at: 2026-07-
|
|
6
|
+
* Generated at: 2026-07-18T01:30:24.149Z
|
|
7
7
|
* Do not edit manually -- run "npm run fetch:openapi" to regenerate.
|
|
8
8
|
*/
|
|
9
9
|
exports.opinionApiSpec = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Auto-generated from /home/runner/work/pmxt/pmxt/core/specs/polymarket/PolymarketClobAPI.yaml
|
|
3
|
-
* Generated at: 2026-07-
|
|
3
|
+
* Generated at: 2026-07-18T01:30:24.107Z
|
|
4
4
|
* Do not edit manually -- run "npm run fetch:openapi" to regenerate.
|
|
5
5
|
*/
|
|
6
6
|
export declare const polymarketClobSpec: {
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.polymarketClobSpec = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* Auto-generated from /home/runner/work/pmxt/pmxt/core/specs/polymarket/PolymarketClobAPI.yaml
|
|
6
|
-
* Generated at: 2026-07-
|
|
6
|
+
* Generated at: 2026-07-18T01:30:24.107Z
|
|
7
7
|
* Do not edit manually -- run "npm run fetch:openapi" to regenerate.
|
|
8
8
|
*/
|
|
9
9
|
exports.polymarketClobSpec = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Auto-generated from /home/runner/work/pmxt/pmxt/core/specs/polymarket/Polymarket_Data_API.yaml
|
|
3
|
-
* Generated at: 2026-07-
|
|
3
|
+
* Generated at: 2026-07-18T01:30:24.120Z
|
|
4
4
|
* Do not edit manually -- run "npm run fetch:openapi" to regenerate.
|
|
5
5
|
*/
|
|
6
6
|
export declare const polymarketDataSpec: {
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.polymarketDataSpec = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* Auto-generated from /home/runner/work/pmxt/pmxt/core/specs/polymarket/Polymarket_Data_API.yaml
|
|
6
|
-
* Generated at: 2026-07-
|
|
6
|
+
* Generated at: 2026-07-18T01:30:24.120Z
|
|
7
7
|
* Do not edit manually -- run "npm run fetch:openapi" to regenerate.
|
|
8
8
|
*/
|
|
9
9
|
exports.polymarketDataSpec = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Auto-generated from /home/runner/work/pmxt/pmxt/core/specs/polymarket/PolymarketGammaAPI.yaml
|
|
3
|
-
* Generated at: 2026-07-
|
|
3
|
+
* Generated at: 2026-07-18T01:30:24.118Z
|
|
4
4
|
* Do not edit manually -- run "npm run fetch:openapi" to regenerate.
|
|
5
5
|
*/
|
|
6
6
|
export declare const polymarketGammaSpec: {
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.polymarketGammaSpec = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* Auto-generated from /home/runner/work/pmxt/pmxt/core/specs/polymarket/PolymarketGammaAPI.yaml
|
|
6
|
-
* Generated at: 2026-07-
|
|
6
|
+
* Generated at: 2026-07-18T01:30:24.118Z
|
|
7
7
|
* Do not edit manually -- run "npm run fetch:openapi" to regenerate.
|
|
8
8
|
*/
|
|
9
9
|
exports.polymarketGammaSpec = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Auto-generated from /home/runner/work/pmxt/pmxt/core/specs/probable/probable.yaml
|
|
3
|
-
* Generated at: 2026-07-
|
|
3
|
+
* Generated at: 2026-07-18T01:30:24.140Z
|
|
4
4
|
* Do not edit manually -- run "npm run fetch:openapi" to regenerate.
|
|
5
5
|
*/
|
|
6
6
|
export declare const probableApiSpec: {
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.probableApiSpec = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* Auto-generated from /home/runner/work/pmxt/pmxt/core/specs/probable/probable.yaml
|
|
6
|
-
* Generated at: 2026-07-
|
|
6
|
+
* Generated at: 2026-07-18T01:30:24.140Z
|
|
7
7
|
* Do not edit manually -- run "npm run fetch:openapi" to regenerate.
|
|
8
8
|
*/
|
|
9
9
|
exports.probableApiSpec = {
|
package/dist/router/types.d.ts
CHANGED
|
@@ -48,6 +48,19 @@ export interface ArbitrageOpportunity {
|
|
|
48
48
|
/** Match confidence score (0.0 to 1.0). */
|
|
49
49
|
confidence?: number;
|
|
50
50
|
}
|
|
51
|
+
/**
|
|
52
|
+
* Parameters for comparing market prices across venues.
|
|
53
|
+
*/
|
|
54
|
+
export interface CompareMarketPricesParams {
|
|
55
|
+
/** The source market ID to compare against. */
|
|
56
|
+
marketId: string;
|
|
57
|
+
/** Optional list of target market IDs to compare with. If not provided, the router finds matches automatically. */
|
|
58
|
+
targetMarketIds?: string[];
|
|
59
|
+
/** Minimum price difference to return. */
|
|
60
|
+
minDifference?: number;
|
|
61
|
+
/** Maximum number of results to return. */
|
|
62
|
+
limit?: number;
|
|
63
|
+
}
|
|
51
64
|
export interface FetchMarketMatchesParams {
|
|
52
65
|
/** Keyword search across matched market titles. */
|
|
53
66
|
query?: string;
|
package/dist/server/openapi.yaml
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmxt-core",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.53.1",
|
|
4
4
|
"description": "Local sidecar API for supported prediction markets.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"test": "jest -c jest.config.js",
|
|
30
30
|
"server": "tsx watch src/server/index.ts",
|
|
31
31
|
"server:prod": "node dist/server/index.js",
|
|
32
|
-
"generate:sdk:python": "npx @openapitools/openapi-generator-cli generate -i src/server/openapi.yaml -g python -o ../sdks/python/generated --package-name pmxt_internal --additional-properties=projectName=pmxt-internal,packageVersion=2.
|
|
33
|
-
"generate:sdk:typescript": "npx @openapitools/openapi-generator-cli generate -i src/server/openapi.yaml -g typescript-fetch -o ../sdks/typescript/generated --additional-properties=npmName=pmxtjs,npmVersion=2.
|
|
32
|
+
"generate:sdk:python": "npx @openapitools/openapi-generator-cli generate -i src/server/openapi.yaml -g python -o ../sdks/python/generated --package-name pmxt_internal --additional-properties=projectName=pmxt-internal,packageVersion=2.53.1,library=urllib3",
|
|
33
|
+
"generate:sdk:typescript": "npx @openapitools/openapi-generator-cli generate -i src/server/openapi.yaml -g typescript-fetch -o ../sdks/typescript/generated --additional-properties=npmName=pmxtjs,npmVersion=2.53.1,supportsES6=true,typescriptThreePlus=true && node ../sdks/typescript/scripts/fix-generated.js",
|
|
34
34
|
"fetch:openapi": "node scripts/fetch-openapi-specs.js",
|
|
35
35
|
"extract:jsdoc": "node ../scripts/extract-jsdoc.js",
|
|
36
36
|
"generate:docs": "npm run extract:jsdoc && node ../scripts/generate-api-docs.js",
|