Trade against the curve.
Review executable on-chain quotes, USDG-side fees, and limits before authorizing a swap.
Two trading directions
| Action | Input | Output | Pool inventory |
|---|---|---|---|
| Sell stock | Exact raw stock-token amount | USDG after fees | Stock rises; USDG falls. |
| Buy stock | Maximum exact-input USDG budget | Quoted raw stock-token amount | Stock falls; USDG rises. |
A quote is a view of the pool at a particular state and time. It is not a reservation. The interface requires a fresh review after 60 seconds. The contract separately reevaluates the operation during execution, including its deadline, calibration, status, domain, price guard, and output bound. Its transaction deadline is three minutes after the latest chain block timestamp.
Read the quote
- Amount in and estimated amount out, using each token's actual decimals.
- Minimum output after your slippage setting, enforced by the contract.
- The gross fee-free USDG leg, total USDG fee, LP portion, and protocol portion.
- Whether the pool is open, the reference is fresh, and the chosen size is executable.
- The immutable pool calibration and the recipient that will receive the output.
The application reads the deployed contract's quote path. The landing-page explorer is a separate floating-point educational model and is not used as an execution oracle. A failed on-chain quote is an unavailable trade, not a number to estimate locally and submit anyway.
Approve, then execute
- Select a pool, direction, and input amount.
- Wait for a valid quote; review output, fee, and slippage.
- Approve the input token if the current allowance is insufficient.
- Submit the swap and approve the wallet transaction.
- Wait for the receipt, then refresh balances and pool reserves.
Approvals and swaps are separate transactions. Rejecting the swap after approving leaves the allowance in place but does not trade your assets. A reverted swap rolls back its transfers and reserve changes; gas treatment follows the chain's transaction rules.
Fees are always denominated in USDG
For a fee-free USDG leg q of 100 USDG and a 0.30% swap fee, the total fee is 0.30 USDG before integer rounding. With a 20% protocol share, 0.24 USDG stays with LPs and 0.06 USDG accrues to the protocol.
| Trade | Trader's USDG amount | Fee ownership |
|---|---|---|
| Sell stock for q = 100 | Receives 99.70 USDG | 0.24 LP / 0.06 protocol |
| Buy stock for q = 100 | Pays 100.30 USDG | 0.24 LP / 0.06 protocol |
The example is arithmetic, not a market quote. The exact contract result rounds the total fee upward and protocol portion downward in USDG's smallest units. The leftover fraction of an exact-input budget is not protocol revenue.
Why a quote can be unavailable
| Gate | Reason |
|---|---|
| Market status | Required reference data or session observations are unavailable, stale, closed, or paused. |
| Time | The pool is within its five-minute cutoff or already expired. |
| Inventory domain | The proposed normalized stock reserve lies outside the supported range. |
| Reserve availability | The pool cannot fund the output and separately owed protocol fee. |
| Reference-price guard | The resulting marginal price is too far from the fresh reference. |
| Amount or rounding | The requested amount is too small or cannot produce a valid output. |
The minimum depends on direction. A stock sale needs a curve gross value of at least 1.000002 USDG; after the two-unit numerical buffer, its reported gross leg is at least 1.000000 USDG. A stock purchase needs a reported gross leg of at least 1.000002 USDG, so its minimum input budget is 1.003003 USDG at the 30 bps fee. Reserve, rounding, status, and price guards must still pass.
Refreshing can resolve a stale preview, but it cannot make an unsupported trade valid. Reduce size only after reviewing the resulting price. A closed market, invalid feed, or other reference gate cannot be bypassed by reloading the browser.