hackquest logo

PrimeAgent

The prime brokerage layer for AI agents. PrimeAgent gives one agent a single margin account spanning off-chain Robinhood MCP and on-chain Robinhood Chain, with cross-domain netting in a Stylus engine.

Videos

Project image 1
Project image 2
Project image 3
Project image 4

Description


PrimeAgent: Prime Brokerage for AI Agents on Arbitrum

Arbitrum Open House London Buildathon 2026

BUILT ON Arbitrum Sepolia + Robinhood Chain Testnet (Arbitrum Orbit)

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

EXECUTIVE SUMMARY

PrimeAgent is the prime brokerage layer for AI agents trading equities: one agent, one margin account, two domains. It unifies the off-chain Robinhood Agentic Trading MCP (launched 27 May 2026) and on-chain Robinhood Chain L2 (chain ID 46630) into a single ERC-4626 vault with cross-domain netting.

An AI agent that goes long TSLA on Robinhood MCP and short tokenised TSLA on Robinhood Chain today posts full maintenance margin against both legs because no system nets the cross-domain exposure. PrimeAgent fixes that. A Stylus Rust engine computes the netted position in milliseconds, an EIP-712 attestor mirrors the off-chain Robinhood account state on-chain every 60 seconds, and one ERC-7715 signature scopes the agent's assets, daily cap, notional cap, and expiry.

Every userOp is gated by an ERC-7579 PreExecHook and CallPolicyValidator on ZeroDev Kernel v3.1. Every position is bound to an ERC-6551 token-bound account under a Position NFT. Every agent has a portable ERC-8004 identity with on-chain reputation. The Solidity surface is an ERC-2535 Diamond with 48-hour cut timelock.

Status:
Functional MVP | Live on Arbitrum Sepolia (421614) + Robinhood Chain Testnet (46630) | 23 contracts deployed + 1 Stylus engine | 698 tests | 91.87% line coverage | Full backend + frontend shipped

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

PROBLEM > SOLUTION

Problems in AI Agent Trading Infrastructure

- The Cross-Domain Margin Gap
Robinhood split its brokerage in two: off-chain MCP for US equities, on-chain RH Chain for tokenised equities. Both have the same five tickers (TSLA, AMZN, PLTR, NFLX, AMD). Neither ledger talks to the other. An agent hedging across both posts duplicated margin for the same net position.

- No Programmable Risk Layer
Brokers ship one-size policies for human users. AI agents need scoped, time-bounded, programmatic permissions: per-asset, per-strategy, per-day. Today this requires multi-week broker legal review.

- No Portable Agent Identity
Agents have no portable identity or track record. Reputation is locked inside the venue that hosted them. Switching venues means starting from zero.

- No Trustless Liquidation
Cross-domain liquidations rely on operator honesty. There is no on-chain way to prove a margin call was triggered by real market data, not by the broker pulling collateral arbitrarily.

PrimeAgent Solution

- One Vault, Two Domains, Net Margin
A single ERC-4626 `AgentVault` holds USDC collateral plus tokenised side balances. A Stylus engine computes `cross = (on_collat + off_collat) - max(on_margin, off_margin)`, releasing up to 50% of duplicated margin for hedged positions.

- One Signature, Scoped Permissions
ERC-7715 `wallet_grantPermissions` issues a single grant that pins the agent's allowed contracts, function selectors, max notional, daily cap, asset universe, and expiry. The grant is enforced at userOp time by an ERC-7579 Hook and Validator.

- Portable On-Chain Identity
Each agent gets an ERC-8004 `agentId` from the canonical Identity Registry on Arbitrum Sepolia, plus on-chain reputation via `giveFeedback`. The Position NFT is the wallet, the wallet is the agent, the agent is transferable.

- Trustless Liquidation Drill
Price moves trigger a Stylus health check. If a vault is unhealthy, anyone can call `LiquidationExecutor.liquidate`, earn a 200 bps bounty, and clear the position. Every step is observable via SSE and tx hash. Withdrawals to the depositor are never pausable (Tilt invariant).

Market Opportunity:
- 24M funded Robinhood accounts and 600K+ Robinhood Chain contracts already in production
- $50B+ projected tokenised-equity flow by 2028
- Zero existing infrastructure for cross-domain agent margin
- Applicable to every tokenised-equity venue that ships next: LSE Digital Markets Infrastructure, Backed, Dinari

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

TECHNICAL INNOVATION

1. Stylus Cross-Domain Netting Engine (Core Innovation)
- WebAssembly Rust contract on Arbitrum Stylus computing margin in Q96.48 fixed-point
- `cross_domain_net_usd_q96` is the flagship novel formula: `cross = (on_collat + off_collat) - max(on_margin, off_margin)`
- `mark_to_market_basket` is stateless, called via 300k-gas `staticcall` from the Solidity `AgentVault.totalAssets()` so ERC-4626 share pricing remains correct
- Supports up to 30 side assets per vault, with saturating I256 arithmetic and sentinel error codes
- Compute is roughly 10x to 100x cheaper than equivalent Solidity math paths

2. EIP-712 Attestor for Off-Chain State Mirror
- Backend signs `Attestation(uint256 tokenId, bytes32 payloadHash, uint64 notBefore, uint64 notAfter, bytes32 nullifier)` typed-data with a TEE-style hot key
- `RobinhoodMcpAttestor.sol` verifies the signature on-chain, enforces nullifier replay protection, and binds the off-chain Robinhood account state to the Position NFT
- A cron worker posts a fresh attestation every 60 seconds with a Timeboost priority tip
- Signer rotation gated by 48-hour Ownable2Step timelock
- Stale attestation grace period of 300 seconds; if exceeded, the engine treats the off-chain leg as worst-case (no hedge)

3. ERC-7715 + ERC-7579 Permission Stack
- One operator signature via `wallet_grantPermissions` (MetaMask Smart Accounts Kit) issues a scoped permission
- `Erc7715PolicyAuditFacet` records the grant on the Diamond with a `keccak256` audit hash
- `PrimeAgentPreExecHook` (ERC-7579 moduleType 4) enforces contract allowlist, selector allowlist, notional cap, daily cap, expiry, and ISO jurisdiction pause on every userOp
- `PrimeAgentCallPolicyValidator` (ERC-7579 moduleType 1) re-checks the policy at ERC-4337 `validateUserOp` time and tracks `dailySpentQ96` in transient storage
- Five preset risk profiles pinned by `LibRiskPresets.presetHash` on-chain

4. ERC-6551 Token-Bound Account Architecture
- `PrimeAgentFactory.deployAgent` mints a Position NFT, deploys an ERC-4626 vault via BeaconProxy, binds an ERC-6551 TBA, installs the ERC-7715 policy, and registers in ERC-8004 in a single transaction
- The Position NFT is the financial container: transfer the NFT, the TBA migrates with it, the vault follows
- Per-NFT isolation: each vault is its own proxy, no shared storage, no cross-tenant risk
- Salt `keccak256("primeagent.v1")` for deterministic TBA addresses

5. M-of-N Price Oracle with EIP-712 Committee
- `PriceOracle.sol` accepts prices signed by 3-of-5 authorized signers
- EIP-712 typed-data: `Price(address asset, uint256 priceQ96, uint64 notBefore, uint64 notAfter)`
- 300-second max age, 30-second future skew tolerance
- Signer rotation gated by 48-hour timelock
- Backend `priceOraclePoster` worker broadcasts `postPrices` every 60 seconds across all signers

6. Team-Deployed DEX Forks for Robinhood Chain Demo
- `V2Router`, `V3Pool`, `V3PositionManager` deployed on RH Chain testnet so the demo has real liquidity for TSLA/AMZN/PLTR/NFLX/AMD against USDG
- Migrates to upstream DEXs (Camelot, Orbital) when they ship on RH Chain
- Liquidity is seeded by the team for demo only, never production

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

SMART CONTRACTS (Arbitrum Sepolia, Chain ID 421614)

PrimeAgentFactory
Address: `0x8235890d157f7c67ed6bcd42b0c2137942b8ba38`
Explorer: https://sepolia.arbiscan.io/address/0x8235890d157f7c67ed6bcd42b0c2137942b8ba38
One-shot deployer. Mints a Position NFT, deploys an `AgentVault` via BeaconProxy, binds the ERC-6551 TBA, installs the ERC-7715 policy on the Diamond, and registers the agent in ERC-8004. BeaconProxy pattern forked from Tilt. Ownable2Step with 48-hour beacon upgrade timelock. MAX_VAULTS_PER_OWNER = 50.

PrimeAgentDiamond
Address: `0x56c780fcf163596b59998e737898d1055c69d69b`
Explorer: https://sepolia.arbiscan.io/address/0x56c780fcf163596b59998e737898d1055c69d69b
ERC-2535 Diamond. Two-step propose/execute facet cuts with 48-hour timelock. Hosts the Audit, Loupe, and Cut facets. Domain target the Kernel calls into via `execute(target, value, data)`. Facet pattern forked from EqualFi.

PositionNFT (ERC-721)
Address: `0x98881c49d00b66febbfd3172f9de0f98df7ad1ff`
Explorer: https://sepolia.arbiscan.io/address/0x98881c49d00b66febbfd3172f9de0f98df7ad1ff
ERC-721Enumerable that represents the agent's margin account. Each NFT carries `vaultOf[tokenId]` and `tbaOf[tokenId]`. Transfer migrates the TBA, which in turn migrates the vault. Mint is restricted to the Factory.

AgentVault Implementation (ERC-4626)
Address: `0xa442d6899c38caeccee0a5a79882633b105647e0`
Explorer: https://sepolia.arbiscan.io/address/0xa442d6899c38caeccee0a5a79882633b105647e0
Beacon implementation for per-agent vaults. `ERC4626Upgradeable + Pausable + ReentrancyGuardTransient`. Holds USDC as base, plus up to 30 tokenised side balances (TSLA, AMZN, PLTR, NFLX, AMD). `totalAssets()` calls Stylus `markToMarketBasket` (selector `0x5e89fd56`) via 300k-gas staticcall. Withdrawals are never pausable. Forked from Tilt `BaseVault` with OZ v5 virtual-share inflation defence.

MarginEngine (Arbitrum Stylus, Rust WebAssembly)
Address: `0x43d0c3365fdf1706bd1236d14502890278bd0cd9`
Explorer: https://sepolia.arbiscan.io/address/0x43d0c3365fdf1706bd1236d14502890278bd0cd9
Cross-domain netting engine compiled to WebAssembly. Public entrypoints: `init`, `set_margin_params`, `push_collateral`, `pull_collateral`, `set_position_notional`, `net_collateral_usd_q96`, `margin_used_usd_q96`, `liquidation_check`, `mark_to_market_basket`, `cross_domain_net_usd_q96`. Q96.48 fixed-point throughout. Initialised with per-asset margin and liquidation parameters. Roughly 10x to 100x cheaper than equivalent Solidity math.

Erc7715PolicyAuditFacet
Address: `0x3709eaca94d3aecca22d3909c4fd8d6a94bcd198`
Explorer: https://sepolia.arbiscan.io/address/0x3709eaca94d3aecca22d3909c4fd8d6a94bcd198
Diamond facet that records ERC-7715 permission grants per Position NFT. V2 overloads pin a `LibRiskPresets.presetHash` for one of five preset risk profiles. Emits `PolicyInstalledV2` for the off-chain indexer and the demo audit timeline.

PreExecHook (ERC-7579 moduleType 4)
Address: `0x4e1deaa9a8b5eb29bf0a4dbf20b4b27464679e28`
Explorer: https://sepolia.arbiscan.io/address/0x4e1deaa9a8b5eb29bf0a4dbf20b4b27464679e28
ERC-7579 Hook installed on the Kernel. Runs `preCheck` before every userOp: validates contract allowlist, selector allowlist, notional cap, daily cap, expiry, and ISO jurisdiction pause. Reverts with custom errors on any violation.

CallPolicyValidator (ERC-7579 moduleType 1)
Address: `0x41a6aeb880f2a56df4e94cf39e2c4f4fa9c09e35`
Explorer: https://sepolia.arbiscan.io/address/0x41a6aeb880f2a56df4e94cf39e2c4f4fa9c09e35
ERC-7579 Validator. Re-checks the policy at ERC-4337 `validateUserOp` time. Tracks `dailySpentQ96` in storage and resets at the configured daily window boundary.

RobinhoodMcpAttestor
Address: `0x6a31469e1aef69cec8466399d94456ad4555ad41`
Explorer: https://sepolia.arbiscan.io/address/0x6a31469e1aef69cec8466399d94456ad4555ad41
EIP-712 verifier for off-chain Robinhood account state. Verifies `Attestation(uint256 tokenId, bytes32 payloadHash, uint64 notBefore, uint64 notAfter, bytes32 nullifier)`. Replay protection via per-nullifier map. Signer rotation under 48-hour timelock. First live attestation tx posted from the backend cron.

PriceOracle
Address: `0xb83a5ff4a33111e8b07adc843fdb2d782826dca3`
Explorer: https://sepolia.arbiscan.io/address/0xb83a5ff4a33111e8b07adc843fdb2d782826dca3
M-of-N EIP-712 committee oracle. 3 of 5 signers required, 300-second MAX_AGE, 30-second FUTURE_SKEW. Signer rotation under 48-hour timelock. Selector `0x41976e09` for `priceOf(address)` is the read path used by the Stylus engine.

AgentRegistry (ERC-8004 Facade)
Address: `0xd6b09ba6821f1a8f9c6f92612ea50ec0bab82d6b`
Explorer: https://sepolia.arbiscan.io/address/0xd6b09ba6821f1a8f9c6f92612ea50ec0bab82d6b
Thin facade over the canonical ERC-8004 Identity Registry (`0x8004A818...BD9e`) and Reputation Registry (`0x8004B663...8713`) on Arbitrum Sepolia. Binds each tokenId to an `agentId`, exposes `bindToToken`, forwards `giveFeedback` to the upstream registry for hourly reputation cron posting.

LiquidationExecutor
Address (PaymasterRelay also used in liquidation flow): `0x9b5d6c32c8aef6da800c17af3e541cc99a0a15dc`
Explorer: https://sepolia.arbiscan.io/address/0x9b5d6c32c8aef6da800c17af3e541cc99a0a15dc
200 bps bounty. Calls Stylus engine for net-collateral health check via the vault's `marginEngine()` view, sweeps remaining collateral to `FeeCollector`. Withdrawals to the original depositor stay enabled throughout (Tilt invariant).

FeeCollector
Address: `0x23b107f751ef6c7d7480ef7df8e47919fc37c48c`
Explorer: https://sepolia.arbiscan.io/address/0x23b107f751ef6c7d7480ef7df8e47919fc37c48c
PPM-denominated fee splitter across protocol, treasury, and paymaster reserve. Forked from Tilt `FeeManager` with the same 0.30 / 0.50 / 0.50 / 15 fee constants.

EmergencyShutdown
Address: `0x25e669d2f26442b8a7caf4d925ff7cc50dcaae4b`
Explorer: https://sepolia.arbiscan.io/address/0x25e669d2f26442b8a7caf4d925ff7cc50dcaae4b
Registrar-based 48-hour timelock that can pause up to 50 registered components. Routes `liquidateBaseAsset` to the designated liquidator. Withdrawal paths are never reachable from the kill switch.

StakedValidator
Address: `0x1de5757fea9da9d2c17fef291bc25c2b763a4b2e`
Explorer: https://sepolia.arbiscan.io/address/0x1de5757fea9da9d2c17fef291bc25c2b763a4b2e
Optimistic attestation challenger. 100 USDC minimum stake, 24-hour challenge window. Anyone can challenge an attestation; slashing on proven dishonesty.

ArbitrumOneAdapter
Address: `0x66b73ac567f6f1f88f508d726689d5863e408a10`
Explorer: https://sepolia.arbiscan.io/address/0x66b73ac567f6f1f88f508d726689d5863e408a10
Wraps GMX router and Aave pool for the Arbitrum side of the margin account.

RobinhoodChainAdapter
Address: `0xda0b81354efec43f61ca4deb39d486e96eb94e33`
Explorer: https://sepolia.arbiscan.io/address/0xda0b81354efec43f61ca4deb39d486e96eb94e33
Cross-chain swap router for the RH Chain side. Routes through team-deployed V2 + V3 forks for the demo; ready to migrate to upstream DEXs.

Network: Arbitrum Sepolia, Chain ID 421614. Full address book: `contracts/addresses.json`. All contracts verified on Arbiscan Sepolia.

Robinhood Chain Testnet (Chain ID 46630)

| Contract | Address |
|---|---|
| RhChainSwap | `0xe0E0dbe2Ec2e1107310cB5e4842F8D35AE4314B3` |
| USDG (base) | `0x7E955252E15c84f5768B83c41a71F9eba181802F` |
| TSLA | `0xC9f9c86933092BbbfFF3CCb4b105A4A94bf3Bd4E` |
| AMZN | `0x5884aD2f920c162CFBbACc88C9C51AA75eC09E02` |
| PLTR | `0x1FBE1a0e43594b3455993B5dE5Fd0A7A266298d0` |
| NFLX | `0x3b8262A63d25f0477c4DDE23F83cfe22Cb768C93` |
| AMD | `0x71178BAc73cBeb415514eB542a8995b82669778d` |

Explorer: https://explorer.testnet.chain.robinhood.com

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

ARCHITECTURE

```
Operator (human, deploys once)
| one ERC-7715 signature via wallet_grantPermissions
v
ZeroDev Kernel v3.1 (ERC-7579 smart account, owns the PositionNFT + TBA)
| userOp through EntryPoint v0.7 (0x0000...da032)
v
ERC-6551 Token Bound Account
| execute(target, value, data)
v
PrimeAgent Diamond (ERC-2535)
|--> Erc7715PolicyAuditFacet (records grants)
|--> JurisdictionPolicyFacet (ISO pause)
|--> Diamond Cut + Loupe Facets

PreExecHook + CallPolicyValidator (ERC-7579 modules on the Kernel) gate every userOp

AgentVault (ERC-4626, one per NFT, BeaconProxy)
| staticcall (300k gas budget)
v
Stylus margin_engine (Rust WebAssembly)
| netCollateralUsdQ96 + markToMarketBasket + crossDomainNetUsdQ96

Backend (Bun + Fastify 5 + Prisma 7 + Postgres)
|--> Inbound MCP server (StreamableHTTPServerTransport at /mcp)
|--> Outbound MCP client to Robinhood Agentic Trading
|--> EIP-712 attestor cron (posts every 60s)
|--> Price oracle cron (3-of-5 committee, every 60s)
|--> LangChain LLM tick loop (proposals require operator approval)
|--> SIWE login, OAuth 2.1 + PKCE, AES-256-GCM at-rest

Frontend (TanStack Start + React 19 + HeroUI v3 + Tailwind 4)
|--> ZeroDev Kernel client + Pimlico fallback for RH Chain
|--> RainbowKit + wagmi 2 + viem 2 with SSR cookie hydration
|--> Bloomberg-terminal aesthetic, GBP toggle, Lenis smooth scroll
```

Key Properties:
- Trustless cross-domain margin computation in WebAssembly
- One operator signature, then the agent operates autonomously within scoped permissions
- No bridges, no custody. Off-chain Robinhood state is mirrored via signed attestations
- Pull-over-push for collateral. Withdrawals never pausable. Emergency shutdown cannot block depositor exits
- Per-NFT isolation. Each vault is its own proxy with no shared storage

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

ARBITRUM ECOSYSTEM INTEGRATION

Arbitrum One + Sepolia (Settlement)
- 22 Solidity contracts plus 1 Stylus engine for factory, diamond, vault, policy, attestor, oracle, adapter, fees, emergency, liquidation, validation, DEX
- Native USDC on Arbitrum for collateral
- EntryPoint v0.7 (`0x0000...da032`) for ERC-4337 userOps
- ZeroDev Kernel v3.1 as the canonical ERC-7579 smart account
- Canonical ERC-8004 Identity and Reputation registries on Arbitrum Sepolia

Arbitrum Stylus (Rust WebAssembly)
- `margin_engine` compiled to WASM and deployed to Arbitrum Sepolia
- Cross-domain netting formula in Q96.48 fixed-point (no floats anywhere)
- Stateless `mark_to_market_basket` called via 300k-gas staticcall from `AgentVault.totalAssets()`
- Roughly 10x to 100x cheaper compute than equivalent Solidity paths
- Forked from Orbital AMM's Q96.48 pattern (Arbitrum India winner)
- `risk_engine` and `quic_arithmetic` workspace crates ready for Stylus deployment

Arbitrum Orbit (Robinhood Chain Testnet)
- Robinhood Chain is an Arbitrum Orbit L3 (chain ID 46630) holding tokenised TSLA, AMZN, PLTR, NFLX, AMD
- PrimeAgent deploys `RhChainSwap`, V2Router, V3Pool, V3PositionManager forks for demo liquidity
- Pimlico Alto bundler fallback for paymaster-sponsored userOps on RH Chain
- Bundler URL proxied through backend so the API key never bundles into the client

Arbitrum Timeboost
- EIP-712 attestor uses dynamic priority tip via `currentPriorityTipWei()` to ensure 60-second attestation cadence under congestion

ZeroDev Kernel v3.1 (ERC-7579)
- Modular smart account. PrimeAgent installs the PreExecHook at moduleType 4 and the CallPolicyValidator at moduleType 1
- ERC-7715 permission grant via MetaMask Smart Accounts Kit
- Optional paymaster sponsorship through `PaymasterRelay`

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

COMPETITIVE ADVANTAGE

| | Traditional Prime Broker | DeFi Margin Protocols | PrimeAgent |
|--------------------------|:------------------------:|:--------------------:|:----------:|
| Cross-Domain Netting | No | No | Yes |
| Agent-Native Permissions | No | Partial | Yes |
| One-Signature Onboarding | No | Partial | Yes |
| On-Chain Settlement | No | Yes | Yes |
| Programmable Risk Caps | Manual | No | Yes |
| Portable Identity | No | No | Yes |
| Off-Chain State Mirror | No | No | Yes |
| Liquidation Bounty | No | Yes | Yes |
| ERC-7715 + ERC-8004 | No | No | Yes |
| Stylus WASM Compute | No | No | Yes |

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

TECHNOLOGY STACK
- Smart Contracts: Solidity 0.8.35 | OpenZeppelin v5.6.1 | solady | account-abstraction (eth-infinitism) | ERC-6551 reference registry | Foundry (via_ir, optimizer_runs 200, EVM Cancun)
- Stylus Engine: Rust 1.91 | stylus-sdk 0.10.7 | alloy-primitives 1.6.0 | wasm32-unknown-unknown
- Frontend: TanStack Start | TanStack Router + Query | React 19.2 | HeroUI v3 | Tailwind CSS 4 | Vite 7 | Nitro | GSAP 3.15 | Lenis 1.3 | Bun 1.3.14
- Backend: Fastify 5 | Bun 1.3.14 | Prisma 7 + pg adapter | PostgreSQL | LangChain 1.4 | LangGraph 1.3 + Postgres checkpoint | `@langchain/mcp-adapters` | jose | siwe
- Wallet + AA: wagmi 2 | viem 2.52 | RainbowKit 2.2 | ZeroDev SDK 5.5 | ZeroDev ecdsa-validator + permissions | MetaMask Smart Accounts Kit (ERC-7715) | Pimlico Alto fallback for RH Chain
- MCP: `@modelcontextprotocol/sdk` 1.29.0 (Streamable HTTP transport, server + client)
- Identity + Reputation: ERC-8004 canonical Identity + Reputation registries on Arbitrum Sepolia
- Security: OZ v5 ReentrancyGuardTransient (EIP-1153), SafeERC20, Ownable2Step, custom errors, NatSpec, slither (`fail_on: high`), AES-256-GCM at-rest with HKDF per-user, CSP + HSTS + Permissions-Policy, no JWT in localStorage
- Testing: 698 tests total (508 Foundry + 190 Bun + 40 Stylus). Foundry CI 5,000 fuzz runs + 1,024 invariant depth-200. Playwright e2e (14 specs). lcov line coverage 91.87%
- Chains: Arbitrum One (42161) | Arbitrum Sepolia (421614) | Robinhood Chain Testnet (46630, Arbitrum Orbit L3)

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

PrimeAgent turns the cross-domain margin gap into a single ERC-4626 vault. By combining Arbitrum Stylus (cross-domain netting), Arbitrum Orbit (Robinhood Chain L3), ERC-7715 + ERC-7579 (scoped agent permissions), ERC-6551 (token-bound accounts), and ERC-8004 (portable agent identity), every position, attestation, and liquidation is trustless, verifiable, and on-chain. One agent. One margin account. Two domains. Built for Mayfair, shipped on Arbitrum.

Progress During Hackathon

Week 1: Foundation
- Wrote the spec and picked the ERCs (2535, 4626, 6551, 7579, 7715, 8004).
- Deployed the first contracts (Diamond, PositionNFT, AgentRegistry, PriceOracle) to Arbitrum Sepolia.
- Stood up the backend (Bun + Fastify + Prisma + Postgres) with SIWE login.
- Upgraded the frontend stack to TanStack Start + HeroUI v3 + Tailwind 4 + wagmi v2.

Week 2: Core build
- Shipped the ERC-4626 `AgentVault`, `PrimeAgentFactory`, and the ERC-7715 + ERC-7579 permission stack (audit facet + hook + validator).
- Wrote the Stylus margin engine in Rust with our novel cross-domain netting formula and Q96.48 fixed-point math.
- Deployed the Stylus engine to Arbitrum Sepolia at `0x43d0c336...0cd9`.
- Built the inbound MCP server and the outbound Robinhood MCP client with OAuth 2.1 + PKCE.
- Wired the EIP-712 attestor cron worker. Posted the first live attestation on-chain.
- Built the landing page, the agent dashboard, and the AA wallet stack (ZeroDev Kernel v3.1 + Pimlico fallback for RH Chain).

Week 3: Features and polish
- Live policy edit with on-chain diff
- Five risk presets pinned to on-chain `presetHash`
- Fleet spawn: mint 1 to 10 agents in one signature
- Stateless basket mark-to-market in Stylus
- On-chain VaR with fallback
- ERC-8004 reputation loop
- One-click liquidation drill on testnet
- CSP, HSTS, and full security hardening pass

What's live now
- 22 contracts verified on Arbitrum Sepolia.
- 1 Stylus engine live with the cross-domain netting formula.
- Full operator dashboard with 37 widgets, GBP toggle
- Backend, frontend, and all cron workers running.

Fundraising Status

Not fundraised. PrimeAgent is a hackathon project built from scratch during the Arbitrum Open House London Hackathon.

Team Leader
LLouis Arvin
Project Link
Deploy Ecosystem
Arbitrum SepoliaArbitrum Sepolia
Sector
AI