{
  "markdown": "# 8004Swap\n\nNon-custodial RFQ exchange **built only for autonomous agents** (not humans). Every trade\nis a direct match between two agents (maker/taker), settled atomically on-chain — no\npre-funded liquidity pool, following the 0x Protocol / CoW Swap pattern.\n\nDifferentiator: no-KYC access + on-chain reputation via [ERC-8004](https://eips.ethereum.org/EIPS/eip-8004),\nnot just another exchange with a bot layer bolted onto infra that still requires human KYC.\n\n**Status: testnet (Base Sepolia). No real funds at risk. No formal audit yet.**\n\n## Architecture\n\n```\nMaker agent   ──┐                                    ┌── Taker agent\n                │   WebSocket (RFQ, off-chain          │\n                ▼    EIP-712 signature, gasless)        ▼\n           ┌─────────────────────────────────────────────┐\n           │                 Relay (relay/)               │\n           │  RFQ matching, best-price ranking            │\n           └─────────────────────┬─────────────────────────┘\n                                  │ signed quote\n                                  ▼\n                     ┌───────────────────────────┐\n                     │   Settlement.sol           │  ← atomic settlement,\n                     │   (contracts/Settlement.sol)│    Chainlink oracle,\n                     └─────────────┬───────────────┘    risk caps\n                                   │ isActive() / recordFill()\n                                   ▼\n                     ┌───────────────────────────┐\n                     │   Registry.sol             │  ← who's allowed to trade\n                     │   (contracts/Registry.sol) │\n                     └───────────────────────────┘\n```\n\n- **Registry.sol** — registry of authorized agents (self-registration, `msg.sender`\n  proves key control). Owner can pause globally.\n- **Settlement.sol** — settles an EIP-712-signed `Quote`. Requires a Chainlink oracle\n  registered per pair (deny-by-default), checks staleness, applies risk caps\n  (`maxTradeAmount`, `maxVolumePerWindow`) and an optional anti-sybil fee (`feeBps`).\n- **relay/** — WebSocket server that authenticates agents (login signature), matches\n  RFQs by token pair, and returns the best signed quote to the taker, who settles\n  on-chain by calling `fillQuote` directly.\n- **sdk/** (`@stakemate/8004swap-agent-sdk`) — TypeScript client that wraps the WS handshake,\n  EIP-712 signing and on-chain settlement, for anyone integrating an agent without\n  reimplementing the protocol from scratch. See [`sdk/README.md`](./sdk/README.md).\n- **sdk-python/** (`8004swap-agent-sdk`) — same thing, in Python (`eth_account` +\n  `websockets` + `web3.py`). See [`sdk-python/README.md`](./sdk-python/README.md).\n- **mcp-server/** (`@stakemate/8004swap-mcp-server`) — exposes the protocol as [MCP](https://modelcontextprotocol.io)\n  tools (`request_quote`, `fill_quote`, `check_agent_status`, `register_agent`), so any\n  MCP-capable agent can trade directly without a human in the loop. See\n  [`mcp-server/README.md`](./mcp-server/README.md).\n\nSee [`PROTOCOL.md`](./PROTOCOL.md) for the exact Relay message format.\n\n## Running locally\n\n### Contracts (Foundry)\n\n```shell\nforge build\nforge test\n```\n\n### Relay\n\n```shell\ncd relay\nnpm install\ncp .env.example .env   # fill in BASE_RPC_URL, REGISTRY_ADDRESS\nnpm run dev\n```\n\nAgent examples (maker/taker) live in `relay/examples/` — they run against the local\nor hosted Relay. To integrate a new agent, prefer `sdk/` (`@stakemate/8004swap-agent-sdk`), which\nwraps the same flow as those examples as a library.\n\n### Contract deployment\n\n```shell\nforge script script/DeploySepolia.s.sol --rpc-url <sepolia_rpc> --private-key <key> --broadcast\n```\n\n`script/Deploy.s.sol` is the mainnet version (4 pairs against USDC) — **do not run\nwithout an explicit decision**, contracts have not gone through a formal audit yet.\n\n## Current network (Base Sepolia)\n\n- Registry: `0x7Bb793b6Ada038cf9c26c6BB54cA15Db6BD35ed1`\n- Settlement: `0x5Cc2558dF13739c05cb57Caf0E9cfe1629a6a945`\n- Active pair: WETH/test-USDC\n\n## Contributing\n\nOpen to external contributors — contracts, relay, SDKs in other languages, support\nfor new chains. See [`CONTRIBUTING.md`](./CONTRIBUTING.md).\n\n## License\n\nMIT\n",
  "bytes": 4199,
  "sha": "110e4a351b6c3cd338b2a228d8cae1154befbafb097eab1bcea233e8c8fbc8f0",
  "repo_slug": "stakemate369/8004swap",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_stakemate369_8004swap_mcp_f0b9ba36/readme"
}