Arcline

Arc DEX with auto-rebalancing USDC baskets, SIPs & Chainlink CRE risk guards. Built in Arc Studio.

Arcline

Created At

ETHGlobal Mumbai

Project Description

Arcline is a spot exchange on Arc, built end to end in Arc Studio, for risk-managed portfolio investing that settles in USDC.

Most people don't want to trade every day. They want a target mix (say 40% BTC, 30% gold, 30% EURC), want it kept in balance, and want to add money every month. On today's DEXs, they still have to do that by hand. Arcline makes it a smart contract. What you can do:

  • Trade: a live markets table and a trade terminal for each asset (candlestick chart, order ticket, risk status) for FX, crypto and RWA tokens against USDC. USDC/EURC trades settle on a real Uniswap v4 pool on Arc Testnet.
  • Buckets: create a smart account that holds a target allocation, from a template or a custom mix, and set your guardrails: drift band, max trade size per rebalance, max slippage and cooldown. When the portfolio drifts past the band, it triggers a rebalance. The contract checks every gate on-chain before it trades (fresh prices, drift past the band, cooldown passed, not paused), and runs sells before buys.
  • SIP (systematic investing): a recurring USDC buy into a bucket, pulled from the owner's approved allowance when it's due. It's dollar-cost averaging, on-chain.
  • Risk guards: a Chainlink CRE workflow (price-guard) fetches market prices and the Uniswap v4 pool price, then writes a signed report on-chain with prices and pump flags (watch / no-buy / exit at 5 / 10 / 20% moves). Buckets stop buying flagged assets and sell assets at exit level. Contracts refuse to trade on stale or flagged prices.
  • Agents: rebalancing is permissionless, so a keeper or an AI agent can run it. Your limits are enforced on-chain, so an agent can only act within them. Why Arc: USDC is the gas token and the settlement asset, so users think in dollars from start to finish, with no separate gas coin to manage. Circle's USDC and EURC are first-class, which makes FX baskets natural.

How it's Made

Arcline was built end-to-end in Arc Studio. Arc Studio was our main workspace: we drove it turn by turn (contracts → frontend → CRE receiver → exchange UI → prices/charts → agent rebalancing service), and the prompts for every turn are committed in studio/ .

Contracts (Solidity, Arc Testnet, chain 5042002): AssetRegistry stores prices and risk levels and rejects stale data. BucketFactory deploys one BucketAccount per user bucket, which holds the target mix, enforces the guardrails and runs SIPs. Two venues sit behind a common interface: UniswapV4Venue and a mirror venue for oracle-priced test assets.

Uniswap v4: UniswapV4Venue talks to IPoolManager directly, with no periphery router: swap() → unlock() → unlockCallback() → poolManager.swap(), with BalanceDelta checks, sync/settle, and minOut enforced. Quotes come from IV4Quoter, and the pool mid price comes from StateView.getSlot0. One catch: the Quoter reverts under staticcall, so the frontend quotes through simulateContract. We wrote up our developer feedback in FEEDBACK.md.

Frontend: Vite + React + wagmi with EIP-6963 wallet discovery. It has candlestick charts (from GeckoTerminal where pools exist, otherwise built from on-chain PriceUpdated events), a drift meter, and an accessible, validated colour system. It's hosted as a static build behind Caddy on AWS, with a same-origin proxy for market data.

Testing: ops/e2e.cjs runs the whole flow live on Arc Testnet: price refresh → buy/sell on Uniswap v4 and the mirror venue → bucket create → deposit → rebalance (checking the cooldown and drift gates, and that sells come before buys) → SIP configure, not-due gate, cancel.

background image mobile

Join the mailing list

Get the latest news and updates