Kraken · Arazzo Workflow

Kraken Reconcile Spot Trade History

Version 1.0.0

Pull trade history, drill into specific trades, then tie them to ledger entries.

1 workflow 1 source API 1 provider
View Spec View on GitHub CryptocurrencyExchangeTradingMarket DataSpot TradingFuturesDerivativesStakingEarnNFTWebSocketFIXCustodyOTCPrime BrokerageEmbedOAuthPublic APIsArazzoWorkflows

Provider

kraken

Workflows

reconcile-trade-history
Reconcile spot trades against ledger entries for a period.
Reads trade history, fetches detail for the supplied trade ids, and reads the ledger so trades can be matched to the resulting balance movements.
3 steps inputs: asset, end, nonce, otp, start, txid outputs: ledger, tradeCount, tradeDetail
1
tradesHistory
getTradesHistory
Pull recent trade history for the account. Private Spot endpoints are signed and accept application/x-www-form-urlencoded bodies.
2
tradeDetail
queryTradesInfo
Query detailed information for the supplied trade ids to inspect fees, prices, and the orders that produced them.
3
ledger
getLedgersInfo
Read ledger entries over the same window so trades can be matched to the cash and fee movements they generated.

Source API Descriptions

Arazzo Workflow Specification

kraken-reconcile-trade-history-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: Kraken Reconcile Spot Trade History
  summary: Pull trade history, drill into specific trades, then tie them to ledger entries.
  description: >-
    A reconciliation flow for the Kraken Spot REST API. It pulls recent trade
    history, queries detailed information for a specific set of trade ids, and
    reads the ledger so the caller can tie executed trades back to the cash and
    fee movements they produced. Every step spells out its request inline so the
    flow can be read and executed without opening the underlying OpenAPI
    description.
  version: 1.0.0
sourceDescriptions:
- name: krakenSpotApi
  url: ../openapi/kraken-spot-rest-openapi.yml
  type: openapi
workflows:
- workflowId: reconcile-trade-history
  summary: Reconcile spot trades against ledger entries for a period.
  description: >-
    Reads trade history, fetches detail for the supplied trade ids, and reads
    the ledger so trades can be matched to the resulting balance movements.
  inputs:
    type: object
    required:
    - nonce
    - txid
    properties:
      nonce:
        type: string
        description: Ever-increasing nonce for the signed request.
      otp:
        type: string
        description: One-time password if two-factor is enabled on the API key.
      txid:
        type: string
        description: Comma-delimited trade ids to query in detail (max 20).
      asset:
        type: string
        description: Asset to scope the ledger query to (e.g. XBT).
      start:
        type: integer
        description: Unix timestamp lower bound for the history and ledger windows.
      end:
        type: integer
        description: Unix timestamp upper bound for the history and ledger windows.
  steps:
  - stepId: tradesHistory
    description: >-
      Pull recent trade history for the account. Private Spot endpoints are
      signed and accept application/x-www-form-urlencoded bodies.
    operationId: getTradesHistory
    requestBody:
      contentType: application/x-www-form-urlencoded
      payload:
        nonce: $inputs.nonce
        otp: $inputs.otp
        type: all
        trades: true
        start: $inputs.start
        end: $inputs.end
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      trades: $response.body#/result/trades
      count: $response.body#/result/count
  - stepId: tradeDetail
    description: >-
      Query detailed information for the supplied trade ids to inspect fees,
      prices, and the orders that produced them.
    operationId: queryTradesInfo
    requestBody:
      contentType: application/x-www-form-urlencoded
      payload:
        nonce: $inputs.nonce
        otp: $inputs.otp
        txid: $inputs.txid
        trades: true
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      tradeDetail: $response.body#/result
  - stepId: ledger
    description: >-
      Read ledger entries over the same window so trades can be matched to the
      cash and fee movements they generated.
    operationId: getLedgersInfo
    requestBody:
      contentType: application/x-www-form-urlencoded
      payload:
        nonce: $inputs.nonce
        otp: $inputs.otp
        asset: $inputs.asset
        type: trade
        start: $inputs.start
        end: $inputs.end
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      ledger: $response.body#/result/ledger
  outputs:
    tradeCount: $steps.tradesHistory.outputs.count
    tradeDetail: $steps.tradeDetail.outputs.tradeDetail
    ledger: $steps.ledger.outputs.ledger