Solver as a Service

Buy prediction market positions cross-chain. Pay on Tempo, get a position on Polymarket.

Install on your agentview on mppscan
npx agentcash add https://solverasaservice-production.up.railway.app

How it works

1
Ask the advisorTempo

POST /api/advisor with a search query. Claude (via Anthropic MPP) analyzes markets and returns a trade recommendation with ready-to-paste CLI commands.

2
Deposit USDC into escrowTempo

Lock your position funds on-chain. Refundable if the solver doesn't fill by the deadline.

3
Solver fills the orderTempo → Polygon

One API call. The solver buys CTF on Polymarket, transfers to your Polygon address, verifies the transfer, builds a merkle proof, posts the root on-chain, and claims from escrow. Full settlement.

Quick start

Prerequisites: Tempo CLI installed, Foundry (cast) installed, funded Tempo passkey wallet (tempo wallet login).

1. Get a recommendation
tempo request -X POST --json '{"query":"bitcoin","budget_usd":5}' https://solverasaservice-production.up.railway.app/api/advisor
2. Execute the commands
# Paste the full advisor response to your LLM (Claude Code, Cursor, etc.)
# and ask it to execute the next_steps commands.
# Or run them manually — they're ready to copy-paste.
3. Done
# Your position appears in your Polygon wallet.
# If you used your Polymarket Safe address, it shows in the Polymarket UI.

Use your Polymarket Safe address as the recipient so the position shows in the Polymarket UI. Find it at polymarket.com/portfolio. Keep amounts small ($1-5 USDC). The solver has limited liquidity.

API

GET /api/polymarket?q=bitcoin0.10 USDC
Search Polymarket markets. Returns token IDs, prices, liquidity.
tempo request -X GET "https://solverasaservice-production.up.railway.app/api/polymarket?q=bitcoin"
POST /api/advisor0.25 USDC
LLM market advisor. Claude analyzes markets via Anthropic MPP and recommends trades with deposit params.
tempo request -X POST --json '{"query":"bitcoin","budget_usd":5}' https://solverasaservice-production.up.railway.app/api/advisor
POST /api/buy-position0.50 USDC
Fill an escrow order. Buys CTF, transfers to user, verifies, proves, settles. One call.
tempo request -X POST --json '{"order_id":"$ORDER_ID","recipient_polygon":"$RECIPIENT"}' https://solverasaservice-production.up.railway.app/api/buy-position
GET /api/proof?orderId=0x...free USDC
Merkle proof for a fulfilled order.
curl "https://solverasaservice-production.up.railway.app/api/proof?orderId=$ORDER_ID"

Refund

If the solver doesn't fill your order, your funds are safe. After the deadline (1 hour), call refund() to get your USDC back:

cast send --rpc-url https://rpc.tempo.xyz --tempo.access-key $USER_KEY --tempo.root-account $USER_WALLET --tempo.fee-token 0x20c000000000000000000000b9537d11c60e8b50 0x7331A38bAa80aa37d88D893Ad135283c34c40370 "refund(bytes32)" $ORDER_ID

Trust model

Funds locked until proven

Neither side trusts the other. The user's USDC is locked in escrow on Tempo. The solver can only claim it by submitting a merkle proof that passes on-chain verification. If the solver doesn't fill the order by the deadline, the user calls refund() and gets their USDC back. The solver only acts because the escrowed funds are guaranteed if they deliver.

Verified on Polygon, proven on Tempo

The solver constructs a merkle leaf from the escrow order ID and the Polygon transaction hash of the CTF transfer. Before the leaf is added to the tree, the service fetches the Polygon transaction receipt and verifies it: the tx must contain a TransferSingle event on the CTF contract, the recipient must match the address committed in the escrow order, and the correct token must have been transferred. Only verified transfers are included in the tree.

Cryptographic, not optimistic

The merkle root is posted on-chain to the escrow contract on Tempo. When the solver calls claimWithProof(), the contract recomputes the leaf from the provided order ID and Polygon tx hash, verifies its inclusion in the committed root, and releases USDC if valid. No challenge period. No oracle committee. The proof is the settlement.

Contracts

PolymarketEscrowTempo (4217)
0x7331A38bAa80aa37d88D893Ad135283c34c40370
CTF (Polymarket)Polygon (137)
0x4D97DCd97eC945f40cF65F87097ACe5EA0476045

Merkle proof format

Binary merkle tree. The proof is concatenated 32-byte sibling hashes. The leaf index determines left/right ordering at each level. Verified on-chain by WithdrawTrieVerifier (59 lines, no dependencies).

leaf = keccak256(
  abi.encodePacked(
    keccak256(abi.encodePacked(orderId, polygonTxHash)),
    orderId
  )
)