BigShort Docs

Migration and External AMM

Atomic migration on the final curve purchase, USDC precision conversion, LP locking, donation boundaries, and external constant-product pricing.

Once internal-market Token sale inventory reaches zero, BigShortProtocol-EVM establishes external liquidity using reserved Token + the curve's actual net USDC reserves and starts that Token's independent Short Engine. Migration does not use virtual USDC, mix in funds from other Token curves, or use lending reserves as initial external liquidity.

1. Trigger and Execution Order

OrderActionBusiness result
1Settle the final purchaseToken sale inventory reaches zero; state becomes Complete
2Deliver this purchase's Token and refund excess paymentThe transaction initiator receives the refund
3Emit internal-market trade and completion eventsRecord the final internal-market reserve snapshot
4Recheck the Token's configuration snapshot and predicted Engine addressDo not switch to a default Profile selected later
5Set state to Migrating and validate the main PairCheck Pair identity, runtime code, reserves, and balances
6Transfer 206,900,000 Token and the representable actual USDC amountEstablish actual external-market liquidity
7Mint migration LP to the zero address and verify itCheck that all initial LP is held by the zero address
8Deploy and initialize the Short EngineBind actual Pair reserves and existing lending inventory
9Validate bindings and enable main Pair tradingexternalTradingEnabled becomes true
10Clear the curve's actual USDC balance and record migrationFinal state is Migrated

2. From native18 to Six-Decimal ERC-20 USDC

Native Arc USDC balances and the external-market USDC ERC-20 interface represent the same quote asset with different precisions. The current code uses:

ScenarioPrecisionOne USDC
Internal-market payments, Factory ledger, Engine internal accountingnative1810¹⁸
External Pair's USDC ERC-20 interfaceexternal610⁶
Conversion factor s—10¹²

Let actual USDC reserves to migrate be Q18:

Q6=⌊Q181012⌋Qmigrated,18=Q6⋅1012,D=Q18mod1012

Here, Q6 is the number of smallest ERC-20 USDC units transferred into the Pair, and D is a remainder below 0.000001 USDC. The contract neither rounds this remainder up nor silently includes it in Pair reserves.

Ownership of Migration Remainders

Migration removes this curve's full Q18 from total liabilities for all unmigrated curves while adding remainder liability D. Other Token curves' reserves are not reduced by this migration.

3. Full-Scale Curve-Completion Example and Three Valuations

Example D: Buying All Initial Inventory at Once, without Tax or Donations

to buy all 793,100,000 Token. Net USDC entering the curve is:

Q18=⌈(4,292×1018)⋅(793,100,000×1018)(1,073,000,000−793,100,000)×1018⌉
ItemExact result
Net USDC entering the curve12,161.433369060378706681
Token added to the Pair206,900,000 Token
USDC added to the Pair12,161.433369 USDC
external6 USDC integer12,161,433,369
Migration remainder0.000000060378706681 USDC

These are one-shot examples with a defined initial baseline, not a promise that every sequence of buys and sells accumulates exactly the same smallest-unit result. Per-trade integer rounding and the exact-budget entry point can produce differences.

Distinguish the Curve Endpoint, Actual External Values, and Ideal Anchors

MetricValue in this examplePurpose
Internal-market virtual USDC after the final trade16,453.433369060378706681Virtual reserve record at the end of the internal market
Virtual Token at the internal-market endpoint279,900,000Virtual reserve record at the end of the internal market
Protocol market cap at the internal-market endpoint58,783.256052377201524405 USDCCalculated from internal-market virtual reserves
Actual initial external-market USDC12,161.433369Actual Pair funds
Actual initial external-market Token206,900,000Actual Pair funds
Actual initial external-market protocol market cap58,779.281628806186563557 USDCactualStartMarketCap
Fixed ideal migration USDC parameter12,161.433370Risk-model parameter, not a mandatory transfer amount
Fixed ideal migration market cap58,779.281633639439342677 USDCstartMarketCap, the anchor for risk / margin curves

The actual initial external-market price is approximately 0.000058779281628806186564 USDC/Token. Current parameters do not enforce exact smallest-unit continuity of marginal prices across migration; internal virtual reserves and actual migration reserves are distinct values.

Fixed ideal anchors provide a reproducible risk-model baseline; actual Pair reserves determine spot prices, debt buyback costs, and every executed swap. Do not describe the model parameter 12,161.433370 USDC as funds that every migration must receive.

4. Pair Pre-Creation, Donations, and Contamination Protection

Which Pre-Existing States Are Accepted?

At the start of migration:

  • The Pair's Token reserve must be 0.
  • The Pair's actual Token balance must be 0.
  • Total LP supply must be 0; previously issued LP held by others must not exist.
  • The Pair's USDC reserve must not exceed its actual USDC balance.
  • Pair address, constituent tokens, associated venue, and code identity must pass Profile validation.

After migration transfers, the actual USDC increase is checked. After LP minting, the Token reserve must equal the migration allocation, and the USDC reserve must equal actual USDC balance before migration + USDC added in this migration. A mismatch triggers PairContaminated or the applicable validation error and reverts.

Checking a configuration snapshot goes beyond checking a version number. Migration revalidates code hashes and relationships for the Engine deployer, Engine implementation, and venue Factory/Router, checks the Engine parameter hash and Oracle configuration, derives the expected Pair address from its initialization code hash, and validates the actual Pair through its runtime code hash. If deployer or implementation runtime code differs from the registered value, the final buy reverts atomically instead of silently using the changed implementation.

These rules do not guarantee acceptance of donations of any size; integer reserve ranges, LP minting, and other execution constraints still apply. Donations not yet recorded in reserves may also be removed by normal Pair operations before migration, so the balance at execution is what matters.

Where Do Donations Go?

Let the pre-existing USDC balance at migration be Qpre,6:

Qactual,6=Qpre,6+Q6

The curve still adds a fixed 206,900,000 Token. USDC donations retained at migration enter the actual pool, with no refund to the donor or final buyer. They raise the actual starting price and actualStartMarketCap, do not rewrite the fixed ideal migration anchors. A high-price donation at migration does not immediately complete time-weighted capacity release either.

Example E: Retaining an Extra 170 USDC in Example D's Main Pair

ItemNo donationWith an additional 170 USDC donation
External-market Token reserve206,900,000206,900,000
External-market USDC reserve12,161.43336912,331.433369
Actual initial protocol market cap58,779.28162880618656355759,600.934601256645722571
Fixed ideal migration market cap58,779.28163363943934267758,779.281633639439342677

Transferring USDC directly to the Factory is different: it does not automatically increase a Token's realNativeReserves and therefore does not automatically become that Token's migration funds. Distinguish curve ledger balances, the Factory's total balance, and actual Pair balances.

5. Final Destinations of LP and Lending Inventory

Ordinary Holders Cannot Redeem Any Initial LP

LPBalancezero=LPTotalSupply

It also requires LP minted in this operation to be greater than 0 and total LP to exceed the liquidity amount returned by this call, accounting for V2's initial minimum-liquidity structure. Neither the creator, operators, protocol wallets, nor the final buyer receives this migration LP.

Here, burning LP means LP is held by the zero address and cannot be retrieved and redeemed by ordinary accounts; it does not mean ERC-20 Total supply becomes 0, nor that Token in the Pair is burned. The migration check concerns the initial instant and does not establish that liquidity can never be added or other LP minted in the external AMM later.

Lending Reserves Remain Independent

The predicted Engine address already holds 199,861,071 Token. Migration only deploys and initializes the Engine; it does not mint again or transfer this principal into the Pair. Initialization reads actual Pair reserves and tracks available lending principal in a separate ledger.

BigShort Protocol · ARCIssue · Trade · Short