Factory Contract Overview
AgoraStableSwapFactory is responsible for deploying Agora Stable Swap pairs. The deployment process uses CREATE3 for deterministic deployment based off token0 and token1, meaning integrators can discover every pool without relying on off-chain registries.
Access‑Control Roles
Events
PairCreated
Emitted each time a pair is created via createPair.
- Only a user with
APPROVED_DEPLOYERrole can call the underlying function that triggers this event. token0is guaranteed to be strictly less thantoken1by sorting order
SetApprovedDeployer
Emitted when a new approved deployer is set, by calling setApprovedDeployers.
- Only a user with
ACCESS_CONTROL_MANAGER_ROLErole can call the underlying function that triggers this event.
Read-Only Functions
getAllPairData
Returns the information of all pairs deployed on a chain as an array of PairData structures, each containing the address of the pair, as well as information about the tokens that comprise the pair.
getPairFromTokens
Returns the address of the pair for token0 and token1, if it has been created, else address(0)
computePairDeploymentAddress
Returns the deterministic deployment address for a AgoraStableSwapPair deployed with tokenA and tokenB as swapping tokens.
- The tokens are sorted before calculating the deployment address.
- The deployment computation uses
CreateX.computeCreate3Address
version
Returns a Version structure with current deployment version for the factory
State-Changing Functions:
createPair
Creates a new pair with the given parameters, as long as a pair with token0 and token1 don’t exist already
- Only a user with
APPROVED_DEPLOYERrole can call this function. - Emits
PairCreated - The pair is deployed with its initial configuration, covering initial
access control roles,swapping feesandpricing parameters - The pair is deployed deterministically using
CreateX.deployCreate3
Interface
ABI
The ABI of the AgorastableSwapFactory is available here

