Overview
MINT is an AI-guarded payments and trading app on Stellar. Users sign in with an email, get a platform-created wallet and a separate trading vault, and hold Circle testnet USDC. An AI assistant can propose trades, but a deterministic guardrail engine must approve each one before anything is signed.
Market analysis reads real mainnet XLM and USDC prices, and every transaction settles on testnet with a link to StellarChain. I built the Next.js app, the Stellar account and trading code, the rule-based agent, the x402 integration and the Soroban contracts.
The challenge
Letting an AI agent touch money raises an obvious question: what stops it from doing something stupid, or from being talked into it? An agent that can read text can also be fed hostile text through a memo or a data feed.
The project also needed an agent that people could watch. Saying that something executed on-chain does not explain what it is doing with a user's money.
The goal
Give an agent real trading power while keeping the limits outside the model and visible to the user.
- 01Let an assistant stage payments, swaps and trades, but never sign them itself.
- 02Enforce capital, loss and size limits in code, checked again right before signing.
- 03Show a user what the agent is doing, with the reasons and the transactions.
- 04Let the agent pay for its own data over x402 without a human, with a small capped budget.
Wallets, vaults and fees
Every user gets two Stellar accounts: a main wallet and a trading vault. The treasury sponsors the account reserves and fee-bumps every user transaction, so users never need XLM for gas. Secrets are encrypted at rest with AES-256-GCM.
The structure itself limits damage: the agent can only sign for the vault, and the vault can only pay out to its owner's main wallet.
The guardrail engine
The AI uses tool calling through Groq, but every tool that moves money only stages a proposal. A deterministic engine then checks it and checks it again just before signing.
- 01Capital cap and maximum trade size.
- 02Daily loss limit over a rolling 24 hours, net of deposits.
- 03Maximum slippage, allowed assets and a maximum per asset.
- 04A kill switch, and an email code to loosen any limit or switch on autonomous mode.
The trading agent
The agent is rule-based, not a language model. It reads hourly mainnet candles for each market, works out the trend, RSI and volatility, buys uptrends and oversold dips, and sizes each trade to risk 1 percent of the vault. Every position has a stop, a target, a trailing stop and a time limit.
The language model only explains what the rules decided. The /agent page shows a heartbeat, open and closed positions, the vault value over 24 hours and a decision journal with the numbers behind each buy, sell or block. A drill there attacks the guardrails live, and nothing is signed.
x402 and the terminal
MINT sells its market read per request over x402 at 0.01 USDC on testnet. Its own agent buys that data from a separate budget wallet that holds a small amount, is capped per request and per day, can only pay listed sellers, and can be revoked in one transaction.
The trading terminal uses TradingView Lightweight Charts with an order book, market and limit orders, and path-payment swaps with slippage enforced on-chain.
Soroban contracts
The repo includes three Rust contracts. A guardrail vault enforces the limits on-chain, and its agent key can only swap or halt. A recurring-payments contract runs pull-payment schedules, and a price-feed contract implements the SEP-40 oracle interface. A worker also runs a market maker on testnet so the pairs have liquidity.
The outcome
MINT runs as a Next.js app with a one-command Docker setup, a deployed demo and a demo video linked from the README. It shows the agent's limits sitting in code and contracts, not in a prompt. Wallets are custodial and everything settles on testnet, and the README names passkey smart wallets as the production path. A teammate contributed one commit, a Markdown formatting fix for assistant messages.


