@oddmaki-protocol/sdk 1.7.0 → 1.9.0

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/index.d.mts CHANGED
@@ -9092,9 +9092,31 @@ declare class PublicModule extends BaseModule {
9092
9092
  }): Promise<any>;
9093
9093
  /**
9094
9094
  * Merge and sort unified feed results
9095
- * Combines standaloneMarkets and marketGroups into a single sorted array
9095
+ * Combines standaloneMarkets, marketGroups, and priceMarketSeries into a single sorted array.
9096
+ * Each row in the merged feed carries a `type` discriminator: 'standalone' | 'group' | 'series'.
9096
9097
  */
9097
9098
  mergeAndSortFeed(feedData: any, sortBy?: 'created' | 'volume', limit?: number): Array<any>;
9099
+ /**
9100
+ * Get a PriceMarketSeries with all its member markets.
9101
+ *
9102
+ * Used by the market detail page to render the time-button navigation strip
9103
+ * showing past, current, and upcoming windows for the same asset+interval.
9104
+ *
9105
+ * @param params.venueId - Venue the series belongs to
9106
+ * @param params.seriesKey - Series key, e.g. "btc-updown-5m"
9107
+ * @returns The series with `markets` array, or null if not found
9108
+ */
9109
+ getPriceMarketSeries(params: {
9110
+ venueId: bigint;
9111
+ seriesKey: string;
9112
+ }): Promise<any | null>;
9113
+ /**
9114
+ * Helper: extract the seriesKey from a market's tags.
9115
+ *
9116
+ * A market belongs to a price series iff its tags contain both "price-market"
9117
+ * and a "series:<key>" tag. Returns the key (without prefix) or null.
9118
+ */
9119
+ extractSeriesKey(tags: string[] | undefined | null): string | null;
9098
9120
  /**
9099
9121
  * Calculate probability for a market using mark price waterfall.
9100
9122
  * Returns probability as a decimal string (e.g., "0.65" for 65%)
@@ -17345,6 +17367,11 @@ declare const GET_ALL_MARKETS_FEED: string;
17345
17367
  * Get all markets across all venues sorted by volume
17346
17368
  */
17347
17369
  declare const GET_ALL_MARKETS_FEED_BY_VOLUME: string;
17370
+ /**
17371
+ * Get a single PriceMarketSeries with all its member markets, ordered by closeTime.
17372
+ * Used by the market detail page to render the time-button navigation strip.
17373
+ */
17374
+ declare const GET_PRICE_MARKET_SERIES: string;
17348
17375
  /**
17349
17376
  * Get recent trades across all venues (for activity feed / ticker)
17350
17377
  */
@@ -17447,4 +17474,4 @@ declare function parseMetadata<T extends {
17447
17474
 
17448
17475
  declare const version = "0.1.0";
17449
17476
 
17450
- export { AccessControlFacet as AccessControlFacetABI, AccessControlModule, BatchOrdersFacet as BatchOrdersFacetABI, CONTRACT_ADDRESSES, type ChancePercentInput, ConditionalTokens as ConditionalTokensABI, DEFAULT_CHAIN, ERC20 as ERC20ABI, FeedProvider, GET_ALL_MARKETS_FEED, GET_ALL_MARKETS_FEED_BY_VOLUME, GET_CHART_TRADES, GET_CHART_TRADES_ALL, GET_GROUP_MARKETS, GET_LEADERBOARD, GET_MARKET, GET_MARKETS, GET_MARKETS_WITH_PRICING, GET_MARKET_GROUP, GET_MARKET_GROUPS, GET_MARKET_GROUP_ITEM, GET_MARKET_TOP_HOLDERS, GET_ORDERS, GET_PROTOCOL_STATS, GET_QUESTION, GET_QUESTIONS, GET_RECENT_MARKETS, GET_RECENT_TRADES, GET_TOP_OF_BOOK, GET_TRADER_CLOSED_POSITIONS, GET_TRADER_FILLS, GET_TRADER_POSITIONS, GET_TRADER_PROFILE, GET_TRADES, GET_UNIFIED_MARKET_FEED, GET_UNIFIED_MARKET_FEED_BY_VOLUME, GET_USER, GET_VENUES, LimitOrdersFacet as LimitOrdersFacetABI, MarketGroupFacet as MarketGroupFacetABI, type MarketMetadata, MarketModule, MarketOrdersFacet as MarketOrdersFacetABI, type MarketQuestion, type MarketStatus, MarketsFacet as MarketsFacetABI, MatchingFacet as MatchingFacetABI, MetadataFacet as MetadataFacetABI, NegRiskFacet as NegRiskFacetABI, OddMakiClient, type OddMakiClientConfig, type OddMakiConfig, OrderBookFacet as OrderBookFacetABI, PROTOCOL_FEES, type PriceMarketData, PriceMarketFacet as PriceMarketFacetABI, PriceMarketModule, ProtocolFacet as ProtocolFacetABI, PublicModule, PythResolutionFacet as PythResolutionFacetABI, type PythUpdate, ResolutionFacet as ResolutionFacetABI, SUBGRAPH_IDS, SubgraphClient, type SubgraphMarketPriceData, TICK_SIZE_FINE, TICK_SIZE_STANDARD, TagsFacet as TagsFacetABI, TokenModule, type TopOfBookEntry, TradeModule, UMA_DEFAULTS, UmaModule, UmaOracle as UmaOracleABI, VALID_TICK_SIZES, VaultFacet as VaultFacetABI, VenueFacet as VenueFacetABI, type VenueMetadata, VenueModule, WhitelistAccessControl as WhitelistAccessControlABI, buildSubgraphGatewayUrl, calculateChancePercent, clearDecimalsCache, createExpiry, createOddMakiClient, formatAmount, formatAncillaryData, formatTimestamp, getCachedTokenDecimals, getOutcomePrice, getTokenDecimals, isValidTickSize, parseAmount, parseAncillaryData, parseMetadata, parseTokenAmount, priceToTick, resolveIPFSUri, tickToPercentage, tickToPrice, version };
17477
+ export { AccessControlFacet as AccessControlFacetABI, AccessControlModule, BatchOrdersFacet as BatchOrdersFacetABI, CONTRACT_ADDRESSES, type ChancePercentInput, ConditionalTokens as ConditionalTokensABI, DEFAULT_CHAIN, ERC20 as ERC20ABI, FeedProvider, GET_ALL_MARKETS_FEED, GET_ALL_MARKETS_FEED_BY_VOLUME, GET_CHART_TRADES, GET_CHART_TRADES_ALL, GET_GROUP_MARKETS, GET_LEADERBOARD, GET_MARKET, GET_MARKETS, GET_MARKETS_WITH_PRICING, GET_MARKET_GROUP, GET_MARKET_GROUPS, GET_MARKET_GROUP_ITEM, GET_MARKET_TOP_HOLDERS, GET_ORDERS, GET_PRICE_MARKET_SERIES, GET_PROTOCOL_STATS, GET_QUESTION, GET_QUESTIONS, GET_RECENT_MARKETS, GET_RECENT_TRADES, GET_TOP_OF_BOOK, GET_TRADER_CLOSED_POSITIONS, GET_TRADER_FILLS, GET_TRADER_POSITIONS, GET_TRADER_PROFILE, GET_TRADES, GET_UNIFIED_MARKET_FEED, GET_UNIFIED_MARKET_FEED_BY_VOLUME, GET_USER, GET_VENUES, LimitOrdersFacet as LimitOrdersFacetABI, MarketGroupFacet as MarketGroupFacetABI, type MarketMetadata, MarketModule, MarketOrdersFacet as MarketOrdersFacetABI, type MarketQuestion, type MarketStatus, MarketsFacet as MarketsFacetABI, MatchingFacet as MatchingFacetABI, MetadataFacet as MetadataFacetABI, NegRiskFacet as NegRiskFacetABI, OddMakiClient, type OddMakiClientConfig, type OddMakiConfig, OrderBookFacet as OrderBookFacetABI, PROTOCOL_FEES, type PriceMarketData, PriceMarketFacet as PriceMarketFacetABI, PriceMarketModule, ProtocolFacet as ProtocolFacetABI, PublicModule, PythResolutionFacet as PythResolutionFacetABI, type PythUpdate, ResolutionFacet as ResolutionFacetABI, SUBGRAPH_IDS, SubgraphClient, type SubgraphMarketPriceData, TICK_SIZE_FINE, TICK_SIZE_STANDARD, TagsFacet as TagsFacetABI, TokenModule, type TopOfBookEntry, TradeModule, UMA_DEFAULTS, UmaModule, UmaOracle as UmaOracleABI, VALID_TICK_SIZES, VaultFacet as VaultFacetABI, VenueFacet as VenueFacetABI, type VenueMetadata, VenueModule, WhitelistAccessControl as WhitelistAccessControlABI, buildSubgraphGatewayUrl, calculateChancePercent, clearDecimalsCache, createExpiry, createOddMakiClient, formatAmount, formatAncillaryData, formatTimestamp, getCachedTokenDecimals, getOutcomePrice, getTokenDecimals, isValidTickSize, parseAmount, parseAncillaryData, parseMetadata, parseTokenAmount, priceToTick, resolveIPFSUri, tickToPercentage, tickToPrice, version };
package/dist/index.d.ts CHANGED
@@ -9092,9 +9092,31 @@ declare class PublicModule extends BaseModule {
9092
9092
  }): Promise<any>;
9093
9093
  /**
9094
9094
  * Merge and sort unified feed results
9095
- * Combines standaloneMarkets and marketGroups into a single sorted array
9095
+ * Combines standaloneMarkets, marketGroups, and priceMarketSeries into a single sorted array.
9096
+ * Each row in the merged feed carries a `type` discriminator: 'standalone' | 'group' | 'series'.
9096
9097
  */
9097
9098
  mergeAndSortFeed(feedData: any, sortBy?: 'created' | 'volume', limit?: number): Array<any>;
9099
+ /**
9100
+ * Get a PriceMarketSeries with all its member markets.
9101
+ *
9102
+ * Used by the market detail page to render the time-button navigation strip
9103
+ * showing past, current, and upcoming windows for the same asset+interval.
9104
+ *
9105
+ * @param params.venueId - Venue the series belongs to
9106
+ * @param params.seriesKey - Series key, e.g. "btc-updown-5m"
9107
+ * @returns The series with `markets` array, or null if not found
9108
+ */
9109
+ getPriceMarketSeries(params: {
9110
+ venueId: bigint;
9111
+ seriesKey: string;
9112
+ }): Promise<any | null>;
9113
+ /**
9114
+ * Helper: extract the seriesKey from a market's tags.
9115
+ *
9116
+ * A market belongs to a price series iff its tags contain both "price-market"
9117
+ * and a "series:<key>" tag. Returns the key (without prefix) or null.
9118
+ */
9119
+ extractSeriesKey(tags: string[] | undefined | null): string | null;
9098
9120
  /**
9099
9121
  * Calculate probability for a market using mark price waterfall.
9100
9122
  * Returns probability as a decimal string (e.g., "0.65" for 65%)
@@ -17345,6 +17367,11 @@ declare const GET_ALL_MARKETS_FEED: string;
17345
17367
  * Get all markets across all venues sorted by volume
17346
17368
  */
17347
17369
  declare const GET_ALL_MARKETS_FEED_BY_VOLUME: string;
17370
+ /**
17371
+ * Get a single PriceMarketSeries with all its member markets, ordered by closeTime.
17372
+ * Used by the market detail page to render the time-button navigation strip.
17373
+ */
17374
+ declare const GET_PRICE_MARKET_SERIES: string;
17348
17375
  /**
17349
17376
  * Get recent trades across all venues (for activity feed / ticker)
17350
17377
  */
@@ -17447,4 +17474,4 @@ declare function parseMetadata<T extends {
17447
17474
 
17448
17475
  declare const version = "0.1.0";
17449
17476
 
17450
- export { AccessControlFacet as AccessControlFacetABI, AccessControlModule, BatchOrdersFacet as BatchOrdersFacetABI, CONTRACT_ADDRESSES, type ChancePercentInput, ConditionalTokens as ConditionalTokensABI, DEFAULT_CHAIN, ERC20 as ERC20ABI, FeedProvider, GET_ALL_MARKETS_FEED, GET_ALL_MARKETS_FEED_BY_VOLUME, GET_CHART_TRADES, GET_CHART_TRADES_ALL, GET_GROUP_MARKETS, GET_LEADERBOARD, GET_MARKET, GET_MARKETS, GET_MARKETS_WITH_PRICING, GET_MARKET_GROUP, GET_MARKET_GROUPS, GET_MARKET_GROUP_ITEM, GET_MARKET_TOP_HOLDERS, GET_ORDERS, GET_PROTOCOL_STATS, GET_QUESTION, GET_QUESTIONS, GET_RECENT_MARKETS, GET_RECENT_TRADES, GET_TOP_OF_BOOK, GET_TRADER_CLOSED_POSITIONS, GET_TRADER_FILLS, GET_TRADER_POSITIONS, GET_TRADER_PROFILE, GET_TRADES, GET_UNIFIED_MARKET_FEED, GET_UNIFIED_MARKET_FEED_BY_VOLUME, GET_USER, GET_VENUES, LimitOrdersFacet as LimitOrdersFacetABI, MarketGroupFacet as MarketGroupFacetABI, type MarketMetadata, MarketModule, MarketOrdersFacet as MarketOrdersFacetABI, type MarketQuestion, type MarketStatus, MarketsFacet as MarketsFacetABI, MatchingFacet as MatchingFacetABI, MetadataFacet as MetadataFacetABI, NegRiskFacet as NegRiskFacetABI, OddMakiClient, type OddMakiClientConfig, type OddMakiConfig, OrderBookFacet as OrderBookFacetABI, PROTOCOL_FEES, type PriceMarketData, PriceMarketFacet as PriceMarketFacetABI, PriceMarketModule, ProtocolFacet as ProtocolFacetABI, PublicModule, PythResolutionFacet as PythResolutionFacetABI, type PythUpdate, ResolutionFacet as ResolutionFacetABI, SUBGRAPH_IDS, SubgraphClient, type SubgraphMarketPriceData, TICK_SIZE_FINE, TICK_SIZE_STANDARD, TagsFacet as TagsFacetABI, TokenModule, type TopOfBookEntry, TradeModule, UMA_DEFAULTS, UmaModule, UmaOracle as UmaOracleABI, VALID_TICK_SIZES, VaultFacet as VaultFacetABI, VenueFacet as VenueFacetABI, type VenueMetadata, VenueModule, WhitelistAccessControl as WhitelistAccessControlABI, buildSubgraphGatewayUrl, calculateChancePercent, clearDecimalsCache, createExpiry, createOddMakiClient, formatAmount, formatAncillaryData, formatTimestamp, getCachedTokenDecimals, getOutcomePrice, getTokenDecimals, isValidTickSize, parseAmount, parseAncillaryData, parseMetadata, parseTokenAmount, priceToTick, resolveIPFSUri, tickToPercentage, tickToPrice, version };
17477
+ export { AccessControlFacet as AccessControlFacetABI, AccessControlModule, BatchOrdersFacet as BatchOrdersFacetABI, CONTRACT_ADDRESSES, type ChancePercentInput, ConditionalTokens as ConditionalTokensABI, DEFAULT_CHAIN, ERC20 as ERC20ABI, FeedProvider, GET_ALL_MARKETS_FEED, GET_ALL_MARKETS_FEED_BY_VOLUME, GET_CHART_TRADES, GET_CHART_TRADES_ALL, GET_GROUP_MARKETS, GET_LEADERBOARD, GET_MARKET, GET_MARKETS, GET_MARKETS_WITH_PRICING, GET_MARKET_GROUP, GET_MARKET_GROUPS, GET_MARKET_GROUP_ITEM, GET_MARKET_TOP_HOLDERS, GET_ORDERS, GET_PRICE_MARKET_SERIES, GET_PROTOCOL_STATS, GET_QUESTION, GET_QUESTIONS, GET_RECENT_MARKETS, GET_RECENT_TRADES, GET_TOP_OF_BOOK, GET_TRADER_CLOSED_POSITIONS, GET_TRADER_FILLS, GET_TRADER_POSITIONS, GET_TRADER_PROFILE, GET_TRADES, GET_UNIFIED_MARKET_FEED, GET_UNIFIED_MARKET_FEED_BY_VOLUME, GET_USER, GET_VENUES, LimitOrdersFacet as LimitOrdersFacetABI, MarketGroupFacet as MarketGroupFacetABI, type MarketMetadata, MarketModule, MarketOrdersFacet as MarketOrdersFacetABI, type MarketQuestion, type MarketStatus, MarketsFacet as MarketsFacetABI, MatchingFacet as MatchingFacetABI, MetadataFacet as MetadataFacetABI, NegRiskFacet as NegRiskFacetABI, OddMakiClient, type OddMakiClientConfig, type OddMakiConfig, OrderBookFacet as OrderBookFacetABI, PROTOCOL_FEES, type PriceMarketData, PriceMarketFacet as PriceMarketFacetABI, PriceMarketModule, ProtocolFacet as ProtocolFacetABI, PublicModule, PythResolutionFacet as PythResolutionFacetABI, type PythUpdate, ResolutionFacet as ResolutionFacetABI, SUBGRAPH_IDS, SubgraphClient, type SubgraphMarketPriceData, TICK_SIZE_FINE, TICK_SIZE_STANDARD, TagsFacet as TagsFacetABI, TokenModule, type TopOfBookEntry, TradeModule, UMA_DEFAULTS, UmaModule, UmaOracle as UmaOracleABI, VALID_TICK_SIZES, VaultFacet as VaultFacetABI, VenueFacet as VenueFacetABI, type VenueMetadata, VenueModule, WhitelistAccessControl as WhitelistAccessControlABI, buildSubgraphGatewayUrl, calculateChancePercent, clearDecimalsCache, createExpiry, createOddMakiClient, formatAmount, formatAncillaryData, formatTimestamp, getCachedTokenDecimals, getOutcomePrice, getTokenDecimals, isValidTickSize, parseAmount, parseAncillaryData, parseMetadata, parseTokenAmount, priceToTick, resolveIPFSUri, tickToPercentage, tickToPrice, version };
package/dist/index.js CHANGED
@@ -9290,9 +9290,14 @@ var GET_UNIFIED_MARKET_FEED = graphqlRequest.gql`
9290
9290
  $first: Int = 50
9291
9291
  $skip: Int = 0
9292
9292
  ) {
9293
- # Standalone binary markets (not in groups)
9293
+ # Standalone binary markets (not in groups, not part of a price series)
9294
9294
  standaloneMarkets: markets(
9295
- where: { groupId: "0", venue_: { venueId: $venueId }, status_not: "Draft" }
9295
+ where: {
9296
+ groupId: "0"
9297
+ venue_: { venueId: $venueId }
9298
+ status_not: "Draft"
9299
+ priceSeries: null
9300
+ }
9296
9301
  first: $first
9297
9302
  skip: $skip
9298
9303
  orderBy: createdAt
@@ -9387,6 +9392,62 @@ var GET_UNIFIED_MARKET_FEED = graphqlRequest.gql`
9387
9392
  }
9388
9393
  }
9389
9394
  }
9395
+
9396
+ # Price market series — one row per (venue, seriesKey)
9397
+ priceMarketSeries(
9398
+ where: { venue_: { venueId: $venueId }, status_not: "Resolved" }
9399
+ first: $first
9400
+ skip: $skip
9401
+ orderBy: updatedAt
9402
+ orderDirection: desc
9403
+ ) {
9404
+ id
9405
+ seriesKey
9406
+ asset
9407
+ kind
9408
+ interval
9409
+ intervalSeconds
9410
+ status
9411
+ tags
9412
+ createdAt
9413
+ updatedAt
9414
+ currentMarket {
9415
+ id
9416
+ marketId
9417
+ question
9418
+ outcomes
9419
+ status
9420
+ collateralToken
9421
+ conditionId
9422
+ tickSize
9423
+ lastPriceTick_0
9424
+ lastPriceTick_1
9425
+ lastTradeTimestamp
9426
+ lastTradeTimestamp_0
9427
+ lastTradeTimestamp_1
9428
+ topOfBook {
9429
+ outcome
9430
+ side
9431
+ topTick
9432
+ }
9433
+ totalVolume
9434
+ metadataURI
9435
+ createdAt
9436
+ priceMarket {
9437
+ provider
9438
+ feedId
9439
+ strikePrice
9440
+ priceExpo
9441
+ openTime
9442
+ closeTime
9443
+ }
9444
+ }
9445
+ venue {
9446
+ id
9447
+ venueId
9448
+ name
9449
+ }
9450
+ }
9390
9451
  }
9391
9452
  `;
9392
9453
  var GET_UNIFIED_MARKET_FEED_BY_VOLUME = graphqlRequest.gql`
@@ -9395,9 +9456,14 @@ var GET_UNIFIED_MARKET_FEED_BY_VOLUME = graphqlRequest.gql`
9395
9456
  $first: Int = 50
9396
9457
  $skip: Int = 0
9397
9458
  ) {
9398
- # Standalone binary markets sorted by volume
9459
+ # Standalone binary markets sorted by volume (excluding price series members)
9399
9460
  standaloneMarkets: markets(
9400
- where: { groupId: "0", venue_: { venueId: $venueId }, status_not: "Draft" }
9461
+ where: {
9462
+ groupId: "0"
9463
+ venue_: { venueId: $venueId }
9464
+ status_not: "Draft"
9465
+ priceSeries: null
9466
+ }
9401
9467
  first: $first
9402
9468
  skip: $skip
9403
9469
  orderBy: totalVolume
@@ -9479,13 +9545,68 @@ var GET_UNIFIED_MARKET_FEED_BY_VOLUME = graphqlRequest.gql`
9479
9545
  }
9480
9546
  }
9481
9547
  }
9548
+
9549
+ # Price market series — venue-scoped, only those with an active current market
9550
+ priceMarketSeries(
9551
+ where: { venue_: { venueId: $venueId }, status_not: "Resolved" }
9552
+ first: $first
9553
+ skip: $skip
9554
+ orderBy: updatedAt
9555
+ orderDirection: desc
9556
+ ) {
9557
+ id
9558
+ seriesKey
9559
+ asset
9560
+ kind
9561
+ interval
9562
+ intervalSeconds
9563
+ status
9564
+ tags
9565
+ createdAt
9566
+ updatedAt
9567
+ currentMarket {
9568
+ id
9569
+ marketId
9570
+ question
9571
+ outcomes
9572
+ status
9573
+ collateralToken
9574
+ tickSize
9575
+ lastPriceTick_0
9576
+ lastPriceTick_1
9577
+ lastTradeTimestamp
9578
+ lastTradeTimestamp_0
9579
+ lastTradeTimestamp_1
9580
+ topOfBook {
9581
+ outcome
9582
+ side
9583
+ topTick
9584
+ }
9585
+ totalVolume
9586
+ metadataURI
9587
+ createdAt
9588
+ priceMarket {
9589
+ provider
9590
+ feedId
9591
+ strikePrice
9592
+ priceExpo
9593
+ openTime
9594
+ closeTime
9595
+ }
9596
+ }
9597
+ venue {
9598
+ id
9599
+ venueId
9600
+ name
9601
+ }
9602
+ }
9482
9603
  }
9483
9604
  `;
9484
9605
  var GET_ALL_MARKETS_FEED = graphqlRequest.gql`
9485
9606
  query GetAllMarketsFeed($first: Int = 50, $skip: Int = 0) {
9486
- # Standalone binary markets (not in groups)
9607
+ # Standalone binary markets (not in groups, not part of a price series)
9487
9608
  standaloneMarkets: markets(
9488
- where: { groupId: "0", status_not: "Draft" }
9609
+ where: { groupId: "0", status_not: "Draft", priceSeries: null }
9489
9610
  first: $first
9490
9611
  skip: $skip
9491
9612
  orderBy: createdAt
@@ -9574,12 +9695,64 @@ var GET_ALL_MARKETS_FEED = graphqlRequest.gql`
9574
9695
  }
9575
9696
  }
9576
9697
  }
9698
+
9699
+ # Price market series across all venues
9700
+ priceMarketSeries(
9701
+ where: { status_not: "Resolved" }
9702
+ first: $first
9703
+ skip: $skip
9704
+ orderBy: updatedAt
9705
+ orderDirection: desc
9706
+ ) {
9707
+ id
9708
+ seriesKey
9709
+ asset
9710
+ kind
9711
+ interval
9712
+ intervalSeconds
9713
+ status
9714
+ tags
9715
+ createdAt
9716
+ updatedAt
9717
+ currentMarket {
9718
+ id
9719
+ marketId
9720
+ question
9721
+ outcomes
9722
+ status
9723
+ collateralToken
9724
+ tickSize
9725
+ lastPriceTick_0
9726
+ lastPriceTick_1
9727
+ lastTradeTimestamp
9728
+ topOfBook {
9729
+ outcome
9730
+ side
9731
+ topTick
9732
+ }
9733
+ totalVolume
9734
+ createdAt
9735
+ priceMarket {
9736
+ provider
9737
+ feedId
9738
+ strikePrice
9739
+ priceExpo
9740
+ openTime
9741
+ closeTime
9742
+ }
9743
+ }
9744
+ venue {
9745
+ id
9746
+ venueId
9747
+ name
9748
+ }
9749
+ }
9577
9750
  }
9578
9751
  `;
9579
9752
  var GET_ALL_MARKETS_FEED_BY_VOLUME = graphqlRequest.gql`
9580
9753
  query GetAllMarketsFeedByVolume($first: Int = 50, $skip: Int = 0) {
9581
9754
  standaloneMarkets: markets(
9582
- where: { groupId: "0", status_not: "Draft" }
9755
+ where: { groupId: "0", status_not: "Draft", priceSeries: null }
9583
9756
  first: $first
9584
9757
  skip: $skip
9585
9758
  orderBy: totalVolume
@@ -9663,6 +9836,102 @@ var GET_ALL_MARKETS_FEED_BY_VOLUME = graphqlRequest.gql`
9663
9836
  }
9664
9837
  }
9665
9838
  }
9839
+
9840
+ # Price market series across all venues, sorted by volume of current market
9841
+ priceMarketSeries(
9842
+ where: { status_not: "Resolved" }
9843
+ first: $first
9844
+ skip: $skip
9845
+ orderBy: updatedAt
9846
+ orderDirection: desc
9847
+ ) {
9848
+ id
9849
+ seriesKey
9850
+ asset
9851
+ kind
9852
+ interval
9853
+ intervalSeconds
9854
+ status
9855
+ tags
9856
+ createdAt
9857
+ updatedAt
9858
+ currentMarket {
9859
+ id
9860
+ marketId
9861
+ question
9862
+ outcomes
9863
+ status
9864
+ collateralToken
9865
+ tickSize
9866
+ lastPriceTick_0
9867
+ lastPriceTick_1
9868
+ lastTradeTimestamp
9869
+ topOfBook {
9870
+ outcome
9871
+ side
9872
+ topTick
9873
+ }
9874
+ totalVolume
9875
+ createdAt
9876
+ priceMarket {
9877
+ provider
9878
+ feedId
9879
+ strikePrice
9880
+ priceExpo
9881
+ openTime
9882
+ closeTime
9883
+ }
9884
+ }
9885
+ venue {
9886
+ id
9887
+ venueId
9888
+ name
9889
+ }
9890
+ }
9891
+ }
9892
+ `;
9893
+ var GET_PRICE_MARKET_SERIES = graphqlRequest.gql`
9894
+ query GetPriceMarketSeries($venueId: BigInt!, $seriesKey: String!) {
9895
+ priceMarketSeries(
9896
+ where: { venue_: { venueId: $venueId }, seriesKey: $seriesKey }
9897
+ first: 1
9898
+ ) {
9899
+ id
9900
+ seriesKey
9901
+ asset
9902
+ kind
9903
+ interval
9904
+ intervalSeconds
9905
+ status
9906
+ tags
9907
+ createdAt
9908
+ updatedAt
9909
+ currentMarket {
9910
+ id
9911
+ marketId
9912
+ }
9913
+ venue {
9914
+ id
9915
+ venueId
9916
+ name
9917
+ }
9918
+ markets(first: 1000, orderBy: marketId, orderDirection: asc) {
9919
+ id
9920
+ marketId
9921
+ question
9922
+ status
9923
+ resolvedOutcome
9924
+ outcomes
9925
+ priceMarket {
9926
+ openTime
9927
+ closeTime
9928
+ resolved
9929
+ outcome
9930
+ finalPrice
9931
+ strikePrice
9932
+ }
9933
+ }
9934
+ }
9666
9935
  }
9667
9936
  `;
9668
9937
  var GET_RECENT_TRADES = graphqlRequest.gql`
@@ -10108,7 +10377,8 @@ var PublicModule = class extends BaseModule {
10108
10377
  }
10109
10378
  /**
10110
10379
  * Merge and sort unified feed results
10111
- * Combines standaloneMarkets and marketGroups into a single sorted array
10380
+ * Combines standaloneMarkets, marketGroups, and priceMarketSeries into a single sorted array.
10381
+ * Each row in the merged feed carries a `type` discriminator: 'standalone' | 'group' | 'series'.
10112
10382
  */
10113
10383
  mergeAndSortFeed(feedData, sortBy = "created", limit) {
10114
10384
  const standalone = (feedData.standaloneMarkets || []).map((m) => ({
@@ -10128,11 +10398,49 @@ var PublicModule = class extends BaseModule {
10128
10398
  sortValue: sortBy === "volume" ? totalVolume : BigInt(g.createdAt || "0")
10129
10399
  };
10130
10400
  });
10131
- const merged = [...standalone, ...groups].sort((a, b) => {
10401
+ const series = (feedData.priceMarketSeries || []).map((s) => ({
10402
+ ...s,
10403
+ type: "series",
10404
+ sortValue: sortBy === "volume" ? BigInt(s.currentMarket?.totalVolume || "0") : BigInt(s.updatedAt || s.createdAt || "0")
10405
+ }));
10406
+ const merged = [...standalone, ...groups, ...series].sort((a, b) => {
10132
10407
  return a.sortValue > b.sortValue ? -1 : 1;
10133
10408
  });
10134
10409
  return limit ? merged.slice(0, limit) : merged;
10135
10410
  }
10411
+ /**
10412
+ * Get a PriceMarketSeries with all its member markets.
10413
+ *
10414
+ * Used by the market detail page to render the time-button navigation strip
10415
+ * showing past, current, and upcoming windows for the same asset+interval.
10416
+ *
10417
+ * @param params.venueId - Venue the series belongs to
10418
+ * @param params.seriesKey - Series key, e.g. "btc-updown-5m"
10419
+ * @returns The series with `markets` array, or null if not found
10420
+ */
10421
+ async getPriceMarketSeries(params) {
10422
+ const response = await this.subgraph.request(GET_PRICE_MARKET_SERIES, {
10423
+ venueId: params.venueId.toString(),
10424
+ seriesKey: params.seriesKey
10425
+ });
10426
+ return response.priceMarketSeries?.[0] || null;
10427
+ }
10428
+ /**
10429
+ * Helper: extract the seriesKey from a market's tags.
10430
+ *
10431
+ * A market belongs to a price series iff its tags contain both "price-market"
10432
+ * and a "series:<key>" tag. Returns the key (without prefix) or null.
10433
+ */
10434
+ extractSeriesKey(tags) {
10435
+ if (!tags) return null;
10436
+ let hasPriceMarketTag = false;
10437
+ let seriesKey = null;
10438
+ for (const t of tags) {
10439
+ if (t === "price-market") hasPriceMarketTag = true;
10440
+ else if (t.startsWith("series:")) seriesKey = t.slice("series:".length);
10441
+ }
10442
+ return hasPriceMarketTag ? seriesKey : null;
10443
+ }
10136
10444
  /**
10137
10445
  * Calculate probability for a market using mark price waterfall.
10138
10446
  * Returns probability as a decimal string (e.g., "0.65" for 65%)
@@ -11617,6 +11925,7 @@ exports.GET_MARKET_GROUPS = GET_MARKET_GROUPS;
11617
11925
  exports.GET_MARKET_GROUP_ITEM = GET_MARKET_GROUP_ITEM;
11618
11926
  exports.GET_MARKET_TOP_HOLDERS = GET_MARKET_TOP_HOLDERS;
11619
11927
  exports.GET_ORDERS = GET_ORDERS;
11928
+ exports.GET_PRICE_MARKET_SERIES = GET_PRICE_MARKET_SERIES;
11620
11929
  exports.GET_PROTOCOL_STATS = GET_PROTOCOL_STATS;
11621
11930
  exports.GET_QUESTION = GET_QUESTION;
11622
11931
  exports.GET_QUESTIONS = GET_QUESTIONS;