How it works
An oracle-priced inventory market: the contract holds USDC and wNVDA, and trades with you at the oracle price plus or minus a spread.
The trade flow
- You hold USDC on Arc. USDC is also Arc gas, so there is nothing else to fund.
- The terminal reads a quote from the InventoryMarket contract: price, spread, session and the amount you would get.
- Buy: you approve USDC, then call
buy(usdcIn, minWnvdaOut). You pay USDC and receive wNVDA at the ask. - Sell: you approve wNVDA, then call
sell(wnvdaIn, minUsdcOut). You pay wNVDA and receive USDC at the bid. - Both are a single transaction on Arc. The terminal sets 1% slippage protection through the min-out argument.
Why an inventory market
arcusa does not mint stock exposure. All wNVDA comes from locking a provider token on its home chain, which is too slow to do per trade (about 16 minutes into Arc, see Bridge). So inventory is moved to Arc ahead of time and the contract trades against it. The design record is ADR 0014 in the repo.
The trade-off: the market is the counterparty to every trade. Whoever owns the inventory carries the price risk, and the market can run out of one side. A sold-out state is a normal outcome, not a failure.
Pricing
ask (you buy) = oracle price x (1 + spread)
bid (you sell) = oracle price x (1 - spread)The oracle price is USD per whole token with 8 decimals. USDC has 6 decimals and wNVDA has 18; the contract handles the conversion and rounds in the pool's favour. See Oracle and price for where the price comes from.
Spread, sessions and caps
The spread and the maximum trade size depend on the market session reported by the oracle. These are the defaults set in the InventoryMarket constructor (contracts/arc/src/InventoryMarket.sol).
| Session | Spread | Trade cap (share of max trade) | Trading |
|---|---|---|---|
| Regular | 30 bps (0.30%) | 100% | Open |
| Pre-market, post-market, overnight | 90 bps (0.90%) | 25% | Open if the oracle reports that session |
| Closed | 200 bps (2.00%) | 10% | Only when offHoursTrading is on (demo mode) |
The default max trade is 100 USDC, the default max net exposure is 1,000 USDC, and a spread can never be set above 20%. The owner can change these and can pause the market. The values currently set on the deployed contract were not re-read for these docs, except that the sample trade confirmed the 2% closed-session spread.
Guards on every trade
- The oracle price must be fresh, unless the oracle is in demo mode.
- A trade larger than the session cap reverts.
- A trade that would push net USDC flow past the exposure limit reverts.
- A buy cannot take the pool below its minimum wNVDA inventory; a sell cannot take it below its minimum USDC reserve.
- A result below your min-out argument reverts.
- Reentrancy guard, and an owner-only pause.
Settlement
Settlement is atomic and on Arc: the contract pulls your tokens with transferFrom and sends you the other side in the same transaction, in USDC. There is no clearing step and no off-chain matching. A blocklisted USDC address cannot move USDC on Arc, so its trade reverts cleanly.
Selling returns USDC. If you want the underlying provider token back on its home chain, you bridge wNVDA back, which takes about 28 seconds from Arc in the one test we ran.