Skip to main content

Trading app

The trading app is the main Opshuns UI: permissionless option pairs, short RFQ quote windows, and a CLOB fallback for single calls and puts.

PathWhat it is
/Landing quote box, payoff diagram, pair creator
/borrowBorrow: coming soon. Borrow against ITM opshuns is not live. Planned protocol rates: Borrow fees
/vaultsVaults: coming soon. Lender vaults for funding Borrow RFQs are not live.
/portfolioOne table of buy, sell, claim, order, and settled rows. Portfolio
/exploreInspect discovered CLOB triplets: outstanding book depth, fills, and posted activity by timeframe (SIWE required: Explore auth)
/loan-explorerLoan analytics: at-risk positions, recent openings, activity chart (SIWE required, not in nav. Explore auth)
/tradeAdvanced trade terminal (SIWE required in the UI; RFQ quote create on the API remains public)
/makersApply as a maker org; owners/managers issue member keys. Market makers
/testnetFaucet for OPMOCK tokens on local / test networks

Settings (gear) include the network picker. Networks come from GET /api/networks.

Query parameters​

/ and /trade accept the same URL flags as the framed embed (useful for deep links and demos):

ParamDefault on appEffect
referralAddressnoneCredited as referrer on fills from this page.
sidebuybuy or sell. Alias: buySell.
typecallcall or put. Aliases: optionType, callPut.
strategysingleInitial option structure. Alias: optionStrategy.
expirynext suggested weekYYYY-MM-DD, YYYY-MM-DDTHH:mm, or unix seconds. Aliases: expiration, expiryDate.
amountemptyPrefills size (underlying units). Aliases: quantity, size. When set, Quote stays disabled longer before it arms.
strikeemptyPrimary strike for the strategy (strikePrice alias); or named putStrike / callStrike / …; or strikes=a,b,c in strategy order.
underlyingall listedSymbols/addresses for the underlying picker. Alias: underlyingTokens.
quoteall listedPair quote picker. Aliases: quoteTokens, pairQuote.
premiumall payment / listedPremium picker. Alias: premiumTokens.
showPayoffDiagramtruefalse hides the side payoff diagram. (Frame default is false.)
tooltipstruefalse hides hover help on the quote flow.
langbrowser / EnglishUI language. Alias: locale.

Token filters: comma-separated symbols or 0x addresses; first value is the default. How-to: Restrict which tokens appear.

https://opshuns.com/?underlying=WETH&quote=USDC&premium=USDC
https://opshuns.com/trade?side=sell&type=put&strategy=single
https://opshuns.com/trade?expiry=2026-12-31&strike=3500&type=call
https://opshuns.com/trade?amount=2&strike=3500&type=call
https://opshuns.com/trade?strategy=strangle&referralAddress=0xYOURADDRESS
https://opshuns.com/?lang=de&showPayoffDiagram=false

Quote box​

Shared on every strategy: amount, underlying token, expiry (American vs European), and settings (network, premium token).

Strategy picker​

Opens a grid of named structures with a live payoff sketch. Strategies and strike fields are documented in Option spreads. Spreads expand into multiple RFQ intents in one quote.

Token picker​

  • Listed tokens for the selected chain (whitelist + landing/payment token metadata)
  • Favorites pinned per chain
  • Search by symbol, or paste a 0x address to use an unlisted ERC-20

Premium token is chosen separately in quote settings (GET /api/landing-page-settings default premium tokens, plus payment tokens). Gear Premium mode: Same as quote (default), Same as underlying, or Manual (toolbar pick). How ratios become a token amount: Premium ratio.

RFQ flow​

  1. Resolve the pair (CLOB) for (token0, token1, premiumToken) on the selected network: create it first if needed. CLOB
  2. POST /api/quote (no login). Standard quotes are package-only: makers sign a fixed package_premium. referrer on that body (default address(0); hosts pass ?referralAddress=) is hashed into taker_address_hash.
  3. Join rfq_stream:<stream_token> and rank offers. The UI does not auto-select a maker. You pick one to execute, or leave none selected.
  4. Approve mothership pulls for the package premium and/or underlying plus the live protocol fee (maker half-rate when the maker pays that leg) and referral. Then settle the package with the quote’s directions, taker_salt, and the same referrer. Fee table: Fees.

Gear Approval method: Auto (default) uses Permit2 when your wallet already approved the canonical Permit2 contract for every pull token; otherwise it asks for a direct mothership ERC-20 approval. Permit2 always uses signature pulls after a one-time Permit2 approval. Direct approval always approves the mothership.

That path is a maker-signed FixedPackage (executeFixedPackageIntent): one absolute package premium, then zero-premium fillMatched on each leg. Dutch and Authority use other entrypoints: On-chain fill modes. API payloads: Option spread quotes. Maker side: Fill options RFQ quotes. Bots / scripts: TypeScript SDK.

Manually set a premium (Dutch UI)​

After a quote is open, a Manually set a premium panel sits under the offers list (start / end premium; timeout in gear settings, default 300s).

  • No maker offers: the panel is shown open.

  • Maker offers present: the panel is collapsed; expand the header to set a premium range instead of picking a maker.

  • Pick a maker offer → approve / execute the package. Dutch start is disabled while a maker is selected.

  • Leave no maker selected → set the premium range and start Dutch. The wallet EIP-712-signs a DutchFillRequest (this reveals trade side via directions / makerAddressHash) and the app POSTs a new dutch_only quote. Makers then bid both sides; phases are competing → exclusive → open. See Dutch auction API.

Signing confirms a side-reveal warning before the typed-data prompt.

CLOB fallback (singles only)​

If the quote window closes with no maker offers, single calls and puts can be listed on the pair book at a premium you set (entered as a percent of size in the UI, encoded as a premium tick on-chain). See Premium ratio. That path is on-chain against the pair contract, not POST /api/quote. Multi-leg strategies cannot post to the book from the quote box.

Open / claim / withdraw book orders from Portfolio or the Open orders tab on /trade. Click a row for payoff, pair key, and on-chain details. Withdraw calls mothership claimBuy / claimSell to refund the unmatched deposit. Maker-post on that rest is not returned. Related API: Orders & exclusive fills.

Pair creator​

Any two ERC-20s plus a premium token can form a market. The landing card checks the factory for an existing pair and, if missing, submits one create transaction.

Discover factory / mothership addresses from GET /api/networks. All legs of a spread must use the same pair address and expiry.

Embed (Framed)​

Iframe the quote box from frame.opshuns.com (local: port 3005). Query params, referral fees, sizing, and host-page notes: Embed the quote box (Frame).

Testnet faucet​

/testnet mints API-prepopulated OPMOCK tokens (GET /api/payment-tokens plus registry weth / usdc / wbtc / meme keys). Mainnet is blocked. Cap is 10 whole tokens per call on the faucet ERC-20.

Locales​

With VITE_MULTILINGUAL enabled, the top bar shows a language switcher (en, es, fr, ja, zh, zh-TW).

Environment banners​

Testnet and staging builds can show a persistent banner above the nav:

VariableDefault in templates
VITE_TESTNET_BANNERtrue on testnet hosts
VITE_STAGING_BANNERtrue on staging hosts

When VITE_DEBUG is on, the debug panel can override each banner independently (stored in localStorage). Production leaves both off.