FLOOR OTC — Token Swaps for the Agent Economy
FLOOR OTC routes token swaps two ways on Base mainnet:
- 1. CoW Protocol relay (recommended for agents) — the calling agent signs an EIP-712 order locally, FLOOR forwards it to CoW's batch auction. Solvers fill against all of Base's liquidity in ~30s. MEV-protected, no slippage to pool, no escrow custody. FLOOR earns 25 bps via CoW's
partnerFee mechanism, encoded in the appData the trader signs. - FloorEscrowV2 (for humans / 1:1 OTC) — both parties deposit into an on-chain escrow contract, atomic settlement, 25 bps protocol fee.
ERC-8004 Agent #31596 on Base Mainnet.
Quick Start
Get a quote (REST)
CODEBLOCK0
Get a quote (JSON-RPC / A2A)
CODEBLOCK1
Get live prices
CODEBLOCK2
Execute a trade (creates on-chain escrow)
CODEBLOCK3
Check trade status
CODEBLOCK4
Prepare a CoW order (agent-signed, FLOOR-relayed)
Step 1 — ask FLOOR to build the order:
CODEBLOCK5
You get back typed_data (EIP-712 domain + types + message), app_data (FLOOR's partnerFee doc + hash), quote_summary, preflight (balance + relayer allowance), and relayer.approve_calldata if you still need to approve the GPv2VaultRelayer.
Step 2 — sign locally with your wallet:
CODEBLOCK6
Step 3 — submit through FLOOR:
CODEBLOCK7
Returns order_uid + explorer_url. Track the fill at https://explorer.cow.fi/base/orders/{order_uid}.
Check a CoW order
CODEBLOCK8
Supported Tokens (Base Mainnet)
| Token | Address |
|---|
| USDC | INLINECODE9 |
| USDbC |
0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6Ca |
| DAI |
0x50c5725949A6F0c72E6C4a641F24049A917DB0Cb |
| WETH |
0x4200000000000000000000000000000000000006 |
Additional tokens supported for quotes only: ETH, BTC, WBTC, UNI, LINK, AAVE.
Pricing
Quotes are free at real CoinGecko market rates — zero spread. A 25 bps (0.25%) protocol fee is collected on every fill:
- - CoW relay: routed by solvers via CoW's
partnerFee mechanism in the appData the trader signs. - FloorEscrowV2: deducted from each side on settlement, immutable in the contract — no admin keys.
Skills
CoW relay (recommended for agents):
- - preparetrade — Build a CoW order for the calling agent's wallet to sign. Returns EIP-712 typed data, FLOOR appData (with 25 bps partner fee baked in), and a preflight check on the trader's balance + relayer allowance. FLOOR never custodies funds.
- submitsignedtrade — Forward a trader-signed CoW order to the CoW order book on Base. FLOOR validates the signature locally, then relays. Returns the orderUid and explorer URL. Solvers fill in the next batch (~30s).
- checkcow_order — Look up a CoW order by its 56-byte orderUid. Returns open / fulfilled / cancelled / expired plus executed amounts.
FloorEscrowV2 (1:1 OTC, for humans via web UI):
- - executetrade — Create on-chain escrow on Base (both parties deposit, atomic settlement)
- checktrade — Check escrow status by trade ID
Quotes & data:
- - getquote — Live swap quote at real market rates, zero spread
- getprices — Current token prices
Endpoints
- - Agent Card: INLINECODE14
- A2A (JSON-RPC): INLINECODE15
- REST Quote: INLINECODE16
- REST Prices: INLINECODE17
- MCP (SSE): INLINECODE18
- Health: INLINECODE19
On-Chain
- - Network: Base Mainnet (chain ID 8453)
- Escrow Contract (V2):
0x9EC9d882C93F52621CBD0d146D3F2e0929E53AA7 (verified on Basescan) - CoW Settlement: INLINECODE21
- CoW VaultRelayer (approve sell tokens here): INLINECODE22
- Protocol Fee: 25 bps (0.25%) — both venues
- Identity Registry: INLINECODE23
- Agent ID: 31596
No authentication required. Quotes are free.
FLOOR OTC — 面向代理经济的代币兑换
FLOOR OTC 在 Base 主网上提供两种代币兑换路由方式:
- 1. CoW 协议中继(推荐代理使用)——调用代理在本地签署 EIP-712 订单,FLOOR 将其转发至 CoW 的批量拍卖。求解器在大约 30 秒内利用 Base 的所有流动性完成订单。具备 MEV 保护,无池滑点,无需托管资金。FLOOR 通过 CoW 的 partnerFee 机制赚取 25 个基点,该费用编码在交易者签署的 appData 中。
- FloorEscrowV2(适用于人类/一对一 OTC)——双方将资金存入链上托管合约,原子结算,协议费 25 个基点。
Base 主网上的 ERC-8004 代理 #31596。
快速开始
获取报价(REST)
bash
curl -s https://floor-a2a-production.up.railway.app/api/quote?from=USDC&to=WETH&amount=1000 | jq
获取报价(JSON-RPC / A2A)
bash
curl -s -X POST https://floor-a2a-production.up.railway.app/a2a \
-H Content-Type: application/json \
-d {jsonrpc:2.0,method:tasks/send,params:{skillid:getquote,arguments:{fromtoken:USDC,totoken:WETH,amount:1000}},id:1}
获取实时价格
bash
curl -s https://floor-a2a-production.up.railway.app/api/prices | jq
执行交易(创建链上托管)
bash
curl -s -X POST https://floor-a2a-production.up.railway.app/a2a \
-H Content-Type: application/json \
-d {jsonrpc:2.0,method:tasks/send,params:{skillid:executetrade,arguments:{fromtoken:USDC,totoken:DAI,amount:1000}},id:1}
检查交易状态
bash
curl -s -X POST https://floor-a2a-production.up.railway.app/a2a \
-H Content-Type: application/json \
-d {jsonrpc:2.0,method:tasks/send,params:{skillid:checktrade,arguments:{tradeid:0xYOURTRADE_ID}},id:1}
准备 CoW 订单(代理签署,FLOOR 中继)
第 1 步 — 请求 FLOOR 构建订单:
bash
curl -s -X POST https://floor-a2a-production.up.railway.app/a2a \
-H Content-Type: application/json \
-d {jsonrpc:2.0,method:tasks/send,params:{skillid:preparetrade,arguments:{selltoken:USDC,buytoken:WETH,sellamount:1000,traderaddress:0xYourAgentWallet}},id:1}
您将获得 typeddata(EIP-712 域 + 类型 + 消息)、appdata(FLOOR 的 partnerFee 文档 + 哈希)、quotesummary、preflight(余额 + 中继授权额度),以及如果您仍需授权 GPv2VaultRelayer 时的 relayer.approvecalldata。
第 2 步 — 使用您的钱包在本地签署:
js
const signature = await wallet.signTypedData(
typed_data.domain,
typed_data.types,
typed_data.message
);
第 3 步 — 通过 FLOOR 提交:
bash
curl -s -X POST https://floor-a2a-production.up.railway.app/a2a \
-H Content-Type: application/json \
-d {jsonrpc:2.0,method:tasks/send,params:{skillid:submitsignedtrade,arguments:{order:{...},signature:0x...,traderaddress:0xYourAgentWallet}},id:1}
返回 orderuid + explorerurl。在 https://explorer.cow.fi/base/orders/{order_uid} 跟踪成交情况。
检查 CoW 订单
bash
curl -s -X POST https://floor-a2a-production.up.railway.app/a2a \
-H Content-Type: application/json \
-d {jsonrpc:2.0,method:tasks/send,params:{skillid:checkcoworder,arguments:{orderuid:0xYOURORDERUID}},id:1}
支持的代币(Base 主网)
| 代币 | 地址 |
|---|
| USDC | 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 |
| USDbC |
0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6Ca |
| DAI | 0x50c5725949A6F0c72E6C4a641F24049A917DB0Cb |
| WETH | 0x4200000000000000000000000000000000000006 |
仅支持报价的额外代币:ETH、BTC、WBTC、UNI、LINK、AAVE。
定价
报价免费,采用 CoinGecko 实时市场价格——零价差。每笔成交收取 25 个基点(0.25%)的协议费:
- - CoW 中继: 由求解器通过 CoW 的 partnerFee 机制路由,该费用编码在交易者签署的 appData 中。
- FloorEscrowV2: 结算时从双方扣除,合约中不可更改——无管理密钥。
技能
CoW 中继(推荐代理使用):
- - preparetrade — 为调用代理的钱包构建 CoW 订单以供签署。返回 EIP-712 类型数据、FLOOR appData(内置 25 个基点合作伙伴费用)以及交易者余额和中继授权额度的预检。FLOOR 从不托管资金。
- submitsignedtrade — 将交易者签署的 CoW 订单转发至 Base 上的 CoW 订单簿。FLOOR 在本地验证签名,然后进行中继。返回 orderUid 和浏览器 URL。求解器在下一批次(约 30 秒)内完成订单。
- checkcow_order — 通过 56 字节的 orderUid 查找 CoW 订单。返回开放/已成交/已取消/已过期状态及执行数量。
FloorEscrowV2(一对一 OTC,适用于通过网页界面的人类用户):
- - executetrade — 在 Base 上创建链上托管(双方存入资金,原子结算)
- checktrade — 通过交易 ID 检查托管状态
报价与数据:
- - getquote — 实时市场汇率的兑换报价,零价差
- getprices — 当前代币价格
端点
- - 代理卡片:https://floor-a2a-production.up.railway.app/.well-known/agent.json
- A2A(JSON-RPC):POST https://floor-a2a-production.up.railway.app/a2a
- REST 报价:GET https://floor-a2a-production.up.railway.app/api/quote?from=USDC&to=WETH&amount=1000
- REST 价格:GET https://floor-a2a-production.up.railway.app/api/prices
- MCP(SSE):https://zesty-solace-production-13de.up.railway.app/sse
- 健康检查:GET https://floor-a2a-production.up.railway.app/health
链上信息
- - 网络: Base 主网(链 ID 8453)
- 托管合约(V2): 0x9EC9d882C93F52621CBD0d146D3F2e0929E53AA7(已在 Basescan 上验证)
- CoW 结算: 0x9008D19f58AAbD9eD0D60971565AA8510560ab41
- CoV VaultRelayer(在此处授权卖出代币): 0xC92E8bdf79f0507f65a392b0ab4667716BFE0110
- 协议费: 25 个基点(0.25%)——两种途径均适用
- 身份注册表: 0