Documentation Index
Fetch the complete documentation index at: https://docs.b1nary.app/llms.txt
Use this file to discover all available pages before exploring further.
Choosing an execution path
Every quote has a targetchain.
- Use direct Base trade when the quote is on Base and the Base smart trading account has enough collateral.
- Use direct Solana trade when the quote is on Solana and the Solana embedded trading account has enough collateral.
- Use bridge-and-trade when USDC exists across the user’s b1nary account but is on the wrong chain for the selected cash-secured put.
Direct Base example
This is a complete working example of selling a cash-secured put on b1nary using Python.Direct Base step-by-step
1. Get test tokens
Testnet only, one-time. The faucet sends 0.005 ETH (gas), 50 LETH, and 100,000 LUSD.2. Approve collateral
One-time per token. For puts, approve USDC (or LUSD on testnet) to the MarginPool. For calls, approve WETH or cbBTC.3. Read prices
GET /prices returns all available options with signed quotes. Each entry has the strike, expiry, premium, delta, and the complete EIP-712 data needed for on-chain execution.
Filter by option_type (PUT or CALL) and ensure otoken_address and signature are present.
4. Calculate collateral
For puts:(amount * strike_8dec) / 1e10 gives USDC amount in 6 decimals.
For ETH calls: amount * 1e10 gives WETH amount in 18 decimals.
For BTC calls: amount directly (cbBTC has 8 decimals, same as oToken).
5. Execute on-chain
CallexecuteOrder(quote, signature, amount, collateral) on BatchSettler. Premium arrives in your wallet in the same transaction.
6. Monitor
GET /positions/{address} shows all open and settled positions with the outcome field.
Direct Solana trade
For Solana quotes (chain = "solana"), build a Solana ExecuteOrder transaction using the quote fields from GET /prices.
Important rules:
- The user’s Solana embedded trading wallet is the trading authority.
- Backend/operator sponsorship should pay transaction fees and setup costs where supported.
- USDC and wSOL use the SPL Token Program.
- TSLAx uses Token-2022:
TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb. - SOL covered calls must wrap SOL to wSOL before execution if wSOL collateral is insufficient.
- Use the actual token balance on Solana. Do not assume a bridge
burn_amountequals final available collateral.
Bridge-and-trade
Bridge-and-trade consolidates USDC with Circle CCTP V2, then executes on the destination chain.Base -> Solana
Use this when the user wants a Solana cash-secured put but USDC is on Base.Resolve the Solana USDC token account
Derive the user’s Solana USDC ATA. This ATA is the CCTP
mint_recipient. Do not use the Solana wallet owner as mint_recipient.Reserve the bridge job
Call
POST /api/bridge-and-trade/reserve before burning on Base. Backend validates or creates the Solana USDC ATA with the operator hot wallet as payer.Burn USDC on Base
Send the Base smart-wallet batch: USDC
approve(TokenMessengerV2) and CCTP V2 depositForBurn.Finalize the bridge job
Call
POST /api/bridge-and-trade with the real burn_tx_hash, source_chain="base", dest_chain="solana", quote_id, mint_recipient, and burn_amount.Solana -> Base
Use this when the user wants a Base cash-secured put but USDC is on Solana.Prepare sponsored burn
Call
POST /api/bridge/solana-cctp-burn/prepare. Backend creates a Solana CCTP burn transaction with the operator as fee payer.Sign as owner
The user’s Solana trading wallet signs the prepared transaction as USDC owner. The user does not pay Solana gas.
Submit burn
Call
POST /api/bridge/solana-cctp-burn/submit with the signed transaction, dest_chain="base", mint_recipient as the Base smart trading account, and the selected quote_id.quote_id=null and signed_trade_tx=null where the endpoint supports it.
The Wheel (automated loop)
The optimal automated strategy is a continuous cycle:- Start with USDC. Sell a cash-secured put at a strike you’d buy at.
- If OTM: collateral returned. Collect premium, sell another put.
- If ITM: you receive the asset. Sell a covered call.
- If call OTM: keep asset and premium. Sell another call.
- If call ITM: asset sold at strike. Back to USDC. Repeat from step 1.
GET /positions/{address} or GET /b1nary-account/positions?privy_user_id=... to check settlement outcomes and decide the next move.