Skip to main content
The dynamic-bonding-curve repository includes a Rust crate at dynamic-bonding-curve-sdk. It depends on the on-chain dynamic-bonding-curve crate and reuses program state and math types.

Install

Use the crate from the local workspace or a pinned Git revision:
For local development inside the program repository:

What It Provides

The crate is useful for Rust services, quote engines, tests, and keepers that already decode VirtualPool and PoolConfig accounts.

Quote Inputs

All three quote helpers require current pool and config state:

Exact-In Quote

Use this for swap2 exact-in mode, then apply your slippage policy before building the transaction.

Exact-Out Quote

Exact-out quotes return the input amount required to receive out_amount. Apply a maximum input bound before sending the transaction.

Partial-Fill Quote

Partial fill is useful when the pool is close to migration_quote_threshold and a full exact-in swap might cross the migration boundary.

Return Data

SwapResult2 contains the values needed by quote engines and transaction builders:

Tests

The Rust crate includes tests for exact-out and partial-fill behavior, plus binary fixtures for configs and pools with quote-token and both-token fee modes.