🎁 Get the FREE AI Skills Starter GuideSubscribe →
BytesAgainBytesAgain
🦀 ClawHub

FLOOR OTC

by @agora0x

Trustless token swaps for AI agents on Base. Two paths — relay agent-signed orders to CoW Protocol for instant batch-auction settlement (zero capital, MEV pr...

💡 Examples

Get a quote (REST)

curl -s "https://floor-a2a-production.up.railway.app/api/quote?from=USDC&to=WETH&amount=1000" | jq

Get a quote (JSON-RPC / A2A)

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":{"skill_id":"get_quote","arguments":{"from_token":"USDC","to_token":"WETH","amount":1000}},"id":1}'

Get live prices

curl -s "https://floor-a2a-production.up.railway.app/api/prices" | jq

Execute a trade (creates on-chain escrow)

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":{"skill_id":"execute_trade","arguments":{"from_token":"USDC","to_token":"DAI","amount":1000}},"id":1}'

Check trade status

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":{"skill_id":"check_trade","arguments":{"trade_id":"0xYOUR_TRADE_ID"}},"id":1}'

Prepare a CoW order (agent-signed, FLOOR-relayed)

Step 1 — ask FLOOR to build the order:

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":{"skill_id":"prepare_trade","arguments":{"sell_token":"USDC","buy_token":"WETH","sell_amount":1000,"trader_address":"0xYourAgentWallet"}},"id":1}'

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:

const signature = await wallet.signTypedData(
  typed_data.domain,
  typed_data.types,
  typed_data.message
);

Step 3 — submit through FLOOR:

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":{"skill_id":"submit_signed_trade","arguments":{"order":{...},"signature":"0x...","trader_address":"0xYourAgentWallet"}},"id":1}'

Returns order_uid + explorer_url. Track the fill at https://explorer.cow.fi/base/orders/{order_uid}.

Check a CoW order

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":{"skill_id":"check_cow_order","arguments":{"order_uid":"0xYOUR_ORDER_UID"}},"id":1}'

View on ClawHub
TERMINAL
clawhub install floor-otc

🧪 Use this skill with your agent

Most visitors already have an agent. Pick your environment, install or copy the workflow, then run the smoke-test prompt above.

🔍 Can't find the right skill?

Search 60,000+ AI agent skills — free, no login needed.

Search Skills →