> ## Documentation Index
> Fetch the complete documentation index at: https://docs.raydium.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Toolchain

> Minimale funktionierende Einrichtung zum Lesen des On-Chain-Status von Raydium, zum Aufbau von Transaktionen und zur Entwicklung gegen die Programme. Solana CLI, Anchor, SDKs in TypeScript und Python, sowie Tipps für Devnet/Localnet.

<Info>
  **Diese Seite wurde mit KI automatisch übersetzt. Maßgeblich ist stets die englische Version.**

  [Englische Version ansehen →](/solana-fundamentals/toolchain)
</Info>

Diese Dokumentation setzt eine funktionierende Solana-Entwicklungs-Toolchain voraus. Diese Seite führt die Tools auf, nennt die Minimalversionen, die mit Raydium ab April 2026 funktionieren, und erklärt spezifische Setup-Stolpersteine. Lesen Sie diese Seite, bevor Sie die Code-Beispiele in den folgenden Kapiteln ausführen.

## Kernwerkzeuge

### Solana CLI

Die offizielle Kommandozeilenschnittstelle für die Interaktion mit Solana-Clustern — Wallet-Verwaltung, RPC-Aufrufe, Programm-Deployment.

Installation:

```bash theme={null}
sh -c "$(curl -sSfL https://release.solana.com/v1.18.22/install)"
# Oder die neueste stabile Version:
sh -c "$(curl -sSfL https://release.solana.com/stable/install)"
```

Überprüfung:

```bash theme={null}
solana --version   # → solana-cli 1.18.22 (oder neuer)
```

Für Mainnet konfigurieren:

```bash theme={null}
solana config set --url https://api.mainnet-beta.solana.com
solana config set --keypair ~/.config/solana/id.json
solana-keygen new                           # Wallet erstellen, wenn Sie noch keine haben
solana address                              # Ihr öffentlicher Schlüssel
```

Für Raydium-Tests benötigen Sie fast immer eine Devnet-Wallet mit Guthaben:

```bash theme={null}
solana config set --url https://api.devnet.solana.com
solana airdrop 2                            # 2 SOL zum Testen
```

### SPL Token CLI

Die offizielle CLI für SPL Token / Token-2022-Operationen — Erstellen von Mints, Minting von Token, Transfers.

Installation (in der Solana CLI enthalten):

```bash theme={null}
spl-token --version
```

Häufige Operationen:

```bash theme={null}
spl-token create-token                                  # SPL Token Mint erstellen
spl-token create-token --program-id TOKEN_2022 ...      # Token-2022 Mint erstellen
spl-token create-account <MINT>                         # ATA erstellen
spl-token mint <MINT> 1000                              # 1000 Token zu Ihrer ATA minten
spl-token transfer <MINT> 100 <RECIPIENT>               # 100 Token transferieren
spl-token display <ACCOUNT_OR_MINT>                     # inspizieren
```

### Anchor CLI

Notwendig zum Abrufen von Raydium IDLs, zum Erstellen von Clients und zum Verifizieren von Programmen.

Installation:

```bash theme={null}
cargo install --git https://github.com/coral-xyz/anchor avm --locked
avm install 0.30.1
avm use 0.30.1
anchor --version
```

Häufige Operationen:

```bash theme={null}
anchor idl fetch <PROGRAM_ID> -o program.idl.json       # On-Chain-IDL abrufen
anchor idl init -f idl.json <PROGRAM_ID>                # IDL hochladen
anchor build                                             # Programm aus Quellcode erstellen
```

## TypeScript-Setup

Der primäre Integrationspfad für Raydium.

### Pakete

```bash theme={null}
npm install \
  @solana/web3.js \
  @solana/spl-token \
  @coral-xyz/anchor \
  @raydium-io/raydium-sdk-v2 \
  bn.js \
  decimal.js
```

Versionen, die ab April 2026 zusammen funktionieren:

| Paket                        | Version       |
| ---------------------------- | ------------- |
| `@solana/web3.js`            | ≥1.95         |
| `@solana/spl-token`          | ≥0.4          |
| `@coral-xyz/anchor`          | ≥0.30         |
| `@raydium-io/raydium-sdk-v2` | ≥0.2.42-alpha |

### Minimales Skript

```ts theme={null}
import { Connection, Keypair } from "@solana/web3.js";
import { Raydium } from "@raydium-io/raydium-sdk-v2";

const connection = new Connection("https://api.mainnet-beta.solana.com", "confirmed");
const owner      = Keypair.fromSecretKey(/* your key */);

const raydium = await Raydium.load({
  connection,
  owner,
  cluster:      "mainnet",
  disableFeatureCheck: true,
});

const poolInfo = await raydium.api.fetchPoolById({ id: "..." });
console.log(poolInfo);
```

Siehe [`sdk-api/typescript-sdk`](/de/sdk-api/typescript-sdk) für die vollständige SDK-Referenz.

## Rust-Setup

Für CPI-Integration und On-Chain-Programme.

### Toolchain

```bash theme={null}
rustup install 1.76.0           # oder was Anchor aktuell benötigt
rustup component add rustfmt clippy
solana-install init 1.18.22     # BPF-Toolchain enthalten
```

### Program Cargo.toml für eine Raydium CPI-Integration

```toml theme={null}
[dependencies]
anchor-lang        = "0.30.1"
anchor-spl         = "0.30.1"
raydium-cp-swap    = { version = "0.2", features = ["cpi"] }
raydium-clmm       = { version = "0.1", features = ["cpi"] }
```

Die `"cpi"`-Feature importiert das `cpi`-Modul mit CPI-Helfern (damit Sie `raydium_cp_swap::cpi::swap_base_input(...)` aufrufen können). Siehe [`sdk-api/rust-cpi`](/de/sdk-api/rust-cpi).

## Python-Setup

Sekundärer Integrationspfad — häufig für Bot-Entwickler.

### Pakete

```bash theme={null}
pip install solders solana-py anchorpy
pip install raydium-py    # Community Raydium SDK (nicht offiziell)
```

Versionen:

| Paket        | Version |
| ------------ | ------- |
| `solders`    | ≥0.21   |
| `solana-py`  | ≥0.34   |
| `anchorpy`   | ≥0.21   |
| `raydium-py` | ≥0.2.1  |

### Minimales Skript

```python theme={null}
from solana.rpc.async_api import AsyncClient
from solders.keypair import Keypair
from anchorpy import Provider, Wallet, Program

async def main():
    conn = AsyncClient("https://api.mainnet-beta.solana.com")
    owner = Keypair()
    wallet = Wallet(owner)
    provider = Provider(conn, wallet)

    # IDL und Programm laden
    with open("cpmm.idl.json") as f:
        idl = json.load(f)
    program = Program(idl, CPMM_PROGRAM_ID, provider)

    pool = await program.account["PoolState"].fetch(pool_id)
    print(pool)
```

Siehe [`sdk-api/python-integration`](/de/sdk-api/python-integration).

## RPC-Endpunkte

Der öffentliche Mainnet-RPC (`api.mainnet-beta.solana.com`) hat eine strikte Ratenbegrenzung und wird unter Last gedrosselt. Für nicht-triviale Nutzung benötigen Sie einen privaten Endpunkt:

| Anbieter           | Hinweise                                            |
| ------------------ | --------------------------------------------------- |
| Helius             | Am beliebtesten; großzügiger kostenloser Plan.      |
| Triton             | Enterprise; Premium-Pricing, stabil.                |
| QuickNode          | Solide; Latenz unter einer Sekunde.                 |
| Eigener RPC-Knoten | Kostet \~\$500/Monat für Hardware; volle Kontrolle. |

Konfiguration:

```ts theme={null}
const connection = new Connection("https://mainnet.helius-rpc.com/?api-key=...");
```

Einige RPC-Operationen benötigen erweiterte Funktionen:

* `getProgramAccounts` — unbeschränkte Scans sind teuer; einige Anbieter sperren sie oder berechnen pro Scan.
* `getPriorityFeeEstimate` — Helius-spezifischer Endpunkt; andere haben Äquivalente.
* `geyser` / WebSocket-Streaming — nötig für Low-Latency-Bots; nicht alle Anbieter bieten es an.

## Devnet und Localnet

### Devnet

Solanas öffentlicher Test-Cluster. Raydium hat ein teilweise Devnet-Deployment:

* Es gibt einige CPMM-Pools zum Testen.
* AMM v4 hat historische Devnet-Pools.
* CLMM hat ein paar Demo-Pools.
* Farm v6 ist deployed.

```bash theme={null}
solana config set --url https://api.devnet.solana.com
solana airdrop 2
```

Das SDK unterstützt Devnet über `cluster: "devnet"`:

```ts theme={null}
const raydium = await Raydium.load({ connection, owner, cluster: "devnet" });
```

**Warnung**: Devnet-Pools haben geringe Liquidität und können veraltete State haben. Verlassen Sie sich nicht auf Devnet für Price Discovery; nutzen Sie es nur zum Bauen und Testen von Instructionen.

### Localnet mit gegabeltem Mainnet-State

Für realistisches Testen können Sie den Mainnet-State in einen lokalen Validator forken:

```bash theme={null}
solana-test-validator \
  --url https://api.mainnet-beta.solana.com \
  --clone CPMMoo8L3F4NbTegBCKVNunggL7H1Zpdmwpwh8KMoZ0F \
  --clone CAMMCzo5YL8w4VFF8KVHrK22GGUsp5VTaW7grrKgrWqK \
  --clone <SOME_POOL_ID> \
  --clone <SOME_MINT_ID>
```

Dies klont spezifischen Program- und Account-State zu localhost, wo Sie frei transagieren können. Ideal für:

* Unit-Tests Ihrer CPI-Integration gegen ein echtes Raydium-Programm.
* Wiedergabe einer Transaktion mit modifiziertem Parameter zum Debuggen.
* Stress-Tests mit großen synthetischen Volumina.

Raydiums Team nutzt gegabelte Localnet-Umgebungen umfangreich für Regressionstests vor Mainnet-Deployment.

## Projekt-Templates

### TypeScript-Integrations-Starter

```
my-raydium-app/
├── package.json
├── tsconfig.json
├── src/
│   ├── swap.ts           # Swap-Beispiel
│   ├── add-liquidity.ts
│   └── read-pool.ts
└── .env                  # RPC URL, Wallet-Pfad
```

Minimales `package.json`:

```json theme={null}
{
  "name": "my-raydium-app",
  "type": "module",
  "scripts": { "swap": "tsx src/swap.ts" },
  "dependencies": {
    "@raydium-io/raydium-sdk-v2": "^0.2.42-alpha",
    "@solana/web3.js": "^1.95",
    "@solana/spl-token": "^0.4"
  },
  "devDependencies": {
    "@types/node": "^20",
    "tsx": "^4",
    "typescript": "^5"
  }
}
```

### Anchor CPI-Programm-Starter

```
my-raydium-cpi/
├── Anchor.toml
├── Cargo.toml
├── programs/
│   └── my-cpi/
│       ├── Cargo.toml
│       └── src/lib.rs
└── tests/
    └── my-cpi.ts
```

Mit Anchor 0.30:

```bash theme={null}
anchor init my-raydium-cpi
cd my-raydium-cpi
# raydium-cp-swap zu Cargo.toml mit features = ["cpi"] hinzufügen
anchor build
anchor test
```

## Nützliche CLI-Dienstprogramme

### `solana-keygen`

```bash theme={null}
solana-keygen new --outfile ./wallet.json          # Schlüssel generieren
solana-keygen pubkey ./wallet.json                 # Öffentlichen Schlüssel anzeigen
```

### Einen beliebigen Account lesen

```bash theme={null}
solana account <ADDRESS> --output json-compact
```

Nützlich, um den Pool-State ohne Decoder zu überprüfen.

### Programm-Logs

```bash theme={null}
solana logs | grep CPMMoo8                         # CPMM-bezogene Tx-Logs verfolggen
```

### Transaktions-Inspektionen

```bash theme={null}
solana confirm <TX_SIGNATURE> -v                   # Pretty-gedruckte Logs
```

Oder über [explorer](https://explorer.solana.com) — geben Sie die Signatur ein und sehen Sie sich die Registerkarte „Program Logs" an.

## Umgebungs-Hygiene

### Getrennte Wallets pro Zweck

* **Entwicklungs-Wallet**: hält Testnet-SOL, wird zum Bauen verwendet.
* **Produktions-Wallet**: hält echte SOL, wird nur für Deploys/Multisig-Submissions verwendet.
* **Hot Wallet für Bots**: kleines Guthaben, eingeschränkte Berechtigungen.

Schlüssel sollten niemals im Code festgeschrieben werden. Nutzen Sie Umgebungsvariablen oder Secret Manager.

### `.env`-Muster

```
# .env (nicht committed)
SOLANA_RPC_URL=https://mainnet.helius-rpc.com/?api-key=...
WALLET_PATH=/Users/you/.config/solana/id.json
```

```ts theme={null}
import { config } from "dotenv";
config();

const connection = new Connection(process.env.SOLANA_RPC_URL!);
```

### Versionsfestlegung

Sperren Sie alle Solana-Ökosystem-Abhängigkeiten. Das Ökosystem entwickelt sich schnell; eine Minor-Version-Bumps von `@solana/web3.js` hat bereits zu Breaking Changes geführt. Nutzen Sie `package-lock.json` / `Cargo.lock` gewissenhaft.

## Verweise

* [`sdk-api/typescript-sdk`](/de/sdk-api/typescript-sdk) — TypeScript SDK-Referenz.
* [`sdk-api/rust-cpi`](/de/sdk-api/rust-cpi) — Rust CPI-Nutzung.
* [`sdk-api/python-integration`](/de/sdk-api/python-integration) — Python-Setup.
* [`solana-fundamentals/programs-and-anchor`](/de/solana-fundamentals/programs-and-anchor) — Anchor-Hintergrund.

Quellen:

* [Solana install docs](https://docs.solana.com/cli/install-solana-cli-tools).
* [Anchor book: getting started](https://book.anchor-lang.com/getting_started/installation.html).
* [Raydium SDK v2 repo](https://github.com/raydium-io/raydium-sdk-V2).
