Create Swap Quote
Endpoint
Section titled “Endpoint”POST /bridge/swap/quote
Server: https://bridge.openfish.me
Auth: None
Tags: Bridge
Use this endpoint when a wallet has native BNB but no FISH. The quote creates or reuses the wallet’s Bridge deposit address and estimates how much FISH can be received.
The quote does not execute a transaction. It returns whether the deposit address currently has enough BNB for the swap amount plus gas buffers.
Request Body
Section titled “Request Body”| Property | Type | Required | Description |
|---|---|---|---|
address | string | Yes | Openfish wallet address. |
fromToken | string | Yes | Must be BNB. |
toTokenAddress | string | Yes | Current supported FISH token address from GET /supported-assets. |
amountInWei | string | Yes | Native BNB amount to swap, in wei. |
slippageBps | number | No | Slippage tolerance in basis points. Defaults to Bridge configuration when omitted. |
{ "address": "0x56687bf447db6ffa42ffe2204a05edaa20f55839", "fromToken": "BNB", "toTokenAddress": "0xaE71fd8baCc2f17C43a01C3F4aFF6dEEbc194444", "amountInWei": "1000000000000000", "slippageBps": 300}Response
Section titled “Response”200 — Quote returned.
{ "quoteId": "2e7cde57-466e-4e17-a7e5-3a0c2a09a142", "address": "0x56687bf447db6ffa42ffe2204a05edaa20f55839", "depositAddress": "0x23566f8b2E82aDfCf01846E54899d110e97AC053", "chainId": "56", "fromToken": "BNB", "toTokenAddress": "0xaE71fd8baCc2f17C43a01C3F4aFF6dEEbc194444", "amountInWei": "1000000000000000", "estimatedAmountOutBaseUnit": "2450000000000000000000", "minAmountOutBaseUnit": "2376500000000000000000", "slippageBps": 300, "priceImpactBps": 42, "route": [ "0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c", "0xae71fd8bacc2f17c43a01c3f4aff6deebc194444" ], "depositBnbBalanceWei": "2000000000000000", "requiredBnbWei": "1200000000000000", "hasEnoughBnb": true, "expiresAt": "2026-05-07T03:30:00Z"}curl -X POST "https://bridge.openfish.me/bridge/swap/quote" \ -H "Content-Type: application/json" \ -d '{ "address":"0x56687bf447db6ffa42ffe2204a05edaa20f55839", "fromToken":"BNB", "toTokenAddress":"0xaE71fd8baCc2f17C43a01C3F4aFF6dEEbc194444", "amountInWei":"1000000000000000", "slippageBps":300 }'Client Handling
Section titled “Client Handling”- Show
estimatedAmountOutBaseUnit,minAmountOutBaseUnit,slippageBps,priceImpactBps,requiredBnbWei,hasEnoughBnb, andexpiresAtto the user. - If
hasEnoughBnbis false, ask the user to fund the returneddepositAddresswith enough BNB for the swap and gas buffer, then request a fresh quote. - Do not execute without explicit user confirmation.
- Do not use
POST /quote; that legacy quote endpoint is disabled for the FISH bridge.