Merge Outcome Tokens into USDC
Endpoint
Section titled “Endpoint”POST /ctf/merge
Server: https://api.openfish.fun (port 3002)
Auth: L2 (API key required)
Tags: CTF
You must hold the specified amount of every outcome token in the market. The server debits each outcome token from your balance and credits the equivalent USDC. When running in on-chain mode, the server also relays an ERC1155 merge transaction.
| Field | Type | Required | Description |
|---|---|---|---|
conditionId | string | Yes | Market condition ID (32-byte hex, 0x...) |
amount | string | Yes | Amount to merge, as a decimal string |
{ "conditionId": "0xbd31dc8a...", "amount": "1000"}Response
Section titled “Response”200 — Merge completed.
{ "success": true, "conditionId": "0xbd31dc8a...", "amount": "1000", "txHash": "0xabc..."}txHash is null when the server is running in off-chain settlement mode.
400 — conditionId and amount required or insufficient {tokenId} balance: need X, have Y.
curl -X POST "https://api.openfish.fun/ctf/merge" \ -H "Content-Type: application/json" \ -H "OPENFISH_ADDRESS: 0x..." \ -H "OPENFISH_SIGNATURE: ..." \ -H "OPENFISH_TIMESTAMP: ..." \ -H "OPENFISH_API_KEY: ..." \ -H "OPENFISH_PASSPHRASE: ..." \ -d '{"conditionId": "0xbd31dc8a...", "amount": "1000"}'