AArtery
On this page

CloudEvents and Payload Shapes

All Webhook deliveries use CloudEvents 1.0 structured JSON with content type application/cloudevents+json.

tsinterface ArteryCloudEvent<TData> {
  specversion: '1.0';
  id: string;
  source: string;
  type: string;
  subject: string;
  time: string;
  datacontenttype: 'application/json';
  dataschema: string;
  qfeventtype: string;
  qfcorrelationid: string;
  qfrevision: number;
  qforganizationid: string;
  traceparent?: string;
  data: TData;
}

Dispatch on the versioned CloudEvent type. Use qfeventtype for product grouping, id for delivery deduplication, and qfcorrelationid plus qfrevision to order corrections to the same business entity.

Delivery headers

  • X-Artery-Signature: HMAC-SHA256 signature over the exact raw body
  • X-Artery-Admission: pre-body admission proof; receivers may verify it to reject unauthenticated slow uploads
  • X-Artery-Delivery-Id: identity of this delivery attempt stream
  • X-Artery-Event-Id: equal to the CloudEvent id
  • X-Artery-Event-Type: versioned CloudEvent wire type, equal to type
  • X-Artery-Attempt: current delivery attempt number

Artery treats any 2xx response as success and retries other outcomes with exponential backoff. A retry preserves the exact event identity and body.

Both proofs use t=<unix-seconds>,v1=<hex-hmac>. Verify X-Artery-Signature by computing HMAC-SHA256 over ${t}.${rawBody} with the Webhook secret, comparing in constant time, and rejecting stale timestamps (five minutes is the recommended tolerance). The admission proof signs admission.${t} and complements, but never replaces, raw-body verification.

Canonical market snapshot

Account-scoped Order, Trade, Settlement/Redeem, and Liquidation events carry the same immutable market display snapshot. Activity responses reuse this shape. Identity, filtering, and deduplication continue to use stable IDs; titles and outcome labels are display data captured when the event is created.

tsinterface CanonicalMarketRef {
  providerMarketId: string | null;
  symbol: string | null;
  universalId: string | null;
  conditionId: string | null;
  title: string | null;
  eventTitle: string | null;
  slug: string | null;
  eventSlug: string | null;
  url: string | null;
  imageUrl: string | null;
  outcome: {
    tokenId: string;
    index: number;
    label: string | null;
  } | null;
  metadataAsOf: string | null;
}

Every property is present. A nullable value means enrichment was unavailable; it does not make the financial event incomplete. Gamma failures never block durable event persistence or Webhook delivery, and the delivery worker never calls Gamma. Historical deliveries keep their original snapshot after catalog metadata changes.

Activity taxonomy

GET /v1/me/activity returns a generated discriminated union. Dispatch on type, and use activityType for the user-facing category:

typeactivityTypeDisplay guidance
tradetradeBought/Sold + market.outcome.label + market.title
tradeliquidationLiquidated/ADL; never render as an ordinary trade
settlementsettlementResolution or Redeem with result=win|loss|invalid
deposit / withdrawfundingReal external cash movement only

Polymarket settlement is not liquidation. A normal losing close is still a trade; Loss is a settlement result. Title-less Polymarket events remain in bounded asynchronous enrichment and are not delivered with a raw condition or token ID as user-visible text.

Versioned Event Types

The live event catalog API is authoritative. The following anchors correspond to each catalog docsUrl; use each version's schemaUrl for the exact data shape.

market.trade.executed

Public market trades. Version 1: com.questflow.market.trade.executed.v1.

market.spread.updated

Cross-provider spread snapshots. Version 1: com.questflow.market.spread.updated.v1.

broker.trade.executed

Account-perspective broker fills. Version 1: com.questflow.broker.trade.executed.v1. Polymarket emits one low-latency state=detected, finality=provisional execution; its later confirmed observation reconciles the same identity without a second notification. Hyperliquid executions are state=completed, finality=final.

broker.order.updated

Durable order lifecycle revisions from submitted through terminal state. Version 1: com.questflow.broker.order.updated.v1. An order update is not proof of execution; consume broker.trade.executed for fills.

broker.funding.updated

Deposits, withdrawals, and transfer state changes. Version 1: com.questflow.broker.funding.updated.v1. Polymarket revision 1 is status=detected, finality=provisional, and immediately notifiable; revision 2 is status=confirmed, finality=final, and reconciliation-only. Subscription filters use statuses with detected | confirmed | failed | reversed; the retired states key is not part of Funding V1.

broker.position.settlement.updated

Account position Resolution or Redeem results. Version 1: com.questflow.broker.position.settlement.updated.v1. action=redeem requires a final authoritative PayoutRedemption; result is win, loss, invalid, or unknown when the provider cannot prove it.

portfolio.balance.updated

Authoritative portfolio balance projections. Version 2: com.questflow.portfolio.balance.updated.v2.

portfolio.performance.updated

Portfolio performance projections and revisions. Version 2: com.questflow.portfolio.performance.updated.v2.

portfolio.cashflow.updated

Portfolio cashflow projections. Version 2: com.questflow.portfolio.cashflow.updated.v2.

broker.position.liquidated

Liquidation, ADL, and forced-close events. Version 1: com.questflow.broker.position.liquidated.v1.

signal.arbitrage.detected

Cross-provider and negation-pair opportunities. Version 1: com.questflow.signal.arbitrage.detected.v1.

signal.trade-volume.detected

Unusual trade-volume signals. Version 1: com.questflow.signal.trade-volume.detected.v1.

signal.spread-widening.detected

Unusual spread-widening signals. Version 1: com.questflow.signal.spread-widening.detected.v1.

signal.wallet-burst.detected

Activity bursts on connected accounts. Version 1: com.questflow.signal.wallet-burst.detected.v1.

signal.settlement-delay.detected

Delayed-settlement signals. Version 1: com.questflow.signal.settlement-delay.detected.v1.

market.settlement.updated

Market resolution changes. Version 1: com.questflow.market.settlement.updated.v1.

market.settlement-dispute.updated

Proposal, dispute, and final settlement phases. Version 1: com.questflow.market.settlement-dispute.updated.v1.

Edit this page on GitHubLast updated
CloudEvents and Payload Shapes · Artery API Docs