Coda

Examples

Real-world implementations of Coda for Solana client generation

Learn from real-world implementations of Coda in production projects. These examples demonstrate different configuration approaches and use cases for generating TypeScript clients from Anchor IDLs.

Official Examples

Token Metadata Client

npm version npm downloads

View on GitHub →

The Token Metadata client showcases Coda's capabilities for a single program setup:

  • Single IDL configuration - Simple coda.config.mjs for one program
  • Custom PDAs - Adds program-derived addresses using Codama visitors
  • Production-ready - Pre-generated client for Metaplex Token Metadata
  • Type-safe operations - Full TypeScript support with proper typing

Perfect for projects that need to interact with a single Solana program or want to see how to configure custom PDAs and transformations.

Quarry Client

npm version npm downloads

View on GitHub →

The Quarry client demonstrates Coda's multi-program capabilities:

  • Multiple IDL handling - Uses glob patterns to process multiple IDLs
  • Workspace management - Generates clients for an entire protocol suite
  • Shared types - Manages dependencies between related programs
  • Modular structure - Organized output for complex protocol interactions

Ideal for protocol developers managing multiple interconnected programs or anyone building comprehensive DeFi integrations.

Kamino Lending Client

npm version npm downloads

View on GitHub →

The Kamino Lending client demonstrates Coda's ability to handle complex IDLs with overlapping account names:

  • Overlapping account names - Handles instructions with duplicate account names across nested structures
  • Automatic flattening - Intelligently flattens nested account groups to avoid naming conflicts
  • Complex DeFi protocol - Full lending protocol with deposit, withdraw, and liquidation operations
  • Production-scale IDL - Processes large IDL with numerous instructions and account types

This example is particularly useful for developers working with:

  • Complex DeFi protocols with nested account structures
  • IDLs that have evolved over time with naming inconsistencies
  • Programs requiring sophisticated account management patterns
  • Large-scale production protocols with intricate instruction sets

The Kamino Lending client showcases how Coda's automatic account flattening feature (via codama-instruction-accounts-dedupe-visitor) resolves naming conflicts that would otherwise cause compilation errors in generated TypeScript code.

Add Your Example

Using Coda in your project? We'd love to showcase it!

Submit a Pull Request → to add your project to this documentation.

How to Add Your Example

  1. Fork the Coda repository
  2. Edit this file at apps/docs/content/docs/examples.mdx
  3. Submit your PR with a clear description

Help the Solana developer community by sharing your Coda implementation!