Skip to main content

Intents

Intents are declarative transaction requests that abstract away low-level blockchain details. The system validates, builds, and executes intents through a multi-stage pipeline.

Intent Structure

Every transaction begins as an intent:

Supported Transaction Types

Agentic Wallet supports 26 transaction types:

Native Transfers

transfer_sol

Transfer native SOL between accounts.

transfer_spl

Transfer SPL tokens.

DeFi Operations

swap

Token swaps via DEX aggregators.

stake / unstake

Staking operations (Marinade, etc).

lend_supply / lend_borrow

Lending protocol operations.

Token Management

create_mint

Create a new SPL token mint.

mint_token

Mint tokens to an account.

Escrow Operations

intent
Create a new escrow with funds and conditions.
intent
Accept an escrow as the counterparty.
intent
Release funds to the beneficiary.
intent
Refund funds to the creator.
intent
Raise a dispute on an escrow.
intent
Resolve a disputed escrow.
intent
Create multi-milestone escrow.
intent
Release a specific milestone.

Read-Only Operations

query_balance

Query wallet balance (no signature).

query_positions

Query DeFi positions (no signature).
Read-only intents (query_*) skip signing and submission phases, confirming immediately after simulation.

Advanced Operations

intent
HTTP 402 payment protocol integration.
intent
Flash loan transaction bundle.
intent
Cross-Program Invocation.
intent
Arbitrary instruction bundle.
intent
Treasury budget allocation.
intent
Rebalance between agent budgets.
intent
Simulated trade for backtesting.

Intent Validation

Intents are validated through multiple layers:

1. Schema Validation

Zod schemas enforce type safety:

2. Protocol Compatibility

The protocol adapter registry validates that the protocol supports the intent type:

3. Policy Evaluation

Policies can block or require approval for intents:

4. Agent Capability Check

If executed by an agent, the intent must be in the allowlist:

5. Budget Validation

Spend-capable intents check agent budgets:

Legacy Adapter Behavior

The intent-runner CLI provides backward compatibility:
Legacy transformations:
  1. Wallet ID lookup: fromWalletId (base58) → internal UUID
  2. Metadata preservation: chain, createdAt, reasoning stored in intent.legacy
  3. Type normalization:
    • transfer → transfer_sol or transfer_spl (based on mint presence)
    • swap → swap
    • create_mint → create_mint
    • mint_token → mint_token
Legacy adapter behavior is documented in SKILLS.md:60 for orchestrator compatibility.

Idempotency

Use idempotencyKey to prevent duplicate transactions:
Behavior:
  • First request: Creates new transaction
  • Duplicate key: Returns existing transaction record
  • Key scope: Per wallet
  • Key length: 8-128 characters

Gasless Transactions

Set gasless: true to route through sponsored RPC:
Requirements:
  1. Protocol must have gaslessEligible: true in risk config
  2. KORA_RPC_URL must be configured
  3. Transaction must meet size/complexity limits
Not all protocols support gasless transactions. Check protocol risk configuration before enabling.

Paper Trading

Set paperOnly: true in intent to simulate without execution:
Paper trades:
  • Skip signing and submission
  • Record to strategy store
  • Useful for backtesting and validation
  • No budget deduction

Best Practices

  1. Use specific intent types (not custom_instruction_bundle) when possible
  2. Include all required fields for protocol adapter
  3. Set reasonable slippage for swaps (50-200 bps typical)
  4. Use idempotency keys for user-facing operations
  5. Validate amounts before submission
  1. Check status and failedAt in response
  2. Handle approval_gate status for manual approval flow
  3. Retry on PIPELINE_ERROR with exponential backoff
  4. Never retry on POLICY_VIOLATION or VALIDATION_ERROR
  5. Monitor errorCode for categorization
  1. Validate destinations before transfers
  2. Use address allowlists for high-value operations
  3. Set spending limits via policies
  4. Audit flash_loan and cpi_call intents carefully
  5. Restrict custom_instruction_bundle to trusted agents

Source Code Reference

Intent handling is implemented in:
  • packages/common/src/schemas/transaction.ts - Intent type definitions (packages/common/src/schemas/transaction.ts:14)
  • services/transaction-engine/src/pipeline/* - Execution pipeline
  • services/protocol-adapters/src/index.ts - Protocol routing (services/protocol-adapters/src/index.ts:1)
  • SKILLS.md - Canonical intent contract (SKILLS.md:312)