TorqueTorque

Search docs

Search Torque documentation pages & sections

Architecture

The Platform API is the integrator surface. Behind it, one unified balance and one execution engine handle Trade, Transfer, Lend, Borrow, and Checkout through a single order.

One Balance

Users see one spendable portfolio balance. Torque aggregates holdings across chains behind the scenes; depositable assets (including yield-bearing forms) count toward parent buckets such as ETH or BTC. Routing is automatic; integrators and end users never pick a source chain.

What the user sees
One portfolio balanceOne spendable amount per action
Ownership layer
Live portfolio totalUnified balance for MAX and spend
Execution readiness
Can this action route nowMulti-step plan when needed
Inventory layer (hidden)
Per-chain holdingsWhere tokens sit today
Torque ledger
Balance buckets (available / reserved)Order lifecycle

Indexers and observers feed ownership. Users never pick a chain.

Order Execution

Direct when one pocket can fund the action; orchestrated when balance is split across chains or forms.

Money surfaces
TradeLend & BorrowTransfer & CheckoutAssistant
Quote and execution engine
Preview quote and receive amountSubmit frozen order
Direct path
Single routed transaction
Portfolio plan
ConsolidateSwap / bridgeDeFi delegate
One user-facing order
Single order ID and timelineSettlement legs behind the scenes
Balance lifecycle
Lock spendable balanceSend onchain txConfirm and debitRelease on failure
Onchain execution
Smart walletRouting and DeFi partners
PathWhenWhat Happens
DirectOne pocket holds enough to fund the actionSingle routed transaction
OrchestratedBalance is unified but split across chains or formsConsolidate, then swap, bridge, or DeFi delegate legs

Maps to the API Lifecycle

The engine above powers the READ → DECIDE → EXECUTE contract documented for integrators. See Introduction for the lifecycle diagram and below for wallet_order schema and intent types.

StageEngineIntegrator Surface
READUnified portfolio and market contextGET /read/portfolio, portfolioData in Assistant context, Intelligence feeds
DECIDEIntent resolution and draft wallet_orderAssistant functionResults, Checkout SDK session (merchant pay)
EXECUTEOrder commit, routing, settlementPOST /execute/** (on_chain) or torque-checkout SDK + webhooks (merchant)

Lifecycle

Financial Action = Intent + wallet_order

Intent is the user goal; wallet_order is what Torque commits.

Lifecycle Stages

StageSummaryConstraint
READState + intelligenceRead-only. No wallet_order produced.
DECIDEIntent → executable planNo settlement. Outputs draft wallet_order only.
EXECUTEFinal settlementCommits wallet_order. Financial Action completes.
  1. READ: Portfolio and market context → Intent
  2. DECIDE: Assistant → functionResults (draft wallet_order)
  3. EXECUTE: Actions settlement (on_chain or merchant)

Intent Types

Intent is the user goal. DECIDE resolves it; EXECUTE commits the matching wallet_order through Actions. The wallet_order channel selects on_chain vs merchant.

IntentDescriptionDECIDEEXECUTE Channel
swapExchange one asset for anothertrade (functionResults may show swap_tokens)on_chain
transferSend assets to a wallet or address (peer)transfer (functionResults may show transfer_tokens)on_chain
lendSupply assets for yieldlend (functionResults may show lend_tokens)on_chain
borrowBorrow against collateralborrow (functionResults may show borrow_tokens)on_chain
paySettle a merchant order (buyer → merchant)torque-checkout SDK (merchant server)merchant

transfer → on_chain (wallet JWT); pay → merchant (business key). Same move-value, different auth.

Merchants: merchant + Checkout. Wallet/Assistant: on_chain.

Wallet Order

Draft in DECIDE (functionResults); committed in EXECUTE via Actions (on_chain or merchant).

FieldDescription
intentTypeswap | transfer | lend | borrow | pay
statusdraft (DECIDE) → committed (EXECUTE)
channelon_chain → POST /execute/**; merchant → torque-checkout SDK + order webhooks
requiresConfirmationtrue for value-moving drafts from Assistant
transactionPrepared tx body (on_chain channel) or checkout session (merchant)
chainIdTarget chain for on_chain orders
// DECIDE output (draft wallet_order, on_chain)
{
  "toolName": "transfer_tokens",
  "result": {
    "success": true,
    "requiresConfirmation": true,
    "intentType": "transfer",
    "status": "draft",
    "channel": "on_chain",
    "chainId": 8453,
    "transaction": { ... }
  }
}

// pay: merchant channel; DECIDE via Checkout SDK (not Assistant)
{
  "intentType": "pay",
  "status": "draft",
  "channel": "merchant",
  "checkoutSession": { ... }
}

Execution Tiers

draft

DECIDE

wallet_order in functionResults; plan only, no settlement

committed

EXECUTE

wallet_order submitted; value moves or state changes

Actions Channels

EXECUTE is one surface (Actions) with two channels. Both finalize a wallet_order.

SurfaceChannelRoutesAuth
Actionson_chainPOST /api/v1/execute/** (alias /actions/**)Smart Wallet JWT
Actionsmerchanttorque-checkout SDK, POST /api/webhooks/order-updatesk_live_… + Business ID
Tool NameEXECUTE RouteChannel
trade (alias swap_tokens)POST /api/v1/execute/tradeson_chain
trade / swap_tokens (Solana)POST /api/v1/execute/trades/solanaon_chain
transfer (alias transfer_tokens)POST /api/v1/execute/transfers/evmon_chain
transfer (alias transfer_tokens, Solana)POST /api/v1/execute/transfers/solanaon_chain
lend (alias lend_tokens)POST /api/v1/execute/lends/evmon_chain
borrow (alias borrow_tokens)POST /api/v1/execute/borrows/evmon_chain
torque-checkout SDK (pay)Checkout session + POST /api/webhooks/order-updatemerchant

Boundary Rules

If it does not produce or contribute to a wallet_order, it is not part of EXECUTE.

CategoryExamplesWhy
READ-only responsesGET /intelligence/feed, GET /data/*, GET /wallet/meContext only; no wallet_order
Assistant text-only repliescontent without functionResultsIntent answered; no draft wallet_order
System metadataGET /health, GET /capabilities, GET /openapiDiscovery, not execution
Rate tiles without commitOpportunities GET without downstream EXECUTEREAD context, not a wallet_order

For Integrators

  • Unified portfolio READ, not per-chain pockets.
  • Third-party: business key for read/decide; user auth for execute.
  • EXECUTE commits wallet_order; routing stays inside Torque.
  • Trade, Transfer, Lend, Borrow, Checkout share one order lifecycle.
  • Merchant pay: Checkout SDK, not Assistant.

Next: Authentication, Execute, Checkout SDK, Assistant.

FAQ

How does one balance work across chains?

Torque aggregates holdings into product buckets (USD, ETH, BTC, equities). Portfolio READ returns one unified balance; execution may pull from multiple pockets and consolidate before the final leg.

When is execution direct vs orchestrated?

Direct when one pocket holds enough to fund the action in a single routed transaction. Orchestrated when balance is unified but split across chains or forms; Torque consolidates, then runs swap, bridge, or delegate legs as needed.

Do integrators expose per-chain balances?

No. Partner UI should show one balance line per product bucket or portfolio total. Per-chain inventory is internal routing detail.

What is wallet_order?

The executable unit Torque commits after DECIDE. It carries intent (swap, transfer, lend, borrow, pay) and routes through one order lifecycle. See Lifecycle for schema and intent types.

More general questions: Introduction FAQ.

Questions or corrections? hello@torque.fi