Skip to content

astereumapp/aster-eth

Repository files navigation

Astereum — Ethereum Perpetual Engine

A decentralized perpetual futures DEX on Ethereum L2 (Arbitrum + Base), with an integrated AI agent layer. Trade ETH/BTC perpetuals up to 25x with USDC, or delegate to autonomous agents bounded by scoped ERC-4337 session keys.

Astereum


✨ Features

  • Perpetual trading · ETH-USDC and BTC-USDC markets, up to 25× leverage
  • Natural-language co-pilot · "long ETH 5x with $500, stop loss at -10%" → parsed intent → trade preview
  • Autonomous agents · ERC-4337 smart accounts with scoped session keys (spend cap, max leverage, whitelisted markets, expiry, kill-switch)
  • Multi-chain wallet · Ethereum L2 (primary) + Solana (beta) connect flows
  • Live prices · CoinGecko public API with graceful fallback, simulated tick every 2s
  • Blueprint aesthetic · Gold-on-black, Cormorant Garamond display, JetBrains Mono data
  • Fully responsive · Mobile-first layouts, collapsible chat, scrollable positions
  • Demo mode by default · All flows functional with mock state, zero blockchain calls

🧭 Project Structure

astereum/
├── app/
│   ├── agents/page.tsx        Agent fleet view
│   ├── trade/page.tsx         Trading view
│   ├── globals.css            Design tokens, grids, animations
│   ├── layout.tsx             Fonts + metadata + favicon
│   └── page.tsx               Home / landing
├── components/
│   ├── AgentsClient.tsx       Agent cards, activity log, create modal
│   ├── BlueprintBackground.tsx  Animated canvas dots + CSS grid
│   ├── Footer.tsx
│   ├── Header.tsx             Logo, nav, X/GH/Buy $AST, Wallet (ETH+Solana)
│   └── TradeClient.tsx        Market selector, chart, order form, positions, chat
├── lib/
│   ├── demo-store.ts          React hook + sessionStorage persistence
│   ├── intent-parser.ts       Regex NL → structured TradeIntent
│   └── prices.ts              CoinGecko fetch + fallback + formatters
├── public/
│   ├── favicon.ico + 16/32/48/64/128/192/512 PNGs
│   └── images/ (logo.png, banner.png)
├── types/index.ts
├── preview.jsx                Standalone single-file React preview
├── package.json
├── next.config.js
├── tailwind.config.js
└── tsconfig.json

🚀 Quick Start (Local)

Requires Node.js 18.17+ (Next.js 14 requirement).

npm install
npm run dev
# → http://localhost:3000

Commands:

  • npm run dev — start dev server on :3000
  • npm run build — build for production
  • npm start — start production server
  • npm run lint — lint the codebase

No env vars required for demo mode.

🚢 Deploy

See DEPLOY.md for a step-by-step guide to uploading the code to GitHub (via the web UI — no git CLI required) and deploying to Vercel.

🔑 Buttons & Links

Button Destination
X (top-right) https://x.com/astereumapp
GitHub https://github.com/astereumapp
Buy $AST https://gmgn.ai
Connect Wallet In-app dropdown: Ethereum/L2 or Solana (demo addresses)

🧪 Demo Mode

  • State lives in sessionStorage (astereum.demo.v1) — clears per tab
  • Initial balance: $10,000 USDC (virtual)
  • A seeded agent Grid-Scalper v1 is pre-populated
  • All orders are simulated — no gas, no signatures, no real trades
  • Prices are fetched once from CoinGecko, then random-walk every 2s

Try it

  1. Go to /trade, click Long ETH, open a $500 position at 5x
  2. Watch PnL update live in the positions table
  3. In the chat, type: long BTC 10x with $200, stop loss at -8%
  4. Go to /agents, click Deploy Agent, configure scoped policy
  5. Use the Kill button to revoke a session key

🏗️ Production Upgrade Path

When you're ready to move past demo:

  1. Wallet integration: Replace the mock connect() in components/Header.tsx with wagmi + RainbowKit (EVM) and @solana/wallet-adapter-react (SVM).
  2. On-chain trades: Implement openPosition() in lib/demo-store.ts to call the Astereum router contract with a signed transaction.
  3. Real oracle: Swap CoinGecko for Pyth Network WebSocket feed via @pythnetwork/pyth-evm-js.
  4. LLM assistant: The regex parser in lib/intent-parser.ts is a first defense layer. Behind it, add an LLM call (Claude/GPT) in app/api/chat/route.ts with strict Zod schema validation before hitting any contract.
  5. Session keys: Deploy a SessionKeyValidator module (ZeroDev, Biconomy, or Rhinestone) and wire it to components/AgentsClient.tsx.

🛡️ Security Notes

  • The NL Assistant intent parser is regex-only and runs on the client. Malicious prompts can never exceed UI-level scope.
  • Any future LLM call must go through:
    1. LLM generates JSON matching strict schema (Zod)
    2. Client previews the exact transaction
    3. User signs — or session key signs if within policy bounds
  • Session-key validators enforce caps on-chain, not in the UI.

⚠️ Disclaimer

Perpetual futures are high-risk. Liquidation can exceed deposited collateral. Not available to US persons. Always trade within your risk tolerance.

📜 License

MIT. © 2026 Astereum Labs.

About

Trade ETH & BTC perpetuals up to 25x with USDC collateral. Then let an AI agent run your playbook — bounded by on-chain session keys you control. Launch Trading

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors