DEX overview
Two AMMs on ApeChain, a Uniswap V2 fork and a Uniswap V3 fork, with the addresses, init code hashes and fee tiers that differ from upstream.
On this page
Armory ships two automated market makers on ApeChain. Both are Uniswap forks that stay byte-equivalent to upstream except for the modifications listed on this page.
That rule is the reason this integration is cheap. If you already have a
Uniswap V2 or V3 integration, the interfaces are the ones you know. The
interface types even keep their IUniswap* names, deliberately, so existing
tooling resolves against them. What changes is the addresses, the two CREATE2
init code hashes, and the V3 fee tier set.
The two AMMs
Which to target
Target V3 when you need range orders, tick-level data, or the 2.5% tier. Target
V2 when you want a view quote with no simulation round trip, a fungible LP
token you can lock or collateralize, or the simplest possible path encoding.
New token launches on this venue land on V3's 2.5% tier by default. If you are routing, quote both. The same pair can exist on a V2 pair and on up to four V3 pools simultaneously, and nothing forces them to agree.
Deployment facts
Chain is ApeChain mainnet, chain id 33139. There is no testnet target.
Wrapped native APE is WAPE. Every place upstream Uniswap says WETH or WETH9
(the V2 router's WETH() getter, the V3 periphery's WETH9() getter,
unwrapWETH9, swapExactETHForTokens) that identifier is unchanged in the
source and resolves to WAPE. The names were not renamed; only the wiring
changed. Read the address off the contract rather than assuming.
const wape = await publicClient.readContract({
address: CONTRACTS.v2Router,
abi: V2_ROUTER_ABI,
functionName: "WETH",
});Init code hashes
Two CREATE2 init code hashes let you derive pair and pool addresses off-chain with no RPC call. Both are compiled into periphery libraries.
The V2 hash is Armory-specific because the LP token's name and symbol
change the pair creation code. The V3 hash is Uniswap's canonical mainnet pool
init code hash.
Each hash is documented with its derivation on the page that owns it: V2 core and V3 core.
Contract map
The lockers, the aggregator and the integrator referral router are separate product surfaces documented elsewhere. They compose these contracts and do not alter them. The aggregator's platform fee is read from chain at trade time and is not a property of the AMMs below.
What is different from stock Uniswap
The complete modification list:
- Renames.
UniswapV2Factory/Pair/ERC20,UniswapV2Router02,UniswapV3Factory/Pool/PoolDeployerbecomeArmory*. Interfaces keep theirIUniswap*names. Zero bytecode impact except where item 3 applies. - V3 fee tiers. Set in the
ArmoryV3Factoryconstructor. Factory bytecode only. - Branding strings. V2 LP token is
Armory V2/ARMORY-V2; the V3 position NFT isArmory V3 Positions NFT-V1/ARMORY-V3-POS. The LP token strings are what move the V2 pair init code hash. - The V2 init code hash constant in
UniswapV2Library, patched to match.PoolAddressneeded no patch. - Pragma caps (
<0.8.0on open-ended pragmas) and thecore-v3SPDX header updated from BUSL-1.1 to GPL-2.0-or-later, reflecting Uniswap's own 2023-04-01 license conversion.
Nothing else. No fee-on-swap hook, no transfer tax, no pause switch, no upgradeable proxy, no allowlist. A V2 pair and a V3 pool here behave exactly as their upstream counterparts do.