Factory
Factory Class Reference
Factory Overview
The factory is the main entrypoint for interacting with and creating tokens on the Doppler protocol. It is responsible for deploying new tokens, parameterizing pools, migrating existing tokens, and serving information about the state of the protocol.
ReadFactory
Read-only operations for the Doppler factory.
Methods:
getModuleState(address: Address): Promise<ModuleState>
Returns the state of a module (NotWhitelisted, TokenFactory, GovernanceFactory, HookFactory, Migrator)
getAssetData(asset: Address): Promise<AssetData>
Returns information about a DERC20 token deployed by the airlock contract:
getCreateEvents(): Promise<Event[]>
getMigrateEvents(): Promise<Event[]>
ReadWriteFactory
Extends ReadFactory with write operations.
The primary use case for the ReadWriteFactory is to encode the parameters for, simulate, and invoke the create
method. Proper utilization of the ReadWriteFactory involves the following steps:
Initialize a new
ReadWriteFactory
with the factory (airlock) address and a drift client with both a public and wallet client attached.Pass
CreateV3PoolParams
to theencode
method in order to build the calldata for thecreate
method. Note that thesaleConfig
,v3PoolConfig
, andgovernanceConfig
are optional and can be omitted. Omission of these parameters will use the default values for each respective config. The default values are exported from thedoppler-v3-sdk
package underdefaultSaleConfig
,defaultV3PoolConfig
, anddefaultGovernanceConfig
, anddefaultVestingConfig
. These default configs can be modified to customize the token creation process, but modifications should be made with caution as they may break some of the algebraic invariants of the Doppler protocol.
encode
returns the following payload, which is used to simulate and invoke the create
method:
Simulate the
create
method to ensure the parameters are correct
Note: The simulateCreate
method is a simulation of the create
method and does not consume any gas. It is recommended to simulate the create
method before invoking it in order to ensure that the parameters are correct and that the method will succeed.
Invoke the
create
method
Pool Operations
ReadUniswapV3Pool
Read operations for Doppler V3 pools.
Methods:
getMintEvents(): Promise<Event[]>
getBurnEvents(): Promise<Event[]>
getSwapEvents(): Promise<Event[]>
getSlot0(): Promise<{sqrtPriceX96: bigint, tick: number}>
getToken0(): Promise<Address>
getToken1(): Promise<Address>
getFee(): Promise<number>
Event Types
Factory Events
Pool Events
Network Configuration
Supported Networks:
Unichain Sepolia (chainId: 1301)
Unichain (chainId: 130)
Doppler v4 SDK API Reference
Coming Soon!
Last updated