Quickstart Guide

Deploy your first AI agent with autonomous onchain banking capabilities in 10 minutes. This guide walks through creating a Solana PDA account, configuring token delegations, and executing your first onchain transaction.


Prerequisites

  • Node.js 18+ or Python 3.9+

  • Solana wallet (Phantom, Solflare, or Backpack)

  • MoltFi API key (sign uparrow-up-right)

  • Some SOL for transaction fees (~0.01 SOL, or use MoltFi's fee sponsorship)


Installation

TypeScript/Node.js

npm install @moltfi/sdk @solana/web3.js @solana/spl-token

Python

pip install moltfi solana solders

Rust


Step 1: Initialize SDK

TypeScript

Python

Rust


Step 2: Create PDA Account

Deploy a program-derived address (PDA) account for your AI agent. The PDA is derived from MoltFi's program and your owner keypair.

What just happened:

  1. MoltFi created a PDA account on Solana for your agent

  2. Your keypair is set as the owner (you maintain custody)

  3. Account funded with 1,000 USDC via SPL token transfer

  4. Agent can now receive delegated token permissions


Step 3: Configure Token Delegation

Create a token delegation that gives your AI agent limited, time-bound spending authority.

Security Note: The AI agent keypair can only execute operations within these bounds. Your wallet maintains custody of the PDA.


Step 4: Execute First Transaction

Now your AI agent can execute USDC transfers autonomously within the policy boundaries.


Step 5: Monitor Agent Activity

Query transaction history and spending analytics.


Complete Example: OpenClaw Agent Setup

Full example integrating MoltFi with an OpenClaw agent for autonomous cloud operations:


Sandbox Testing

Test all functionality without real funds on Solana Devnet:

Get testnet tokens:


Next Steps

Learn Core Concepts

Technical Deep Dives

Integration Guides


Common Issues

Issue: Transaction Failed - Policy Violation

Solution: Check remaining spending limit:

Issue: Insufficient SOL for Fees

Solution: Fund PDA with SOL:

Issue: Recipient Not Allowed

Solution: Add recipient to delegation policy:

Issue: Blockhash Not Found

Solution: This is a temporary Solana network issue. Retry the transaction:


Performance Tips

Use Optimized RPC Providers

For production, use premium RPC providers:

Optimize Transaction Confirmation

Batch Operations


Support


You're ready to build autonomous AI agents with professional banking infrastructure on Solana

Last updated

Was this helpful?