Execute Swap
Endpoint
Section titled “Endpoint”POST /bridge/swap/execute
Server: https://bridge.openfish.me
Auth: None
Tags: Bridge
Call this endpoint only after the user has reviewed and approved the quote. The Bridge swaps BNB held at the wallet’s deposit address into FISH, sweeps FISH, and credits the Openfish CLOB FISH ledger balance.
Request Body
Section titled “Request Body”| Property | Type | Required | Description |
|---|---|---|---|
address | string | Yes | Openfish wallet address that owns the quote. |
quoteId | string | Yes | Quote ID returned by POST /bridge/swap/quote. |
{ "address": "0x56687bf447db6ffa42ffe2204a05edaa20f55839", "quoteId": "2e7cde57-466e-4e17-a7e5-3a0c2a09a142"}Response
Section titled “Response”200 — Swap completed and credited, or execution reached a trackable status.
{ "swapId": "de8c8c12-8af7-4f4e-a41e-f97a6c3c9d19", "quoteId": "2e7cde57-466e-4e17-a7e5-3a0c2a09a142", "address": "0x56687bf447db6ffa42ffe2204a05edaa20f55839", "depositAddress": "0x23566f8b2E82aDfCf01846E54899d110e97AC053", "status": "CREDITED", "swapTxHash": "0xabc123...", "sweepTxHash": "0xdef456...", "amountInWei": "1000000000000000", "minAmountOutBaseUnit": "2376500000000000000000", "fishReceivedBaseUnit": "2450000000000000000000", "fishCreditedBaseUnit": "2450000000000000000000"}curl -X POST "https://bridge.openfish.me/bridge/swap/execute" \ -H "Content-Type: application/json" \ -d '{ "address":"0x56687bf447db6ffa42ffe2204a05edaa20f55839", "quoteId":"2e7cde57-466e-4e17-a7e5-3a0c2a09a142" }'Error Cases
Section titled “Error Cases”| Status | Example reason |
|---|---|
400 | Quote expired, quote address mismatch, unsupported token, insufficient BNB for amount plus gas buffers. |
404 | Quote not found. |
409 | Quote already executed, or another swap is running for the same deposit address. |
410 | BNB -> FISH swap is disabled. |
Client Handling
Section titled “Client Handling”- Never execute a quote that the user has not reviewed.
- Do not execute if
hasEnoughBnbwas false. - Do not retry by blindly executing the same quote; request status first.
- After execute, call
GET /bridge/swap/{swap_id}untilstatusisCREDITED,FAILED, orMANUAL_REVIEW. - Verify the CLOB FISH balance before enabling live trading.