@usherlabs/cex-broker 0.2.49 → 0.2.50

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.
@@ -25307,7 +25307,8 @@ var result_schema_default = {
25307
25307
  // src/helpers/market-data-vendor-backfill/manifests.ts
25308
25308
  var LEGACY_CAPABILITY_POLICY_ID = "market-data-vendor-backfill-capabilities/v1";
25309
25309
  var CAPABILITY_POLICY_ID = "market-data-vendor-backfill-capabilities/v2";
25310
- var RESOURCE_POLICY_ID = "market-data-vendor-backfill-resources/v1";
25310
+ var LEGACY_RESOURCE_POLICY_ID = "market-data-vendor-backfill-resources/v1";
25311
+ var RESOURCE_POLICY_ID = "market-data-vendor-backfill-resources/v2";
25311
25312
  var ADAPTER_POLICY_ID = "cryptohftdata-orderbook-adapter/v1";
25312
25313
  var ACQUISITION_POLICY_ID = "cryptohftdata-hourly-acquisition/v1";
25313
25314
  var legacyCapabilityPolicyContent = {
@@ -25344,17 +25345,30 @@ var LEGACY_CAPABILITY_POLICY = Object.freeze({
25344
25345
  var capabilityPolicyContent = {
25345
25346
  ...legacyCapabilityPolicyContent,
25346
25347
  policy_id: CAPABILITY_POLICY_ID,
25347
- profiles: legacyCapabilityPolicyContent.profiles.map((profile) => ({
25348
- ...profile,
25349
- source_policies: ["authoritative_window", "fill_gaps"]
25350
- }))
25348
+ profiles: [
25349
+ ...legacyCapabilityPolicyContent.profiles.map((profile) => ({
25350
+ ...profile,
25351
+ source_policies: ["authoritative_window", "fill_gaps"]
25352
+ })),
25353
+ {
25354
+ exchange: "okx",
25355
+ market_type: "spot",
25356
+ feed: "ORDERBOOK",
25357
+ canonical_trading_pair: "ARB-USDC",
25358
+ provider_exchange_id: "okx_spot",
25359
+ resolved_symbol: "ARB-USDC",
25360
+ construction_modes: ["sampled_top_n_snapshot"],
25361
+ source_policies: ["authoritative_window", "fill_gaps"],
25362
+ max_depth: 400
25363
+ }
25364
+ ]
25351
25365
  };
25352
25366
  var CAPABILITY_POLICY = Object.freeze({
25353
25367
  ...capabilityPolicyContent,
25354
25368
  policy_sha256: jcsSha256(capabilityPolicyContent)
25355
25369
  });
25356
- var resourcePolicyContent = {
25357
- policy_id: RESOURCE_POLICY_ID,
25370
+ var legacyResourcePolicyContent = {
25371
+ policy_id: LEGACY_RESOURCE_POLICY_ID,
25358
25372
  limits: {
25359
25373
  max_files: 1e4,
25360
25374
  max_bytes: 100 * 1024 * 1024 * 1024,
@@ -25368,6 +25382,18 @@ var resourcePolicyContent = {
25368
25382
  max_required_events: 1e5
25369
25383
  }
25370
25384
  };
25385
+ var LEGACY_RESOURCE_POLICY = Object.freeze({
25386
+ ...legacyResourcePolicyContent,
25387
+ policy_sha256: jcsSha256(legacyResourcePolicyContent)
25388
+ });
25389
+ var resourcePolicyContent = {
25390
+ ...legacyResourcePolicyContent,
25391
+ policy_id: RESOURCE_POLICY_ID,
25392
+ request_bounds: {
25393
+ ...legacyResourcePolicyContent.request_bounds,
25394
+ max_window_ms: 31 * 24 * 60 * 60 * 1000
25395
+ }
25396
+ };
25371
25397
  var RESOURCE_POLICY = Object.freeze({
25372
25398
  ...resourcePolicyContent,
25373
25399
  policy_sha256: jcsSha256(resourcePolicyContent)
@@ -25546,7 +25572,11 @@ var backfillRequestCodec = {
25546
25572
  CAPABILITY_POLICY,
25547
25573
  LEGACY_CAPABILITY_POLICY
25548
25574
  ].some((policy) => request.product_pins.capability_policy.policy_id === policy.policy_id && request.product_pins.capability_policy.policy_sha256 === policy.policy_sha256);
25549
- if (!capabilityPolicyMatches || request.product_pins.resource_policy.policy_id !== RESOURCE_POLICY.policy_id || request.product_pins.resource_policy.policy_sha256 !== RESOURCE_POLICY.policy_sha256) {
25575
+ const resourcePolicyMatches = [
25576
+ RESOURCE_POLICY,
25577
+ LEGACY_RESOURCE_POLICY
25578
+ ].some((policy) => request.product_pins.resource_policy.policy_id === policy.policy_id && request.product_pins.resource_policy.policy_sha256 === policy.policy_sha256);
25579
+ if (!capabilityPolicyMatches || !resourcePolicyMatches) {
25550
25580
  throw new Error("request policy pins do not match the effective package policies");
25551
25581
  }
25552
25582
  if (request.required_clock.clock_id !== request.initial_selection.required_clock.clock_id || request.required_clock.clock_sha256 !== request.initial_selection.required_clock.clock_sha256 || request.required_clock.event_count !== request.initial_selection.required_clock.event_count) {
@@ -25661,6 +25691,10 @@ function decodeBackfillRunDocuments(input) {
25661
25691
  return targetTimeMs;
25662
25692
  });
25663
25693
  const capabilityProfile = CAPABILITY_POLICY.profiles.find((profile) => profile.exchange === wire.scope.exchange && profile.market_type === wire.scope.market_type && profile.feed === wire.scope.feed && profile.canonical_trading_pair === wire.scope.trading_pair);
25694
+ const resourcePolicy = [RESOURCE_POLICY, LEGACY_RESOURCE_POLICY].find((policy) => wire.product_pins.resource_policy.policy_id === policy.policy_id && wire.product_pins.resource_policy.policy_sha256 === policy.policy_sha256);
25695
+ if (!resourcePolicy) {
25696
+ throw new Error("request resource policy pin is unsupported");
25697
+ }
25664
25698
  return {
25665
25699
  schemaVersion: BACKFILL_REQUEST_SCHEMA_VERSION,
25666
25700
  requestId: wire.request_id,
@@ -25685,11 +25719,11 @@ function decodeBackfillRunDocuments(input) {
25685
25719
  maxPriorAsOfLagMs: wire.coverage_policy.max_asof_lag_ms,
25686
25720
  sourcePolicy: wire.source_policy,
25687
25721
  budgets: {
25688
- maxFiles: RESOURCE_POLICY.limits.max_files,
25689
- maxBytes: RESOURCE_POLICY.limits.max_bytes,
25690
- maxRows: RESOURCE_POLICY.limits.max_rows,
25691
- maxDurationMs: RESOURCE_POLICY.limits.max_duration_ms,
25692
- maxBoundaryLookbackMs: Math.min(RESOURCE_POLICY.limits.max_boundary_lookback_ms, CAPABILITY_POLICY.acquisition_policy.initialization_lookback_ms)
25722
+ maxFiles: resourcePolicy.limits.max_files,
25723
+ maxBytes: resourcePolicy.limits.max_bytes,
25724
+ maxRows: resourcePolicy.limits.max_rows,
25725
+ maxDurationMs: resourcePolicy.limits.max_duration_ms,
25726
+ maxBoundaryLookbackMs: Math.min(resourcePolicy.limits.max_boundary_lookback_ms, CAPABILITY_POLICY.acquisition_policy.initialization_lookback_ms)
25693
25727
  },
25694
25728
  expectedProduct: {
25695
25729
  packageName: "@usherlabs/cex-broker",
@@ -27232,8 +27266,8 @@ function validateReleaseIdentity(release) {
27232
27266
  }
27233
27267
  function bakedReleaseIdentity() {
27234
27268
  return validateReleaseIdentity({
27235
- packageVersion: "0.2.49",
27236
- gitHead: "c1ffe071e7696c5b17c8f058da01d61cb27ec8a4"
27269
+ packageVersion: "0.2.50",
27270
+ gitHead: "41dbe7cc296da1c5a7964dca8f418800522f27e5"
27237
27271
  });
27238
27272
  }
27239
27273
  function optionalEnvironment(environment, name) {
@@ -27408,4 +27442,4 @@ export {
27408
27442
  createCanonicalOrderBookExportClientFromEnv
27409
27443
  };
27410
27444
 
27411
- //# debugId=0AD3286872E96B4764756E2164756E21
27445
+ //# debugId=91A35DE6AD9170B764756E2164756E21