One oracle reference, a visible execution price.
OracleSwap is an oracle-referenced exchange interface for STK / USDC. The mid price is the starting point. Spread, inventory adjustment and fees determine the final quote.
Trading has two explicit modes. Demo uses simulated balances and local activity. Live reads configured contracts and asks your wallet to approve tokens and submit swaps. Missing deployments keep Live unavailable; live errors never fall back to demo prices. Pools, landing previews and analytics remain demonstrations.
Try a demo swap →Understand every part of the price.
- Mid: the oracle reference. The demo uses $142.68 per STK.
- Spread: in Live, the effective spread returned by AnchorVault, already including its inventory adjustment.
- Skew: an inventory adjustment. Excess STK tightens the buy spread and widens the sell spread.
- Fee: the amount returned by the live quote in its configured token denomination. Demo uses 2 basis points.
Sell price = mid × (1 − all-in adjustment)
The demo clamps the combined adjustment and checks the actual rounded output against a ±75 bps execution band. Slippage tolerance sets your minimum received; it does not expand that hard band. Buying never executes below mid and selling never executes above mid in the demo pricing model.
The demo applies a $10,000 limit; Live follows the contract clip limit. Zero outputs, insufficient funds and insufficient liquidity are rejected. Tiny orders can be rejected when token rounding would violate the band.
A visible response to market conditions.
| Regime | Base spread | Trading |
|---|---|---|
| OPEN | 10 bps | Available |
| EXTENDED | 20 bps | Available |
| CLOSED | 30 bps | Available, wider spread |
| HALTED | — | Paused |
CLOSED and HALTED are different states. A stale or invalid oracle must block trading. The demonstration provides controls below the trade history to switch regimes or halt the market. The table above describes the demo model. Live displays OPEN or CLOSED returned by OracleRouter; EXTENDED exists only in Demo. No live spread is hardcoded.
A balanced entry. An independent exit.
The demo vault accepts deposits with equal USDC value on each side. Demo shares use the seed price and do not accrue yield. Withdrawals redeem the entire demo position without checking the current oracle, regime or halt.
Production deposits and redemptions require contract previews, share accounting, allowances and receipt confirmation. The frontend does not prove smart contract safety or guarantee returns.
Configure your deployment.
Configure NEXT_PUBLIC_CHAIN_ID (11155111 for Sepolia or 31337 for local), NEXT_PUBLIC_RPC_URL, NEXT_PUBLIC_ORACLE_ADDRESS, NEXT_PUBLIC_VAULT_ADDRESS and NEXT_PUBLIC_ROUTER_ADDRESS. Import the final vault and router ABIs with the project importer. Addresses remain empty until a deployment is supplied.
The wallet and RPC must match the configured network. A WalletConnect project ID enables the RainbowKit wallet picker; without it, the connect action supports an injected browser wallet.
Live checks contract bytecode, vault token identities and its oracle address. It reads OracleRouter and AnchorVault at the same block, approves the vault for the required amount, waits for approval, requotes, simulates the router call, requests the swap signature and waits for a successful receipt. Minimum output and deadline are preserved from your reviewed order. Token balances refresh afterwards.
If receipt lookup times out, use Check transaction status. The submitted hash survives reload; another swap is blocked while it is unresolved. Live history currently includes swaps confirmed from this interface in this session, not an indexed lifetime history. Permit2 remains disabled; the live path uses ERC-20 approvals.
