Skip to content

BNB To FISH Swap

Use this flow when the agent wallet has BNB but does not yet have the FISH token needed for Openfish trading.

Do not treat BNB as a normal Bridge deposit asset. Sending native BNB to a Bridge deposit address does not directly credit Openfish FISH balance. BNB can become Openfish FISH only through the explicit swap quote and execute flow.

  1. Create or reuse the wallet’s Bridge deposit address.
  2. Request a BNB -> FISH quote.
  3. Review the expected FISH amount, minimum output, slippage, price impact, required BNB, gas buffer, and quote expiry.
  4. If the quote says hasEnoughBnb: false, fund the returned depositAddress with the required BNB and request a fresh quote.
  5. Execute the quote only after explicit user confirmation.
  6. Poll swap status until it reaches CREDITED.
  7. Check the Openfish CLOB FISH balance before trading.

Check the supported FISH token first:

Terminal window
openfish bridge supported-assets

Quote the swap:

Terminal window
openfish bridge swap quote 0xYourOpenfishWallet \
--amount-in-wei 1000000000000000 \
--to-token-address 0xaE71fd8baCc2f17C43a01C3F4aFF6dEEbc194444 \
--slippage-bps 300

Review the quote fields before executing:

FieldMeaning
quoteIdQuote identifier used by execute.
depositAddressBSC address whose BNB balance will be used for the swap.
estimatedAmountOutBaseUnitEstimated FISH output in base units.
minAmountOutBaseUnitMinimum acceptable FISH output after slippage.
slippageBpsSlippage tolerance in basis points.
priceImpactBpsEstimated route price impact in basis points, when available.
depositBnbBalanceWeiBNB currently available at the deposit address.
requiredBnbWeiBNB needed for amount plus gas buffers.
hasEnoughBnbWhether execution can proceed with current BNB balance.
expiresAtQuote expiry time.

If the user confirms the quote and hasEnoughBnb is true, execute:

Terminal window
openfish bridge swap execute 0xYourOpenfishWallet --quote-id <QUOTE_ID>

Poll status:

Terminal window
openfish bridge swap status <SWAP_ID>
openfish bridge swap list 0xYourOpenfishWallet
openfish clob balance --asset-type collateral

Quote:

Terminal window
curl -X POST "https://bridge.openfish.me/bridge/swap/quote" \
-H "Content-Type: application/json" \
-d '{
"address":"0xYourOpenfishWallet",
"fromToken":"BNB",
"toTokenAddress":"0xaE71fd8baCc2f17C43a01C3F4aFF6dEEbc194444",
"amountInWei":"1000000000000000",
"slippageBps":300
}'

Execute:

Terminal window
curl -X POST "https://bridge.openfish.me/bridge/swap/execute" \
-H "Content-Type: application/json" \
-d '{
"address":"0xYourOpenfishWallet",
"quoteId":"<QUOTE_ID>"
}'

Status:

Terminal window
curl "https://bridge.openfish.me/bridge/swap/<SWAP_ID>"
curl "https://bridge.openfish.me/bridge/swaps?address=0xYourOpenfishWallet&limit=20"
StatusMeaning
SUBMITTEDExecute request accepted.
SWAP_CONFIRMEDBNB -> FISH swap transaction was confirmed.
SWEEP_SUBMITTEDFISH sweep from the deposit address was submitted.
SWEPTFISH sweep was confirmed.
CREDITEDOpenfish CLOB FISH balance was credited.
FAILEDSwap failed; check the error field.
EXPIREDQuote or swap request expired.
MANUAL_REVIEWManual review is required before the funds can be credited.
  • Quote before execute.
  • Do not execute an expired quote.
  • Do not execute if hasEnoughBnb is false.
  • Do not auto-swap from a generated agent; require explicit user confirmation.
  • Do not send BNB as a normal deposit expecting direct FISH credit.
  • Verify openfish clob balance --asset-type collateral before live trading.