# pump-fun/pump-public-docs architecture

> Architecture diagram of the GitHub repository pump-fun/pump-public-docs, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/pump-fun/pump-public-docs
- Repository: https://github.com/pump-fun/pump-public-docs

## Overview

##### Project type and purpose
- This is an **open-source documentation and IDL distribution** repo for two Solana on-chain programs: Pump (bonding curves) and PumpSwap (AMM).
- It provides:
- Markdown guides in `docs/` explaining fee updates, use cases, integration steps.
- Interface Definition Language files (`idl/*.json` and `idl/*.ts`) that describe the on-chain programs’ APIs.

##### File structure
- Top-level:
- `README.md` – high-level project overview and integration advice.
- `docs/` – detailed upgrade guides and per-program READMEs.
- `idl/` – protocol schemas (Pump & Pump AMM) in JSON and TypeScript form.
- No source code beyond IDLs—this repo’s role is to serve docs and type definitions.

##### README for additional insights
- Purpose: announce and guide implementation of “coin creator fee” updates.
- Integration: recommends using the provided IDL and the two NPM packages:
– `@pump-fun/pump-sdk`
– `@pump-fun/pump-swap-sdk`

##### Main components
a. **Developer / Integrator** – reads docs, chooses IDL, writes code
b. **Documentation Layer (docs/ & README.md)** – guides upgrade steps and API usage
c. **IDL Layer (idl/*.json & idl/*.ts)** – binds program interface definitions to code
d. **TypeScript SDKs** – `pump-sdk`, `pump-swap-sdk` (external NPM libraries)
e. **Solana JSON-RPC Endpoint** – network interface for submitting transactions
f. **On-Chain Programs**
- **Pump Program** (bonding curves)
- **PumpSwap (AMM) Program**
g. **Blockchain State Accounts** – account data managed by the programs

##### Relationships & interactions
- Developer consults **Documentation** → selects matching **IDL** files → imports into **SDK** → writes application code.
- SDK uses **IDL** to serialize instructions → sends RPC calls to **Solana JSON-RPC** → invokes **Pump** & **PumpSwap** programs → updates **on-chain accounts**.

##### Architectural patterns & design principles
- **Interface-Driven**: IDL → SDK codegen → client apps
- **Separation of Concerns**: docs vs. type definitions vs. network interface vs. on-chain logic
- **Extensibility**: new instructions or fee updates are added in IDL and docs without touching on-chain code in this repo.

##### Relevant technologies
- Markdown for documentation
- Anchor IDL (JSON & TS) for interface definitions
- TypeScript NPM packages (`@pump-fun/pump-sdk`, `@pump-fun/pump-swap-sdk`)
- Solana JSON-RPC protocol
- On-chain Rust programs (Pump, PumpSwap)

- Component names (Docs, IDL, Pump SDK, PumpSwap SDK, JSON-RPC, Pump, PumpSwap, Accounts)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Developer
    Developer["Developer / Integrator"]:::developer

    %% Documentation Layer
    subgraph "Documentation Layer"
        DocsOverview["README.md"]:::docs
        DocsPumpProg["PUMP_PROGRAM_README.md"]:::docs
        DocsPumpFee["PUMP_CREATOR_FEE_README.md"]:::docs
        DocsSwapProg["PUMP_SWAP_README.md"]:::docs
        DocsSwapFee["PUMP_SWAP_CREATOR_FEE_README.md"]:::docs
        DocsSwapSDK["PUMP_SWAP_SDK_README.md"]:::docs
    end

    %% IDL Layer
    subgraph "IDL Layer"
        IDLPumpJSON["pump.json"]:::idl
        IDLPumpTS["pump.ts"]:::idl
        IDLSwapJSON["pump_amm.json"]:::idl
        IDLSwapTS["pump_amm.ts"]:::idl
    end

    %% SDK Layer
    subgraph "SDK Layer"
        PumpSDK["@pump-fun/pump-sdk"]:::sdk
        SwapSDK["@pump-fun/pump-swap-sdk"]:::sdk
    end

    %% Network
    RPC["Solana JSON-RPC Endpoint"]:::network

    %% On-Chain Programs
    subgraph "On-Chain Programs"
        PumpProg["Pump Program"]:::program
        SwapProg["PumpSwap Program"]:::program
    end

    %% Storage
    Accounts["Blockchain State Accounts"]:::storage

    %% Connections
    Developer -->|"reads documentation"| DocsOverview
    Developer -->|"reads documentation"| DocsPumpProg
    Developer -->|"reads documentation"| DocsPumpFee
    Developer -->|"reads documentation"| DocsSwapProg
    Developer -->|"reads documentation"| DocsSwapFee
    Developer -->|"reads documentation"| DocsSwapSDK

    Developer -->|"selects IDL"| IDLPumpJSON
    Developer -->|"selects IDL"| IDLPumpTS
    Developer -->|"selects IDL"| IDLSwapJSON
    Developer -->|"selects IDL"| IDLSwapTS

    IDLPumpJSON -->|"import IDL"| PumpSDK
    IDLPumpTS -->|"import IDL"| PumpSDK
    IDLSwapJSON -->|"import IDL"| SwapSDK
    IDLSwapTS -->|"import IDL"| SwapSDK

    PumpSDK -->|"serialize & send"| RPC
    SwapSDK -->|"serialize & send"| RPC

    RPC -->|"invoke instruction"| PumpProg
    RPC -->|"invoke instruction"| SwapProg

    PumpProg -->|"update account"| Accounts
    SwapProg -->|"update account"| Accounts

    %% Click Events
    click DocsOverview "https://github.com/pump-fun/pump-public-docs/blob/main/README.md"
    click DocsPumpProg "https://github.com/pump-fun/pump-public-docs/blob/main/docs/PUMP_PROGRAM_README.md"
    click DocsPumpFee "https://github.com/pump-fun/pump-public-docs/blob/main/docs/PUMP_CREATOR_FEE_README.md"
    click DocsSwapProg "https://github.com/pump-fun/pump-public-docs/blob/main/docs/PUMP_SWAP_README.md"
    click DocsSwapFee "https://github.com/pump-fun/pump-public-docs/blob/main/docs/PUMP_SWAP_CREATOR_FEE_README.md"
    click DocsSwapSDK "https://github.com/pump-fun/pump-public-docs/blob/main/docs/PUMP_SWAP_SDK_README.md"
    click IDLPumpJSON "https://github.com/pump-fun/pump-public-docs/blob/main/idl/pump.json"
    click IDLPumpTS "https://github.com/pump-fun/pump-public-docs/blob/main/idl/pump.ts"
    click IDLSwapJSON "https://github.com/pump-fun/pump-public-docs/blob/main/idl/pump_amm.json"
    click IDLSwapTS "https://github.com/pump-fun/pump-public-docs/blob/main/idl/pump_amm.ts"

    %% Styles
    classDef developer fill:#EFF8FF,stroke:#2D74DA,color:#2D74DA,stroke-width:2px;
    classDef docs fill:#E3F2FD,stroke:#1E88E5,color:#0D47A1,stroke-width:2px;
    classDef idl fill:#E8F5E9,stroke:#43A047,color:#1B5E20,stroke-width:2px;
    classDef sdk fill:#FFF3E0,stroke:#FB8C00,color:#E65100,stroke-width:2px;
    classDef network fill:#E0F7FA,stroke:#00ACC1,color:#006064,stroke-width:2px,shape:circle;
    classDef program fill:#FFF8E1,stroke:#FFA000,color:#E65100,stroke-width:2px;
    classDef storage fill:#ECEFF1,stroke:#78909C,color:#455A64,stroke-width:2px,shape:hexagon;
```
