Skip to content

Trading Quickstart

Openfish trading uses the CLOB ledger. Depositing FISH on BSC credits the Openfish account balance; orders then reserve and settle against that ledger balance.


Terminal window
curl -fsSL https://raw.githubusercontent.com/billcheung10/openfish-cli/main/install.sh | sh

Or upgrade an existing install:

Terminal window
openfish upgrade

Set production hosts explicitly when scripting:

Terminal window
export OPENFISH_CLOB_HOST="https://api.openfish.me"
export OPENFISH_GAMMA_HOST="https://gamma.openfish.me"
export OPENFISH_DATA_HOST="https://data.openfish.me"
export OPENFISH_BRIDGE_HOST="https://bridge.openfish.me"

Creating a wallet is not the same as registering an Openfish account. The account becomes usable when API credentials are created or derived for that wallet address.

Terminal window
openfish wallet create
openfish clob create-api-key --agent-env-file .openfish/agent.env

The generated env file is intended for script agents. Keep it out of source control.


Get a BSC deposit address:

Terminal window
openfish bridge deposit 0xYourOpenfishWallet

Equivalent REST call:

Terminal window
curl -X POST "https://bridge.openfish.me/deposit" \
-H "Content-Type: application/json" \
-d '{"address":"0xYourOpenfishWallet"}'

Send only the supported FISH token on BSC to the returned address. Check the current token address first:

Terminal window
openfish bridge supported-assets

If the wallet has BNB but no FISH, do not send BNB as a normal deposit expecting direct credit. Use the explicit BNB -> FISH swap flow: quote first, review the output/slippage/gas buffer, execute only after user confirmation, then check the CLOB FISH balance.


Terminal window
openfish clob account-status
openfish clob balance --asset-type collateral

In CLI v0.1.11 and later, collateral balance is displayed in human FISH units. It is not a USDC balance and should not be interpreted as raw base units.


Use public browse endpoints or CLI market commands:

Terminal window
curl "https://api.openfish.me/browse/markets?status=LIVE&limit=20"
curl "https://api.openfish.me/agent/markets/recommended?limit=20"

Recommended selection rules for generated agents:

  • Prefer markets with active order books and recent volume.
  • Prefer liquid Polymarket-synced markets, real-time crypto markets, and real-time stock markets.
  • Avoid placing live orders in unknown or illiquid markets until dry-run checks pass.

The safe default is dry-run first. A live agent should only submit POST /order after the user explicitly approves the first live order.

Common endpoints:

TaskEndpoint
Submit one orderPOST /order
Submit batch ordersPOST /orders
List own ordersGET /data/orders
Get one orderGET /data/order/{order_id}
List tradesGET /data/trades
Cancel one orderDELETE /order
Cancel batch ordersDELETE /orders
Cancel all ordersDELETE /cancel-all

After a run, review:

  • Orders submitted, filled, cancelled, or rejected.
  • Realized and mark-to-market PnL.
  • Maker revenue and creator revenue if applicable.
  • Open positions and open orders.
  • Any failed-order limit, slippage, liquidity, or balance errors.

Do not automatically increase risk limits after one successful run.


Preview first:

Terminal window
curl -X POST "https://bridge.openfish.me/withdraw/preview" \
-H "Content-Type: application/json" \
-d '{
"address":"0xYourOpenfishWallet",
"toChainId":"56",
"toTokenAddress":"0xdcc3990630eB5Ffd8914d639198cCa593e59465A",
"recipientAddr":"0xYourBscRecipient",
"amount":"all"
}'

Submit only after explicit confirmation:

Terminal window
curl -X POST "https://bridge.openfish.me/withdraw" \
-H "Content-Type: application/json" \
-d '{
"address":"0xYourOpenfishWallet",
"toChainId":"56",
"toTokenAddress":"0xdcc3990630eB5Ffd8914d639198cCa593e59465A",
"recipientAddr":"0xYourBscRecipient",
"amount":"all"
}'