Build with Signal
Graduation and refunds
Model the curve's lifecycle with its actual state:
| State | Integration behavior |
|---|---|
graduated = false, capacity remains | Curve quote and trade path |
graduated = false, sale capacity filled | Graduation may be pending or deferred; do not assume pool routing |
graduated = true | Pool quote and trade path |
The last buy may trigger graduation. If the pool-seeding attempt fails or is deferred, the buy itself can still succeed and emit GraduationDeferred. A later graduate() call can retry when conditions allow. A sell before graduation can reopen sale capacity.
Change on the last buy
| Entry method | Change asset | Recipient |
|---|---|---|
buyQuote | Pairing ERC20 | msg.sender |
buyHype, WHYPE pair | Native HYPE after unwrap | msg.sender |
buyHype, another pair | Pairing ERC20; no automatic conversion back to HYPE | msg.sender |
The token recipient can differ from the payer. Refunds belong in the payer's receipt summary even when tokens go elsewhere.
Offer an input maximum, quote the actual spend and show potential change in its correct asset. A final buy with a refund is not necessarily a failed fill.
Gas and phase changes
A graduating buy can perform more work than an ordinary buy. Estimate the full transaction from the actual wallet and current state; do not use one hard-coded gas limit for every stage. Gas paid is additional to the quote.
If phase changes before the transaction executes, the Pair Router's expected-phase guard rejects the stale request. Fetch new state and rebuild the quote; do not retry identical stale calldata or drop the phase check.