TradePlacing a swap
Trade

Placing a swap

Choose Quick or OPmode, enter what you will pay, request a quote, review it and approve in your wallet. The selected mode determines which amounts are estimates and which are fixed.

Quick

Quick routes swaps for listed xStocks and Backpack Securities tokens when a route is available. A Quick buy pays USDC or SOL, and a Quick sell pays out in either; the switch beside the amount chooses. A buy paid in SOL leaves 0.01 SOL in your wallet for network fees and token account rent. Its review shows the estimated output, the minimum received, the slippage tolerance (fixed at 0.50%), the route's trading fee and opcode's platform fee, which is 0%. It also gives the price per share and how far that sits from the share's own price; for a buy of a share that both xStocks and Backpack Securities list, the same amount is priced on the other issuer's token too, with a link to trade it. The estimated output can change within that limit; the minimum received is the number to check. Follow the saved transaction status afterward, and resolve an unknown result before starting another order. Your first swap walks through this flow.

Where OPmode is offered

OPmode runs on the ten markets where opcode has funded its own pool: NVDAx, SPYx, QQQx, GLDx, TSLAx, AAPLx, MSFTx, METAx, COINx and CRCLx. Markets can be filtered to them with OPmode pools, and on their pages the ticket picks OPmode for an order paid in USDC within its limit while the pool can quote. OPmode quotes only while a US market session is open, pre-market, regular, post-market or overnight, as confirmed by both the market calendar and the Pyth report; not at weekends or on exchange holidays. See Sessions and market hours. If the market is closed, a pool is paused or its on-chain reference is refreshing, the ticket says so and Quick remains available when a route exists. These ten original OPmode markets are currently paused. Additional xStocks or Backpack markets require explicit pool setup, funding and verified price support before OPmode can quote. Check the terminal for current pool availability.

MarketLargest single orderFixed 60-second window limit
NVDAx / USDC100 USDC500 USDC
SPYx, QQQx, GLDx, TSLAx, AAPLx, MSFTx, METAx, COINx and CRCLx / USDC20 USDC100 USDC

Both limits are in USDC. The order limit applies to each order; the window limit is shared by all traders on that market. The settlement program enforces both on chain. Market accounts and pool addresses are on Verify it yourself.

Exact in, exact out

You always specify what you pay. On a buy that is an amount of USDC; on a sell it is a quantity of the stock token. OPmode answers with the exact amount you will receive. Both numbers are signed by opcode's quote key before you see them, and the program on chain will move those two numbers or nothing.

Step by step

  1. Choose the side and the amount

    Buy pays USDC, to six decimal places. Sell pays the stock token, in raw tokens: eight decimal places for xStocks, six for Backpack Securities. The ticket uses the selected mint's decimals. The fee is included in the amount you enter.

  2. Ask for a quote

    Get firm quote. opcode prices your exact amount against the pool as it is at that moment, from the Pyth reference verified and published on chain, whose source must be at most five seconds old. It checks the result against the market's on-chain limits, sets aside the output it would owe you, and signs. A market's on-chain reference keeps refreshing while someone has it open in the terminal or requests quotes, and stops after a minute without either. On a market that was idle, the ticket picks Quick and moves to OPmode once a fresh reference is written, usually within seconds; until then the OPmode row says why it cannot quote.

    If the OPmode row reads Paused or Closed instead, or the request comes back with a reason, nothing can be requested until that clears. When something goes wrong lists the reasons.

  3. Review

    The review panel is the contract. Read it top to bottom:

    RowMeaning
    You receive, exactly · forThe two amounts that will move.
    Price, fee includedUSDC per raw token, fee included, and its distance from the reference in basis points.
    fee … incl.Five basis points of what you pay, already inside the amount. Nothing is added on top.
    SlippageNone. Exact amounts or no fill.
    ExpiryWhen the signed quote stops being executable.

    The seconds left in the quote's life, up to 10, sit on the sign button with a bar running down beneath them; a quote is only returned if at least five seconds are left for your review. When they run out, the quote is dead and New quote takes its place. Network fees and receipt rent are paid separately in SOL.

  4. Sign and trade

    Sign and trade hands the transaction to your wallet. Check that the two amounts match the panel, then approve. The ticket follows the transaction to Confirmed, usually within a second or two, then Final. Edit before you sign drops the quote; its reservation lapses when it expires.

The stages

  1. Order
  2. Priced
  3. Signed
  4. Confirmed
  5. Final
Every OPmode order passes through the same stages. The ticket names the one the order has reached: the sign button while it is signed and waiting, then Confirmed and Finalized.
StageWhat has happened
OrderYou named a market, a side and an exact input.
PricedThe engine computed base, size, confidence cost, session and skew for that input from the pool's current state.
Signedopcode's quote key signed the exact amounts, your wallet, and the expiry. opcode set aside, from the pool's available inventory, what it would owe you.
ConfirmedYour transaction confirmed. Both legs and the fee moved together, and a receipt exists on chain.
FinalThe transaction is finalized on chain and can no longer be rolled back.

Selling

A sell is the mirror image. You enter raw tokens, you receive USDC, and the fee is five basis points of the tokens you pay. The price is the pool's bid, one half-spread below the pool's center price. If the pool is short of stock, the skew raises that center and works in your favour on a sell: it bids higher to get stock back.

On Robinhood Chain

A Robinhood token's ticket pays or receives USDG and routes through KyberSwap, which reads every exchange on Robinhood Chain. Connect an Ethereum wallet under Robinhood Chain in the wallet dialog; it needs a little ETH on Robinhood Chain for network fees. The estimate under You get is read again every 15 seconds, with its price per share against the share.

  1. Approve, once per amount

    When your wallet has not already allowed KyberSwap's router to spend what you are paying, the ticket first asks you to approve exactly that amount, to that router only.

  2. Sign the swap

    The swap is built for your address at the moment you press the button. It receives at least 99.5% of the estimate, or reverts and moves nothing.

  3. Confirmed

    The ticket follows the transaction until Robinhood Chain confirms it, then shows what you received, with a link to the explorer.

Other limits

LimitValue
OPmode quote lifetimeup to 10 seconds; the program allows at most 30
Quote requests12 per minute for each wallet, on each route
Unresolved ordersan OPmode order or pool transaction whose result is not yet known must be resolved before another OPmode quote or pool transaction from the same wallet
Smallest orderanything that yields at least one atom out after the fee
Pool inventory rangea trade may not push the pool's stock share of value outside 25–75%; trades that move it back are allowed

Larger trades can be split within the fixed-window limit. Each piece is priced on the pool as your earlier pieces left it, so the skew moves against you as you go. Adjacent windows can permit a larger burst than a rolling-minute limit would.

Go deeperFollow one trade through the system

The board below is the one from the litepaper. Step through it to see which parts act, in what order, and where the fill feeds back into the next quote.

1 / tick

Pyth signs the underlying share's price. The program verifies it on chain, checks the market session it was signed in, and writes it as the OPmode market's reference.