Introducing the Universal AI Dollar (@uaidvaleo) dApp, a full walkthrough. $UAID is our crypto-collateralized stablecoin purpose-built for AI agent payments on @solana What you're seeing: → Dashboard with live protocol stats → Minting UAID with SOL collateral (150%+ ratio) → 1:1 USDC↔UAID swap via the Peg Stability Module → Agent SDK with pay-per-call for @LangChain, CrewAI & @vercel AI Humans mint it. Agents spend it. Everything settles on Solana in milliseconds. Live on devnet (testing internally). SDK on npm. 🧵 Deep dives below ↓
1/ Peg Mechanism How $UAID holds its peg, two layers working together: 1/ Vault minting: Users deposit SOL (or USDC) as collateral and mint UAID against it. Minimum 150% collateral ratio enforced on-chain. Undercollateralized vaults get liquidated, penalty fees go to the insurance fund. 2/ PSM (Peg Stability Module): A smart contract that swaps USDC↔UAID at exactly 1:1 with a 0.1% fee (10 bps). This is the hard peg floor and ceiling. If UAID trades at $1.01, arbitrageurs swap USDC→UAID and sell. If it trades at $0.99, they buy UAID and swap→USDC. The spread is capped by the fee. The PSM reads usdc_mint directly from on-chain PsmConfig (seeds: ["psm"]), so it works with whatever USDC mint the protocol is initialized with, devnet test mint now, native USDC on mainnet later. Fee revenue gets split: swap fees mint UAID to the insurance fund PDA, liquidation penalties split between insurance and VALEO buyback based on protocol config bps. Result: overcollateralized + arbitrage-enforced peg. No algorithmic assumptions.
2/ SDK for Agents The (@)uaid/agent-sdk in 60 seconds: The problem: AI agents need to pay for API calls, inference, tools, but there's no payment standard. You end up writing 50+ lines of Solana token transfer code per integration. The fix: 3 lines. Every payment writes a JSON memo on-chain via Solana's Memo Program: taskId, serviceType, nonce (timestamp), agent pubkey. The provider verifies the tx signature, parses the memo, checks the nonce hasn't expired (replay protection), and stores the signature to prevent reuse. Framework integrations: LangChain, createPaidTool() wraps any tool with auto-payment. CrewAI: same pattern, JSON input parsing Vercel AI SDK: drop-in payment tool Generic, createPaymentMiddleware() wraps any async function BalanceManager handles the rest: waitForBalance() polls until funded, onLowBalance() fires a callback when you're running low. Headless. No browser wallet. Just a private key and an RPC. Built for servers and agents, not humans.
843