Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.meteora.ag/llms.txt

Use this file to discover all available pages before exploring further.

The dbc-go SDK provides Go helpers for backend services, indexers, and scripts that need to read DBC state or build common DBC transactions.

Go SDK

Meteora DBC Go SDK source and examples.

Installation

Clone the repository and install dependencies. The local go.mod uses github.com/gagliardetto/solana-go.
git clone https://github.com/MeteoraAg/dbc-go.git
cd dbc-go
go mod tidy

Repository Map

PathUse
instructionsTransaction builders and readers for partner, pool, creator, and state-related flows.
mathCurve and safe math helpers.
commonProgram IDs, shared constants, and account types.
helpersAccount deserialization, PDA helpers, and common utilities.
examplesRunnable examples for pool creation, swaps, reads, fee claims, and creator transfer.

Run Examples

Before running examples, configure the keypairs, RPC endpoint, and public keys required by the file.
go run examples/<file-name>.go

Examples

ExampleUse
examples/create_pool_and_swap_sol.goCreate a pool and perform a SOL swap.
examples/create_pool_and_swap_usdc.goCreate a pool and perform a USDC swap.
examples/get_pool.goFetch virtual pool state.
examples/get_pool_config.goFetch config settings and curve parameters.
examples/get_bonding_curve_progress.goMonitor quote reserve progress toward migration.
examples/get_pool_fee_metrics.goRead pool fee metrics.
examples/claim_creator_trading_fee.goClaim accumulated creator trading fees.
examples/claim_partner_trading_fee.goClaim accumulated partner trading fees.
examples/transfer_pool_creator.goTransfer pool creator rights to a new address.

Helper Surface

HelperUse
helpers.DeserializePoolConfigDecode a PoolConfig account.
helpers.DeserializePoolDecode a VirtualPool account.
helpers.DeriveDbcPoolPDADerive a DBC pool PDA.
helpers.DeriveTokenVaultPDADerive DBC token vault PDAs.
helpers.DeriveEventAuthorityPDADerive the DBC event authority PDA.
helpers.DerivePoolAuthorityPDADerive the DBC pool authority PDA.
instructions.GetPoolConfigFetch and decode a pool config.
instructions.GetPoolFetch and decode a pool.
instructions.GetPoolFeeMetricsFetch pool fee metrics.