Skip to main content

Choosing an execution path

Every quote has a target chain.
  • 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.
Covered calls require asset collateral on the target chain. Bridge-and-trade is for USDC collateral only.

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

Call executeOrder(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_amount equals final available collateral.
Pseudo-flow:

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.
1

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.
2

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.
3

Burn USDC on Base

Send the Base smart-wallet batch: USDC approve(TokenMessengerV2) and CCTP V2 depositForBurn.
4

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.
5

Wait and execute

Poll GET /api/bridge-status/{job_id} until mint_completed, then execute the Solana trade using the actual USDC amount received after fees/rounding.

Solana -> Base

Use this when the user wants a Base cash-secured put but USDC is on Solana.
1

Prepare sponsored burn

Call POST /api/bridge/solana-cctp-burn/prepare. Backend creates a Solana CCTP burn transaction with the operator as fee payer.
2

Sign as owner

The user’s Solana trading wallet signs the prepared transaction as USDC owner. The user does not pay Solana gas.
3

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.
4

Wait and execute

Poll GET /api/bridge-status/{job_id} until USDC is minted on Base, then execute the Base trade through the Base smart trading account.
Bridge-only withdrawals use the same consolidation principle: bridge first, then withdraw from the destination trading account. For bridge-only jobs, use 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:
  1. Start with USDC. Sell a cash-secured put at a strike you’d buy at.
  2. If OTM: collateral returned. Collect premium, sell another put.
  3. If ITM: you receive the asset. Sell a covered call.
  4. If call OTM: keep asset and premium. Sell another call.
  5. If call ITM: asset sold at strike. Back to USDC. Repeat from step 1.
Use GET /positions/{address} or GET /b1nary-account/positions?privy_user_id=... to check settlement outcomes and decide the next move.

Dependencies