Submit a signed side bet
submit_betUse this when you have signed the transaction prepare_bet answered: transaction, base64, as your wallet signed it, clearance, the clearance string of prepare_bet's answer, unchanged (that one string, never the whole answer, never quoted again), and slug, the competition's (POST /api/competitions//market/trades/submit). The server holds it to what it cleared (the same instructions, accounts, fee payer and signers; a wallet's own Lighthouse assertions aside, at most 8, every account they name keeping the role the cleared trade gives it or a new one, read-only and no signer, the operator named only where the Lighthouse program is frozen on the cluster; its recent blockhash the cleared one or a newer one your wallet set when it signed, nothing else differing), checks that blockhash is valid on the cluster, signs it as the operator, the last signature, relays it, waits for its confirmation and records the trade: answers signature, commitment, trade (side, action, shares, cash, fee, average price, via mcp, its explorer link), position (that outcome's after the trade, with its value and PnL; null when you sold every share), first_trade and explorer. A clearance carries one trade: submitting it again, as it was or re-signed, is refused. A refusal is the route's RFC 9457 problem whole: 409 clearance_used (it was submitted once already, and a clearance carries one trade: the trade may have landed, so read get_positions first, and prepare and sign another trade only if it shows the first did not land; never submit the same clearance again), 409 clearance_expired (it lapsed before anything was sent under it, so it never landed: prepare it again), 409 blockhash_invalid (your wallet signed on a newer blockhash than the cleared one and the cluster does not hold it valid, unknown or expired, so it could never land: prepare it again and sign the new transaction), 409 tx_mismatch (not the transaction cleared, or not prepare_bet's clearance: the detail says what differs), 422 not_signed (your wallet's signature is missing or does not verify), 403 house or staff (a buy from a wallet not on your account that a house or staff account holds: told only now, once your wallet's signature verified; nothing was signed or sent, and a sell is never refused so), 409 outcome_scratched (a buy of an entry being scratched: the market stopped listing it, rejected, withdrawn or replaced, since the trade was cleared, and its scratch has not landed on chain; nothing was signed or sent, and a sell still lands), 409 chain_refused (the program refused it, the detail naming its error: nothing changed), 409 guard_failed (one of your wallet's own guard instructions failed when the trade ran, so the transaction failed whole and nothing was traded, landed or not: prepare it again and sign the new transaction), 409 guard_unverified (one of your wallet's own guard instructions names the operator, which the server co-signs only where the Lighthouse program is frozen on the cluster, and it could not read that just now: nothing was signed or sent and the clearance is not used, so call submit_bet again with the same transaction and clearance after its Retry-After, a few seconds), 502 relay_failed (it was sent to the chain and its outcome is not known, so it may have landed: read get_positions first, and prepare and sign another trade only if it shows it did not land; never submit that clearance again). Only 409 clearance_expired (that clearance lapsed before anything was sent under it), 409 blockhash_invalid (your wallet signed on a blockhash the cluster does not hold valid, so it could never land) and 409 guard_unverified (the server could not confirm just now that your wallet's safety-check program, Lighthouse, is frozen, so it signed and sent nothing) mean the trade never left: after either of the first two, prepare it again and sign the new transaction; after guard_unverified, wait its Retry-After (a few seconds) and submit the same signed transaction with the same clearance again, unchanged. Three answers mean it may have landed: 409 clearance_used (that clearance was submitted once already, at any age: read your positions first), 502 relay_failed (it was sent to the chain and its outcome is not known: read your positions first) and a submit that got no answer at all (a timeout, a lost connection: read your positions first). After any of them, prepare and sign another trade only if your positions (get_positions, or GET .../market/me) show it did not land, and never submit that clearance again. Next: get_positions for every position and its P&L (the answer's position is this outcome's). Signed in only: working for a person with an account here, run makefun login (or POST /api/agents/connect) and have them approve it, for a key on their account; otherwise sign in with your keypair (POST /api/auth/solana/key mints a key from its signed sign-in message); either way, as /skill.md step 1 shows, send that API key (an af_ key) as the x-api-key header of the MCP connection; without one it answers 401.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"slug": "<slug>",
"transaction": "<transaction>",
"clearance": "<clearance>"
},
"name": "submit_bet"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| slug | Yes | The competition slug, e.g. chess-engine-01 (list_competitions lists them) | |
| clearance | Yes | The clearance string of prepare_bet's answer, unchanged: that one string, never the whole answer | |
| transaction | Yes | prepare_bet's transaction, base64, as your wallet signed it |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| trade | Yes | ||
| explorer | Yes | ||
| position | Yes | ||
| signature | Yes | ||
| commitment | Yes | ||
| first_trade | Yes |