Documentation

Trading and routing

Every trade goes through the LaunchRouter. You pay in ETH, USDC, or the pair coin you already hold, and the router crosses whatever pools sit between your asset and the market and settles in one transaction. It holds nothing between calls: any leftover ETH, USDC, pair coin or market token is flushed back to you before the call ends.

How a buy travels

  1. ETH → USDC. The router wraps ETH and swaps it in the Uniswap V3 WETH/USDC 0.05% pool on Base.
  2. USDC → pair coin. For a synthetic pair, the router buys from that coin's peg pool ask, one tick spacing above the feed. For DIEM, it swaps through the AerodromeAdapter.
  3. Pair coin → token. The router swaps the coin for the market token in the v4 pool inside its own unlockCallback, and sends the tokens to you.

A sale takes the same path in reverse. Starting from USDC skips the first hop; starting from the pair coin skips the first two.

Function Path
buyWithEth ETH → USDC → coin → token
buyWithUsd USDC → coin → token
buyWithCoin coin → token
sellForEth token → coin → USDC → ETH
sellForUsd token → coin → USDC
sellForCoin token → coin
sellForDiem token → coin → DIEM
launchWithEth, launchWithUsd launch plus the first buy, same routes
swapUsdForCoin, swapCoinForUsd, swapCoinForEth coin legs on their own, used by the units page and by the Treasury's sweeps
swapCoinForAsset coin → USDC or DIEM, used by the Distributor for converted claims

The coin leg, by pair kind

This is the hop that differs, and it is worth knowing which way your trade went.

Synthetic pairs. A buy takes coin from the peg pool's ask. A sell asks the vault first: when quoteRedeem returns a non-zero amount — fresh feeds, caps open, inventory present — the router calls redeemFor with the caps keyed to your wallet, and you are paid at the index with your coin burned. Otherwise it settles on the peg pool's bid, one tick spacing below the feed. Selling at the index is the better of the two, and it is the default path.

DIEM pairs. Both directions go through the AerodromeAdapter on its owner-set route: USDC → WETH → VVV → DIEM and back, three Aerodrome v2 pools sent to the Aerodrome Router as one call (the USDC/VVV v2 pool is nearly empty; VVV's depth is against WETH). No peg pool is involved, because DIEM has its own market.

Selling into DIEM. sellForDiem sells the market token for its pair coin and then turns that into DIEM. For a synthetic pair it uses the vault's DIEM inventory when the inventory can pay; otherwise it goes coin → USDC → Aerodrome → DIEM. On a DIEM-paired market, the coin already is DIEM and the last hop is a transfer. Every market whose pair coin is redeemable shows a "Sell for DIEM" action on its page.

Quotes

The site calls quoteBuy and quoteSell before every trade, and quoteCoinForAsset before a conversion. A quote walks the exact route the trade will take and returns the exact amount out. Quotes are not view functions: the V3 and v4 legs are simulated by executing a swap and reverting with the result, then catching it, so a quote runs as a transaction simulation. The vault leg is quoted with quoteRedeem and an Aerodrome leg with the router's getAmountsOut, so a quote always equals the execution in the same block.

The site subtracts 1% from the quote and passes the result as the minimum out. The floor is enforced on-chain: you receive at least that much, or the trade does not happen and you keep what you had. The 1% is a floor rather than a fee; in a quiet market you receive the quoted amount.

Approvals

Asset Approval
ETH none
USDC once per router
Pair coin once per router, per coin
Market token once per router, per token, to sell

What decides which route you get

Every route above has a second one behind it, and the router picks between them on-chain, inside your transaction.

  • The pair coin's feed. Inside its window a synthetic sell settles at the index; outside it, at the peg bid. For an inference coin the window is six hours from the last publish, and anyone can publish.
  • The DIEM feed. DIEM legs read the Aerodrome TWAP chain and Chainlink ETH/USD. While those are current, DIEM payouts settle straight from inventory. USDC keeps working either way.
  • The redemption caps. 20% of the coin's seed amount per day across all wallets, 5% per wallet, per rolling UTC day. Within them a sell settles at the index; past them quoteRedeem returns 0 and the sell takes the peg bid, one tick spacing below the feed. The same routing applies to a claim converted to USDC or DIEM.
  • The vault's DIEM inventory. sellForDiem settles from inventory when it is there and buys DIEM on Aerodrome when it is not, so the DIEM arrives either way.
  • The payout asset. If USDC is paused by its issuer at the moment you claim, the Distributor holds the amount for you in heldOf and claimHeld releases it. Trading the market token is unaffected. See Holder rewards.