Factory
#
Code#
AddressDMMFactory
is deployed at 0x833e4083B7ae46CeA85695c4f7ed25CDAd8886dE
on the Ethereum mainnet. It was built from commit 04b47545c58fa0ab99d4bb9eae729b3be31efb0c.
#
Events#
PoolCreatedEmitted each time a pair is created via createPool.
token0
is guaranteed to be strictly less thantoken1
by sort order.totalPool
is the no. of pools created.
#
SetFeeConfigurationEmitted each time the fee configuration changes.
feeTo
refers to the address where the protocol fee is sent togovernmentFeeBps
refers to the amount of fees to take from each liquidity addition instance
See Protocol Fee.
#
Read-Only Functions#
getPoolsReturns all pools created for the pair of token0
and token1
. If there are none, an empty array []
is returned.
token0
andtoken1
are interchangeable.
#
getPoolsLengthReturns the total number of pools created for the pair of token0
and token1
.
#
getPoolAtIndexReturns the pool address found at index
of the pool array of the pair of token0
and token1
.
#
getUnamplifiedPoolReturns the address of the pool with amplification factor 1 of the pair of token0
and token1
.
#
isPoolReturns true
if pool
is a pool of the pair of token0
and token1
, false
otherwise.
#
allPoolsReturns the address of the n
th pool (0
-indexed) created through the factory, or address(0)
(0x0000000000000000000000000000000000000000
) if not enough pairs have been created yet.
- Pass
0
for the address of the first pair created,1
for the second, etc.
#
allPoolsLengthReturns the total number of pools created through the factory so far.
#
getFeeConfigurationSee Protocol Fee.
#
feeToSetterThe address allowed to change feeTo.
#
State-Changing Functions#
createPoolCreates a pool for token0
and token1
with amplification ampBps
.
token0
andtoken1
are interchangeable.- There can be at most 1 unamplified pool for a token pair, ie. only 1 pool can exist with
ampBps = BPS (10000)
. ampBps
should exceedBPS
for other non-amplified pools, and is specified in basis points (bps). For example,ampBps = 15500
means a pool of amplifcation factor of 1.55 is to be created.- Emits PoolCreated.