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.
1. Install The CLI
Section titled “1. Install The CLI”curl -fsSL https://raw.githubusercontent.com/billcheung10/openfish-cli/main/install.sh | shOr upgrade an existing install:
openfish upgradeSet production hosts explicitly when scripting:
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"2. Create Wallet And API Credentials
Section titled “2. Create Wallet And API Credentials”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.
openfish wallet createopenfish clob create-api-key --agent-env-file .openfish/agent.envThe generated env file is intended for script agents. Keep it out of source control.
3. Deposit FISH
Section titled “3. Deposit FISH”Get a BSC deposit address:
openfish bridge deposit 0xYourOpenfishWalletEquivalent REST call:
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:
openfish bridge supported-assetsIf 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.
4. Check Account State
Section titled “4. Check Account State”openfish clob account-statusopenfish clob balance --asset-type collateralIn 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.
5. Pick A Market
Section titled “5. Pick A Market”Use public browse endpoints or CLI market commands:
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.
6. Trade
Section titled “6. Trade”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:
| Task | Endpoint |
|---|---|
| Submit one order | POST /order |
| Submit batch orders | POST /orders |
| List own orders | GET /data/orders |
| Get one order | GET /data/order/{order_id} |
| List trades | GET /data/trades |
| Cancel one order | DELETE /order |
| Cancel batch orders | DELETE /orders |
| Cancel all orders | DELETE /cancel-all |
7. Review Results
Section titled “7. Review Results”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.
8. Withdraw
Section titled “8. Withdraw”Preview first:
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:
curl -X POST "https://bridge.openfish.me/withdraw" \ -H "Content-Type: application/json" \ -d '{ "address":"0xYourOpenfishWallet", "toChainId":"56", "toTokenAddress":"0xdcc3990630eB5Ffd8914d639198cCa593e59465A", "recipientAddr":"0xYourBscRecipient", "amount":"all" }'