Kraken · Arazzo Workflow

Kraken Balance-Aware Spot Buy

Version 1.0.0

Read the account balance and live ticker, then branch on funding before buying.

1 workflow 3 source APIs 1 provider
View Spec View on GitHub CryptocurrencyExchangeTradingMarket DataSpot TradingFuturesDerivativesStakingEarnNFTWebSocketFIXCustodyOTCPrime BrokerageEmbedAuthenticationPublic APIsArazzoWorkflows

Provider

kraken

Workflows

balance-aware-buy
Place a spot buy only when the account holds enough of the quote asset.
Reads balances and the current ticker, branches on whether the funding asset balance is greater than zero, and places a buy order when funded.
3 steps inputs: fundingAsset, nonce, ordertype, otp, pair, price, volume outputs: balances, txid
1
readBalance
Read all asset balances. Private Spot endpoints are signed and accept application/x-www-form-urlencoded bodies.
2
readTicker
Read the live ticker for the pair to price the buy against the current ask.
3
placeBuy
Submit the buy order via AddOrder once funding has been confirmed.

Source API Descriptions

Arazzo Workflow Specification

Raw ↑
arazzo: 1.0.1
info:
  title: Kraken Balance-Aware Spot Buy
  summary: Read the account balance and live ticker, then branch on funding before buying.
  description: >-
    A spend-control flow for the Kraken Spot REST API. It reads the account
    balance and the live ticker for the pair, then branches: when the quote-asset
    balance is sufficient it places the buy order, and when it is not it ends the
    workflow without spending. 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: accountDataApi
  url: ../openapi/kraken-account-data-api-openapi.yml
  type: openapi
- name: marketDataApi
  url: ../openapi/kraken-market-data-api-openapi.yml
  type: openapi
- name: tradingApi
  url: ../openapi/kraken-trading-api-openapi.yml
  type: openapi
workflows:
- workflowId: balance-aware-buy
  summary: Place a spot buy only when the account holds enough of the quote asset.
  description: >-
    Reads balances and the current ticker, branches on whether the funding asset
    balance is greater than zero, and places a buy order when funded.
  inputs:
    type: object
    required:
    - nonce
    - pair
    - fundingAsset
    - volume
    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.
      pair:
        type: string
        description: The asset pair to buy (e.g. XBTUSD).
      fundingAsset:
        type: string
        description: The quote/funding asset whose balance must cover the buy (e.g. ZUSD).
      volume:
        type: string
        description: Order volume in base-asset terms.
      price:
        type: string
        description: Limit price for the buy; omit for a market order.
      ordertype:
        type: string
        description: Order type (market or limit). Defaults to market when no price is supplied.
  steps:
  - stepId: readBalance
    description: >-
      Read all asset balances. Private Spot endpoints are signed and accept
      application/x-www-form-urlencoded bodies.
    operationId: getAccountBalance
    requestBody:
      contentType: application/x-www-form-urlencoded
      payload:
        nonce: $inputs.nonce
        otp: $inputs.otp
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      balances: $response.body#/result
    onSuccess:
    - name: funded
      type: goto
      stepId: readTicker
      criteria:
      - context: $response.body
        condition: $.result.length > 0
        type: jsonpath
    - name: unfunded
      type: end
      criteria:
      - context: $response.body
        condition: $.result.length == 0
        type: jsonpath
  - stepId: readTicker
    description: >-
      Read the live ticker for the pair to price the buy against the current ask.
    operationId: getTickerInformation
    parameters:
    - name: pair
      in: query
      value: $inputs.pair
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      ticker: $response.body#/result
  - stepId: placeBuy
    description: >-
      Submit the buy order via AddOrder once funding has been confirmed.
    operationId: addOrder
    requestBody:
      contentType: application/x-www-form-urlencoded
      payload:
        nonce: $inputs.nonce
        otp: $inputs.otp
        pair: $inputs.pair
        type: buy
        ordertype: $inputs.ordertype
        volume: $inputs.volume
        price: $inputs.price
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      txid: $response.body#/result/txid
      descr: $response.body#/result/descr
  outputs:
    balances: $steps.readBalance.outputs.balances
    txid: $steps.placeBuy.outputs.txid

Work with this as data

Every workflow here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for arazzo workflows

4 MCP tools reach this
  • find_arazzoBrowse and filter every workflow in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This workflow
curl "https://apis.io/api/v1/arazzo/kraken-balance-aware-buy-workflow"
All arazzo workflows
curl "https://apis.io/api/v1/arazzo?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.