Documentation
Documentation
Every contract Armory runs on ApeChain, what it exposes, and how to call it from your own code.
Start here
What is deployed, on which chain, and at which addresses.
DEX
Two AMMs. A constant-product V2 and a concentrated-liquidity V3, both forks you can already read.
- DEX overviewTwo 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.
- V2 coreArmoryV2Factory and ArmoryV2Pair, covering CREATE2 addressing, the pair init code hash, the K invariant, TWAP cumulatives, and every deviation from canonical UniswapV2.
- V2 peripheryThe ArmoryV2Router surface in full, including deadline and slippage conventions, permit variants, fee-on-transfer variants, and the native-APE wrapping paths.
- V3 coreThe V3 factory, pool deployer and pool, covering the fee tier set, the CREATE2 scheme and pool init code hash, the pool actions, the callbacks you must implement, and the oracle.
- V3 peripheryThe position manager, swap router, quoter and tick lens, covering the position lifecycle, the exact path byte layout, multicall and permit patterns, and why the quoter must be simulated.
- Integration recipesWorking examples covering a V2 quote-then-swap, a V3 multi-hop exact input, a Solidity contract calling a pool directly, off-chain address derivation, and reading a position's value.
- Access controlWho owns what across the DEX, what the admin and fee manager contracts can do, what the multisig gates, and what none of it can touch.
Aggregator
Route a trade across every venue on the chain, or write an adapter and add one.
- Aggregator overviewWhat ArmoryTradeManager is, how venues are addressed by dexId, and what routing through it gives an integrator.
- TradeManager referenceThe full external ABI of ArmoryTradeManager, covering quoting, buys, sells, structs, events, access control and every revert.
- Path encodingSwapPaths byte layouts per venue kind, the WAPE anchor, the buy and sell direction rule, and a TypeScript encoder.
- Writing an adapterITradeAdapter as a build target, the custody contract, the two shipped reference implementations, and a skeleton to copy.
- HooksITradeTracker, ITradeFeeReceiver and IReferralManager, the three swappable seams on the trade manager.
- Integration recipesviem and Solidity patterns for quoting, buying with a native APE leg, selling with the correct path direction, multi-hop, and routing your users' trades.
Lockers
Lock tokens, V2 LP and V3 positions. Add liquidity and lock it in one transaction.
- Lockers overviewThree contracts that hold assets until a deadline nobody can move backwards, plus a router that adds liquidity and locks it in the same transaction.
- Token lockerERC-20 and V2 LP locks, plus batch vesting schedules, in ArmoryTokenLocker.
- V3 position lockerEscrowing an NFPM position so its liquidity can never leave while its swap fees keep flowing.
- Fee modulesThe IArmoryFeeModule extension point, the approval registry, the security model, and ArmoryFeeSplitter as a worked reference implementation.
- Lock routeraddLiquidityAndLock and mintAndLock, which add liquidity and lock it in the same transaction.
- Integration recipesviem and Solidity snippets for the locker operations an integrator actually needs.
Bridge
ChainHop: tokens and NFTs across seven chains over CCIP.
- Bridge overviewChainHop is a permissionless lock-and-mint bridge for ERC20s and ERC721s, built on Chainlink CCIP as an owner-routed mesh of one vault per chain.
- How a hop worksThe full lifecycle of one ChainHop transfer, from approve through CCIP delivery, including multi-hop tracing and what recourse exists when a delivery fails.
- Token vaultThe complete external ABI of ChainHopTokenVault, covering quoting, bridging, the wire format, events, access control, and every revert an integrator can hit.
- NFT vaultChainHopNFTVault, the ERC721 mesh, its batch limit, per-id delivery semantics, wrapped-collection behavior and tokenURI handling on the destination chain.
- Wrapped assetsHow ChainHopWrappedToken and ChainHopWrappedNFT are deployed and addressed, how to compute a wrapper address before it exists, and how a round trip unwraps.
- Integration recipesWorking viem and Solidity for quoting, approving, bridging tokens and NFT batches, polling a transfer to completion, and listing and paying out claims.
- Subgraph referenceThe ChainHop subgraph, one deployment per chain, its entities, and worked queries for bridge history, hop tracing, claims and wrapped holdings.