An open API service indexing awesome lists of open source software.

https://github.com/al-the-bot-father/meteora_dbc_py

Meteora Dynamic Bonding Curve (DBC) with Python
https://github.com/al-the-bot-father/meteora_dbc_py

bonding bonding-curve curve dynamic meteora meteora-dbc python solana swap

Last synced: 2 months ago
JSON representation

Meteora Dynamic Bonding Curve (DBC) with Python

Awesome Lists containing this project

README

          

# meteora_dbc_py

Python library to trade on Meteora Dynamic Bonding Curve (DBC).

```
pip install solana==0.36.1 solders==0.23.0
```

Updated: 8/4/2025

# Contact

My Telegram: https://t.me/AL_THE_BOT_FATHER

bot_mafia

# Instructions

Clone the repo and use example_buy.py or example_sell.py.

**If you can - please support my work and donate to: 3pPK76GL5ChVFBHND54UfBMtg36Bsh1mzbQPTbcK89PD**

# FAQS

**What format should my private key be in?**

The private key should be in the base58 string format, not bytes.

**Why are my transactions being dropped?**

You get what you pay for. Don't use the main-net RPC, just spend the money for Helius or Quick Node.

**How do I change the fee?**

Modify the unit_budget and unit_price values.

**Does this code work on devnet?**

No.

# Example

```
from solana.rpc.api import Client
from solders.keypair import Keypair # type: ignore

from pool_utils import fetch_pool_from_rpc
from meteora_dbc import buy

# Configuration
priv_key = "base58_priv_str_here"
rpc = "rpc_url_here"
mint_str = "meteora_dbc_address"
sol_in = 0.01
unit_budget = 100_000
unit_price = 1_000_000

# Initialize client and keypair
client = Client(rpc)
payer_keypair = Keypair.from_base58_string(priv_key)

# Fetch pool and execute buy
pool_str = fetch_pool_from_rpc(client, mint_str)

if pool_str:
buy(client, payer_keypair, pool_str, sol_in, unit_budget, unit_price)
else:
print("No pool address found...")
```

```
from solana.rpc.api import Client
from solders.keypair import Keypair # type: ignore

from pool_utils import fetch_pool_from_rpc
from meteora_dbc import sell

# Configuration
priv_key = "base58_priv_str_here"
rpc = "rpc_url_here"
mint_str = "meteora_dbc_address"
percentage = 100
unit_budget = 100_000
unit_price = 1_000_000

# Initialize client and keypair
client = Client(rpc)
payer_keypair = Keypair.from_base58_string(priv_key)

# Fetch pool and execute sell
pool_str = fetch_pool_from_rpc(client, mint_str)

if pool_str:
sell(client, payer_keypair, pool_str, percentage, unit_budget, unit_price)
else:
print("No pool address found...")
```