Skip to main content
All DeFi operations are real and irreversible. This skill requires explicit user confirmation before every destructive operation. Never auto-execute transactions.

Overview

The chainstream-defi skill handles on-chain DeFi execution across Solana, BSC, and Ethereum. It covers DEX token swaps, launchpad token creation, and signed transaction broadcasting.
  • Pattern: Process (destructive, requires signing)
  • CLI: npx @chainstream-io/cli (primary execution path)
  • SDK: @chainstream-io/sdk with WalletSigner
  • MCP: Quote, swap, and create tools available — but on-chain execution requires wallet-backed authentication on the host side

Wallet Requirements

DeFi operations require a wallet capable of signing transactions:

Four-Phase Protocol

Every destructive DeFi operation follows a strict four-phase protocol:

Phase 1: Quote

Get a price quote before any execution. This is read-only and safe.

Phase 2: User Confirmation

Mandatory. Present the quote summary to the user and wait for explicit approval:
  • Input amount and token
  • Expected output amount
  • Price impact and fees
  • Slippage tolerance

Phase 3: Sign and Send

After confirmation, execute the swap. The CLI handles signing via the configured wallet.

Phase 4: Poll Job

The CLI automatically polls the job until completion and outputs the transaction hash with an explorer link.

Supported Operations

Token Swap

Token Creation (Launchpad)

Job Status

Block Explorers

After a successful transaction, the CLI outputs an explorer link:

Currency Resolution

Common token identifiers:

Safety Rules

These rules are non-negotiable and enforced by the skill.

Error Recovery

Research Before Trading

Always use chainstream-data to research before executing DeFi operations:

chainstream-data

Research tokens before trading

chainstream-graphql

Deep-dive analytics via custom GraphQL

CLI Commands

Full CLI command reference