Loops House





Alcancía
A savings agent for LatAm: one onchain piggy bank per goal, every paycheck split automatically, in the currency you'll spend in.

Agents on Open Rails Hackathon
Links
Team
1 member- AROwner
Artu Grarnde
Overview
Problem
Saving in Latin America fails for three reasons that compound: money left next to everyday spending gets spent; people save in one currency but spend in another (a trip to Brazil saved in pesos is exposed to the exchange rate, so people dollarize); and nobody does the math across several goals, dates and currencies.
What it does
- Conversational plan. A generative chat (AI SDK + Vercel AI Gateway, Claude) turns "Florianópolis in March, an Ironman, a new laptop" into editable goal cards (amount, currency, date), then asks for income and fixed costs. The plan (what % of every paycheck goes to each goal) is computed in code, not by the model, and keeps 20% of the free money for living.
- One contract per goal.
AlcanciaFactory.createBatchWithIncomeclones oneAlcancia(EIP-1167) per goal, owned by the user, and stores the user's income currency. Funds can only ever go back to the owner. - Savings on autopilot. Every hour (or on "Sync") the agent detects new income in the user's local stablecoin and calls
sweep(): same-currency shares go straight into the piggy banks; shares of goals in another local currency go to the agent, which converts them and deposits. - Save in the currency you'll spend in. Trip goals fill in wBRL / wCOP / … The agent requests Textile RFQ quotes for two legs (local → USD₮ → local; there's no direct local↔local market on Celo yet), with Uniswap v3 as fallback and automatic refund if a leg fails. Users never hold dollars.
- Anti-impulse brake. Early withdrawal: reflection with real numbers, "tell me why", and a riddle about your own goal. Solve it and the agent calls
agentApprove()onchain; otherwise the contract enforces a 72 h delay. Lowering a target also waits 72 h. The agent can only shorten the wait, never hold the money. - Top-ups from any currency. Add money in the goal's currency (2 signatures) or from another local stablecoin (1 signature: the agent verifies the transfer onchain, converts via Textile and deposits; idempotent via the source tx hash in the deposit calldata).
- Ripio end to end. Ripio Ramp to top up and to cash out to a bank (AR, BR, MX, CO), prefilled with the user's address and currency.
Proof (Celo mainnet)
- AlcanciaFactory
0xbbab1b684212fc4cde02eafc69bba993934e2218· Alcancia impl0x290c3c5404f34bcb8f06520a8be31fc65bd786d4(verified on Blockscout) - Agent wallet
0xD8c9558DB1404976fB11A1fC64f3E122309B3055· ERC-8004 agent #9911 - Demo wallet
0xF17270964c05AA8C0393d2fc33bCAbB60af196cE: 3 piggy banks created, paycheck split, wBRL goal funded via Textile (two RFQ legs with Textile fees), early withdrawal approved by the agent after the riddle. - buy receipt (x402, USDC):
0x2f7bfeffa92fdba1062f1fcd86e3dd88ba078bed8a3e992fdd5100580342b46f
How it's built
Next.js on Vercel · AI SDK + Vercel AI Gateway · wagmi/viem/RainbowKit (MiniPay-compatible) · Foundry (27 tests incl. fuzz) · @celo/attribution-tags · Textile v2 RFQ (keyless takerProof) · Uniswap v3 fallback · buy gateway (SQD free + Chainstack x402) · ERC-8004. No database: state lives onchain.
Hackathon rules
- Celo mainnet 42220 only.
- ERC-8021 on every transaction (users' and the agent's, deployments included):
celo_cbcc681c15b7+ repo-derivedcelo_595aac690f07in one suffix. - ERC-8004 identity registered from the agent wallet (#9911).
- Gas: users pay their own signatures; the agent pays its own; no relayer. The buy gateway sponsors gas for x402 settlements.
- Custody note: during FX (sweep shares and cross-currency top-ups) funds sit in the agent wallet for the seconds between Textile legs; on failure the agent refunds the user.
Per-track notes
Track 1 · Stable Agents: LatAm (Ripio × Celo) — primary
- Works on mainnet with real wFiat: wARS, wBRL (and wMXN, wCOP, wPEN, wCLP as income/savings currencies).
- Uses wFiat and the Celo stack seriously: per-goal contracts, Ripio Ramp on/off-ramp, local-currency FX, fee-cheap automation.
- Autonomous and useful: detects income, splits, converts, approves withdrawals, refunds on failure.
- A real person can use it: connect a wallet, plan in 2 minutes, ES/EN.
- LatAm impact: saving discipline in your own currency, without dollarizing.
Track 2A · Open Corridors: Textile FX
- Not a market-making strategy: an agent that takes Textile liquidity on behalf of savers — every trip goal and cross-currency top-up becomes real wARS/wBRL/wCOP ↔ USD₮ RFQ volume on Celo.
- Keyless RFQ v2 with takerProof, two-leg routing, quote expiry checks, Uniswap fallback and refunds.
- Honest scope: P&L isn't the goal (the agent passes conversions through at cost); the originality is FX demand coming from real savings flows.
Track 3 · Build with buy (usebuy.ai)
- Problem solved: an always-on savings agent has to read the chain reliably without running infra.
- Integration depth: SQD via buy (free) detects every paycheck and the agent's own tx history (used for idempotency); Chainstack Celo RPC via buy is paid per cycle over x402 (US$0.01) with one batched call containing every user's balances, allowances, income currency and sweep cursor — no spam. Receipts are shown in the app.
- Resilience: retries SQD on 429/5xx and falls back to the public RPC.