Architecture

How the factory, hook, fee ledger, and Uniswap v4 fit together.

Overview

Arklis tokens are plain ERC-20s that trade in Uniswap v4 pools. Four Arklis contracts sit around the standard Uniswap v4 deployment on each network. No API key and no Arklis server are needed to index or trade: everything below is on-chain.

Contracts and their jobs

DirectLaunchFactoryDeploys the token, opens and seeds its pool, burns the LP position, emits launch events
Launch
HookTakes the fee from the native side of every swap and reports it to the ledger
Swap
DirectFeeSplitterSplits each fee into per-address ledgers and pays claims
Fees
Fee sourceFee rates and the referrer registry the ledger reads
Config

Lifecycle of a token

  1. createDirectPool

    The creator calls the factory. It deploys a MemeToken with 1,000,000,000 supply and 6 decimals, and registers the creator on the fee ledger.
  2. Pool opens

    The factory initialises a v4 pool with currency0 = native, currency1 = token, fee 0, tick spacing 200, and the network's hook. All supply is added one-sided from the lowest usable tick to the config's tickUpper.
  3. LP burned

    The position NFT is minted to the factory and moved to 0x…dEaD in the same transaction. DirectPoolOpened is emitted with the pool id and metadata URI.
  4. Optional first buy

    If msg.value is non-zero the factory swaps it for the creator and emits InitialBuy. The hook takes the normal fee.
  5. Trading

    Anyone swaps through the Universal Router or any v4 router. On each swap the hook takes the fee and the ledger emits FeeSplit.

Launch function

DirectLaunchFactorysolidity

function createDirectPool(
  string name,
  string symbol,
  string uri,        // pass "" — the event then carries token.tokenURI()
  uint256 configId   // Arc 0–3, Robinhood Chain 4–7
) payable returns (address token);   // msg.value = optional initial buy

Where to go next