kcolbchain / docs / arka

arka

Rust AI agent SDK for blockchain. Chain-agnostic wallets, DEX interaction, MPP payments, on-chain state reading.

The Problem

AI agents need to transact on blockchains — pay for services, trade on DEXes, manage positions, settle payments. Current options:

There is no Rust SDK that lets an AI agent interact with multiple blockchains from one interface. arka fills that gap.

Install

cargo add arka

Quick Start

use arka::prelude::*;

#[tokio::main]
async fn main() -> Result<()> {
    // Create an agent with a wallet
    let agent = Agent::builder()
        .chain(Chain::Base)
        .wallet(Wallet::generate()?)
        .build()
        .await?;

    // Read on-chain state
    let balance = agent.balance().await?;
    let price = agent.oracle().price("ETH/USDC").await?;

    // Execute a swap
    let tx = agent.dex()
        .swap("ETH", "USDC", parse_ether("0.1")?)
        .slippage_bps(50)
        .execute()
        .await?;

    // Pay for an API via MPP (Machine Payments Protocol)
    let response = agent.mpp()
        .pay("https://api.example.com/inference", 0.001)
        .await?;

    Ok(())
}

Features

Modules

ModuleStatusDescription
arka::agent✅ MVPAgent builder, lifecycle, configuration
arka::wallet✅ MVPKey generation, signing, multi-wallet
arka::chain✅ MVPEVM chain connectors, RPC management
arka::tx✅ MVPTransaction building, gas estimation, simulation
arka::dex🚧 WIPDEX swap execution, routing
arka::mpp🚧 WIPMachine Payments Protocol client
arka::oracle🚧 WIPPrice feeds, TWAP
arka::solana📋 PlannedSolana chain connector
arka::cosmos📋 PlannedCosmos chain connector

Architecture

┌─────────────────────────────────────────────┐
│                 Agent                        │
│  (wallet, identity, state, configuration)   │
├──────────┬──────────┬───────────┬───────────┤
│  Chains  │   DEX    │   MPP     │  Oracle   │
│ (EVM,    │ (swap,   │ (HTTP 402,│ (price    │
│  Solana, │  LP,     │  sessions,│  feeds,   │
│  Cosmos) │  route)  │  receipts)│  TWAP)    │
├──────────┴──────────┴───────────┴───────────┤
│              Transport Layer                 │
│  (RPC, WebSocket, HTTP, signing)            │
└─────────────────────────────────────────────┘

Examples

ExampleWhat it does
basic_agentCreate agent, check balance, send transaction
dex_swapSwap tokens on Uniswap V3
mpp_paymentPay for an API using MPP on Tempo
multi_chainSame agent operating across Base + Arbitrum + Optimism

GitHub Repository

Source code, issues, contributions

switchboard

Agent infrastructure (wallets, payments, cross-chain)

resolver

High-performance Rust intent solver