# m8s-lab/pump-launcher architecture

> Architecture diagram of the GitHub repository m8s-lab/pump-launcher, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/m8s-lab/pump-launcher
- Repository: https://github.com/m8s-lab/pump-launcher

## Overview

This is a Solana token-launch and trading bot. Its main workflow is to create and fund bundler/maker wallets, prepare token buys, submit the bundle through Jito, run a volume loop until the configured profit threshold, then sell and close wallets. The repository also contains Pump.fun and PumpSwap instruction-building SDKs. Several README-described stages have only small or unsampled handlers, so those components are shown without assuming their internal calls; the workflow links use README evidence where implementation was not shown.

Main entry points: [`src/app.ts`](https://github.com/m8s-lab/pump-launcher/blob/main/src/app.ts) (Main orchestration), [`src/lib/pumpfun/pumpfun.ts`](https://github.com/m8s-lab/pump-launcher/blob/main/src/lib/pumpfun/pumpfun.ts) (Pump.fun SDK), [`src/lib/pumpswap/pumpswap.ts`](https://github.com/m8s-lab/pump-launcher/blob/main/src/lib/pumpswap/pumpswap.ts) (PumpSwap SDK), [`src/handler/create-makers.ts`](https://github.com/m8s-lab/pump-launcher/blob/main/src/handler/create-makers.ts) (Wallet creation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Bot workflow"]
  node_app["Main orchestration<br/>[app.ts]"]
  node_wallets["Wallet creation<br/>[create-makers.ts]"]
  node_bundle["Bundle buys<br/>[bundle-buy.ts]"]
  node_migrate["Migration transaction<br/>[migrate.ts]"]
  node_distribution["Token distribution"]
  node_volume["Volume trading<br/>[buy-sell.ts]"]
  node_sellclose["Sell and close<br/>[sell-close.ts]"]
  node_profit["Profit threshold<br/>[env.ts]"]
end

subgraph group_pumpfun["Pump.fun"]
  node_pump_sdk["Pump.fun SDK<br/>[pumpfun.ts]"]
  node_pump_buy["Pump.fun buys<br/>[buy-token.ts]"]
  node_pump_sell["Pump.fun sells<br/>[sell-token.ts]"]
  node_curve["Bonding curve state"]
  node_global["Global account state<br/>[globalAccount.ts]"]
  node_pump_idl["Pump.fun IDL<br/>[pump-fun.ts]"]
end

subgraph group_pumpswap["PumpSwap"]
  node_swap_sdk["PumpSwap SDK<br/>[pumpswap.ts]"]
  node_swap_buy["PumpSwap buys<br/>[buy-pumpswap.ts]"]
  node_swap_sell["PumpSwap sells<br/>[sell-pumpswap.ts]"]
  node_swap_idl["PumpSwap IDL<br/>[pump-swap.ts]"]
end

subgraph group_foundation["Runtime foundation"]
  node_config["Runtime configuration<br/>[env.ts]"]
  node_web3["Solana transaction utilities<br/>[web3.ts]"]
  node_jito["Jito bundle submission<br/>[jito.ts]"]
end

node_operator(("Operator"))
node_rpc[("Solana RPC")]
node_jito_service["Jito block engine"]

node_operator -->|"starts"| node_app
node_app -->|"reads settings"| node_config
node_app -->|"creates wallets"| node_wallets
node_wallets -->|"executes funding"| node_web3
node_app -->|"prepares buys"| node_bundle
node_bundle -->|"builds buy instructions"| node_pump_buy
node_app -->|"prepares migration"| node_migrate
node_app -->|"submits transactions"| node_jito
node_jito -->|"sends bundles"| node_jito_service
node_app -->|"runs volume trades"| node_volume
node_app -->|"checks threshold"| node_profit
node_app -->|"sells at threshold"| node_sellclose
node_app -->|"reads balance"| node_rpc
node_app -->|"distributes tokens"| node_distribution
node_migrate -.->|"buys after migration"| node_swap_buy
node_pump_buy -->|"builds instructions"| node_pump_sdk
node_pump_sdk -->|"uses program definition"| node_pump_idl
node_pump_sdk -->|"reads curve state"| node_curve
node_pump_sdk -->|"reads global state"| node_global
node_pump_sell -->|"builds sell instructions"| node_pump_sdk
node_swap_buy -->|"builds buy instructions"| node_swap_sdk
node_swap_sell -->|"builds sell instructions"| node_swap_sdk
node_swap_sdk -->|"uses program definition"| node_swap_idl
node_web3 -->|"sends transactions"| node_rpc

click node_app "https://github.com/m8s-lab/pump-launcher/blob/main/src/app.ts"
click node_wallets "https://github.com/m8s-lab/pump-launcher/blob/main/src/handler/create-makers.ts"
click node_bundle "https://github.com/m8s-lab/pump-launcher/blob/main/src/handler/bundle-buy.ts"
click node_migrate "https://github.com/m8s-lab/pump-launcher/blob/main/src/handler/migrate.ts"
click node_distribution "https://github.com/m8s-lab/pump-launcher/blob/main/src/handler/distribute-token.ts"
click node_volume "https://github.com/m8s-lab/pump-launcher/blob/main/src/handler/buy-sell.ts"
click node_sellclose "https://github.com/m8s-lab/pump-launcher/blob/main/src/handler/sell-close.ts"
click node_profit "https://github.com/m8s-lab/pump-launcher/blob/main/src/core/config/env.ts"
click node_pump_sdk "https://github.com/m8s-lab/pump-launcher/blob/main/src/lib/pumpfun/pumpfun.ts"
click node_pump_buy "https://github.com/m8s-lab/pump-launcher/blob/main/src/lib/pumpfun/buy-token.ts"
click node_pump_sell "https://github.com/m8s-lab/pump-launcher/blob/main/src/lib/pumpfun/sell-token.ts"
click node_curve "https://github.com/m8s-lab/pump-launcher/blob/main/src/lib/pumpfun/bondingCurveAccount.ts"
click node_global "https://github.com/m8s-lab/pump-launcher/blob/main/src/lib/pumpfun/globalAccount.ts"
click node_pump_idl "https://github.com/m8s-lab/pump-launcher/blob/main/src/idl/pump-fun.ts"
click node_swap_sdk "https://github.com/m8s-lab/pump-launcher/blob/main/src/lib/pumpswap/pumpswap.ts"
click node_swap_buy "https://github.com/m8s-lab/pump-launcher/blob/main/src/lib/pumpswap/buy-pumpswap.ts"
click node_swap_sell "https://github.com/m8s-lab/pump-launcher/blob/main/src/lib/pumpswap/sell-pumpswap.ts"
click node_swap_idl "https://github.com/m8s-lab/pump-launcher/blob/main/src/idl/pump-swap.ts"
click node_config "https://github.com/m8s-lab/pump-launcher/blob/main/src/core/config/env.ts"
click node_web3 "https://github.com/m8s-lab/pump-launcher/blob/main/src/utils/web3.ts"
click node_jito "https://github.com/m8s-lab/pump-launcher/blob/main/src/lib/jito.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_wallets,node_bundle,node_migrate,node_distribution,node_volume,node_sellclose,node_profit toneBlue
class node_pump_sdk,node_pump_buy,node_pump_sell,node_curve,node_global,node_pump_idl,node_rpc toneAmber
class node_swap_sdk,node_swap_buy,node_swap_sell,node_swap_idl toneMint
class node_config,node_web3,node_jito toneRose
class node_operator,node_jito_service toneIndigo
```

## Components

### Bot workflow

- [Main orchestration](https://github.com/m8s-lab/pump-launcher/blob/main/src/app.ts): `src/app.ts`
- [Wallet creation](https://github.com/m8s-lab/pump-launcher/blob/main/src/handler/create-makers.ts): `src/handler/create-makers.ts`
- [Bundle buys](https://github.com/m8s-lab/pump-launcher/blob/main/src/handler/bundle-buy.ts): `src/handler/bundle-buy.ts`
- [Migration transaction](https://github.com/m8s-lab/pump-launcher/blob/main/src/handler/migrate.ts): `src/handler/migrate.ts`
- [Token distribution](https://github.com/m8s-lab/pump-launcher/blob/main/src/handler/distribute-token.ts): `src/handler/distribute-token.ts`
- [Volume trading](https://github.com/m8s-lab/pump-launcher/blob/main/src/handler/buy-sell.ts): `src/handler/buy-sell.ts`
- [Sell and close](https://github.com/m8s-lab/pump-launcher/blob/main/src/handler/sell-close.ts): `src/handler/sell-close.ts`
- [Profit threshold](https://github.com/m8s-lab/pump-launcher/blob/main/src/core/config/env.ts): `src/core/config/env.ts`

### Pump.fun

- [Pump.fun SDK](https://github.com/m8s-lab/pump-launcher/blob/main/src/lib/pumpfun/pumpfun.ts): `src/lib/pumpfun/pumpfun.ts`
- [Pump.fun buys](https://github.com/m8s-lab/pump-launcher/blob/main/src/lib/pumpfun/buy-token.ts): `src/lib/pumpfun/buy-token.ts`
- [Pump.fun sells](https://github.com/m8s-lab/pump-launcher/blob/main/src/lib/pumpfun/sell-token.ts): `src/lib/pumpfun/sell-token.ts`
- [Bonding curve state](https://github.com/m8s-lab/pump-launcher/blob/main/src/lib/pumpfun/bondingCurveAccount.ts): `src/lib/pumpfun/bondingCurveAccount.ts`
- [Global account state](https://github.com/m8s-lab/pump-launcher/blob/main/src/lib/pumpfun/globalAccount.ts): `src/lib/pumpfun/globalAccount.ts`
- [Pump.fun IDL](https://github.com/m8s-lab/pump-launcher/blob/main/src/idl/pump-fun.ts): `src/idl/pump-fun.ts`

### PumpSwap

- [PumpSwap SDK](https://github.com/m8s-lab/pump-launcher/blob/main/src/lib/pumpswap/pumpswap.ts): `src/lib/pumpswap/pumpswap.ts`
- [PumpSwap buys](https://github.com/m8s-lab/pump-launcher/blob/main/src/lib/pumpswap/buy-pumpswap.ts): `src/lib/pumpswap/buy-pumpswap.ts`
- [PumpSwap sells](https://github.com/m8s-lab/pump-launcher/blob/main/src/lib/pumpswap/sell-pumpswap.ts): `src/lib/pumpswap/sell-pumpswap.ts`
- [PumpSwap IDL](https://github.com/m8s-lab/pump-launcher/blob/main/src/idl/pump-swap.ts): `src/idl/pump-swap.ts`

### Runtime foundation

- [Runtime configuration](https://github.com/m8s-lab/pump-launcher/blob/main/src/core/config/env.ts): `src/core/config/env.ts`
- [Solana transaction utilities](https://github.com/m8s-lab/pump-launcher/blob/main/src/utils/web3.ts): `src/utils/web3.ts`
- [Jito bundle submission](https://github.com/m8s-lab/pump-launcher/blob/main/src/lib/jito.ts): `src/lib/jito.ts`

### Other components

- **Operator**
- **Solana RPC**
- **Jito block engine**

## Connections

- Operator → Main orchestration: starts (evidence: `README.md`)
- Main orchestration → Runtime configuration: reads settings (evidence: `src/app.ts`)
- Main orchestration → Wallet creation: creates wallets (evidence: `src/app.ts`)
- Wallet creation → Solana transaction utilities: executes funding (evidence: `src/handler/create-makers.ts`)
- Main orchestration → Bundle buys: prepares buys (evidence: `src/app.ts`)
- Bundle buys → Pump.fun buys: builds buy instructions (evidence: `src/handler/bundle-buy.ts`)
- Main orchestration → Migration transaction: prepares migration (evidence: `src/app.ts`)
- Main orchestration → Jito bundle submission: submits transactions (evidence: `src/app.ts`)
- Jito bundle submission → Jito block engine: sends bundles (evidence: `src/lib/jito.ts`)
- Main orchestration → Volume trading: runs volume trades (evidence: `src/app.ts`)
- Main orchestration → Profit threshold: checks threshold (evidence: `src/app.ts`)
- Main orchestration → Sell and close: sells at threshold (evidence: `src/app.ts`)
- Main orchestration → Solana RPC: reads balance (evidence: `src/app.ts`)
- Main orchestration → Token distribution: distributes tokens (evidence: `README.md`)
- Migration transaction → PumpSwap buys: buys after migration
- Pump.fun buys → Pump.fun SDK: builds instructions (evidence: `src/lib/pumpfun/buy-token.ts`)
- Pump.fun SDK → Pump.fun IDL: uses program definition (evidence: `src/lib/pumpfun/pumpfun.ts`)
- Pump.fun SDK → Bonding curve state: reads curve state (evidence: `src/lib/pumpfun/pumpfun.ts`)
- Pump.fun SDK → Global account state: reads global state (evidence: `src/lib/pumpfun/pumpfun.ts`)
- Pump.fun sells → Pump.fun SDK: builds sell instructions (evidence: `src/lib/pumpfun/sell-token.ts`)
- PumpSwap buys → PumpSwap SDK: builds buy instructions (evidence: `src/lib/pumpswap/buy-pumpswap.ts`)
- PumpSwap sells → PumpSwap SDK: builds sell instructions (evidence: `src/lib/pumpswap/sell-pumpswap.ts`)
- PumpSwap SDK → PumpSwap IDL: uses program definition (evidence: `src/lib/pumpswap/pumpswap.ts`)
- Solana transaction utilities → Solana RPC: sends transactions (evidence: `src/utils/web3.ts`)
