Solver as a Service
Buy prediction market positions cross-chain. Pay on Tempo, get a position on Polymarket.
npx agentcash add https://solverasaservice-production.up.railway.app
How it works
POST /api/advisor with a search query. Claude (via Anthropic MPP) analyzes markets and returns a trade recommendation with ready-to-paste CLI commands.
Lock your position funds on-chain. Refundable if the solver doesn't fill by the deadline.
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).
tempo request -X POST --json '{"query":"bitcoin","budget_usd":5}' https://solverasaservice-production.up.railway.app/api/advisor# 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.
# 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 USDCtempo request -X GET "https://solverasaservice-production.up.railway.app/api/polymarket?q=bitcoin"
POST /api/advisor0.25 USDCtempo request -X POST --json '{"query":"bitcoin","budget_usd":5}' https://solverasaservice-production.up.railway.app/api/advisorPOST /api/buy-position0.50 USDCtempo request -X POST --json '{"order_id":"$ORDER_ID","recipient_polygon":"$RECIPIENT"}' https://solverasaservice-production.up.railway.app/api/buy-positionGET /api/proof?orderId=0x...free USDCcurl "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
0x7331A38bAa80aa37d88D893Ad135283c34c403700x4D97DCd97eC945f40cF65F87097ACe5EA0476045Merkle 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
)
)