Skip to main content

Documentation Index

Fetch the complete documentation index at: https://actfun.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Graduation is the moment ACTFUN token transitions from the mining phase into a fully functional trading market. It happens automatically, in the same on-chain transaction as the final mine, the instant totalMined reaches mineableSupply. No one has to push a button, call a contract, or wait for an off-chain system to react.

What Triggers Graduation

Inside every mine() call, the contract checks whether totalMined >= mineableSupply after updating state. If that condition is true, it calls _graduate() before returning. This means the miner who fills the last slot pays the graduation cost as part of their own transaction — and they receive their tokens too.
You cannot mine a token that has already graduated. Calling mine() on a graduated token reverts with "Token has graduated — swap instead!". Switch to the swap interface to trade.

What _graduate() Does

When graduation fires, the contract executes three things in sequence:
  1. Sets graduated = true, permanently locking out the mining functions.
  2. Mints the 5% LP reserve tokens (lpReserve) to itself.
  3. Records the AMM’s initial reserves: tokenReserve = lpReserve and arcReserve = address(this).balance (all ARC accumulated from mining fees).
From that point on, buyTokens() and sellTokens() are unlocked, and the token trades against its own built-in liquidity pool.
The ARC side of the initial liquidity is the sum of all feePerMine payments collected during Phase 1, minus any refunds that miners claimed before graduation. Miners who claimed refunds before graduation reduced the pool’s initial depth.

The Constant-Product AMM Formula

MINEPAD’s built-in DEX uses the classic constant-product formula the same model as Uniswap v1. At any point in time, the pool maintains the invariant x * y = k, where x is arcReserve and y is tokenReserve.

Buying tokens with ARC

When you send ARC into the pool, the contract calculates how many tokens you receive:
tokensOut = arcIn × tokenReserve / (arcReserve + arcIn)
As arcIn increases, tokensOut grows but at a diminishing rate. Larger buys move the price more than smaller ones.

Selling tokens for ARC

When you sell tokens back to the pool, the contract calculates how much ARC you receive:
arcOut = tokenAmount × arcReserve / (tokenReserve + tokenAmount)
The same diminishing-returns dynamic applies in reverse. Selling a large fraction of the pool in one transaction results in significant price impact.
Suppose the pool has arcReserve = 100 ARC and tokenReserve = 50,000 tokens. You send 10 ARC.
tokensOut = 10 × 50,000 / (100 + 10)
         = 500,000 / 110
         ≈ 4,545 tokens
After the trade: arcReserve = 110 ARC, tokenReserve ≈ 45,455 tokens. The product 110 × 45,455 ≈ 5,000,050 is approximately equal to the original 100 × 50,000 = 5,000,000 — constant-product maintained (small rounding due to integer math).
Using the same pool (arcReserve = 100 ARC, tokenReserve = 50,000 tokens), you sell 5,000 tokens.
arcOut = 5,000 × 100 / (50,000 + 5,000)
       = 500,000 / 55,000
       ≈ 9.09 ARC
After the trade: arcReserve ≈ 90.91 ARC, tokenReserve = 55,000 tokens.

Price Discovery and Slippage

Because the AMM uses a fixed formula with no external oracle, the price of a token is determined entirely by the ratio of arcReserve to tokenReserve at any moment:
price (ARC per token) = arcReserve × 1e18 / tokenReserve
Slippage the difference between the expected price and the executed price — increases with trade size relative to pool depth. Both buyTokens() and sellTokens() accept a minimum output parameter (minTokensOut and minArcOut respectively). Your transaction reverts if the actual output falls below your minimum, protecting you from front-running and unexpected price moves.
The UI shows a live slippage estimate before you confirm. For large trades, consider splitting into smaller transactions to reduce price impact.

Why There Is No External DEX

Because the AMM lives inside the same TokenLauncher contract that handled mining, the token needs no external listing, no liquidity migration, and no bridge to another protocol. The pool is always at the same contract address. There is no LP token the pool’s liquidity is permanently locked inside the contract and cannot be withdrawn by anyone, including the creator.
There is no mechanism to remove liquidity from the AMM. The ARC and tokens in the pool are permanently locked. This is a deliberate design choice to guarantee that the market remains liquid after graduation.

Selling Requires an Approval Step

Selling tokens is a two-transaction process:
  1. Approve Call approve(launcherAddress, tokenAmount) on the ERC-20 token contract, granting the TokenLauncher permission to pull your tokens.
  2. Sell Call sellTokens(tokenAmount, minArcOut) on the launcher.
The ACTFUN UI handles this two-step flow automatically. If you are interacting with the contract directly, you must complete the approve transaction first or sellTokens will revert with an ERC-20 allowance error.
You only need to approve once per sell amount. If you approved more than you sold, the remaining allowance carries over and you may not need to approve again for your next sell — depending on the amount.