Important
This software is open-source & free of any charge, there are no fees, nor ads included in the repo.
Consider feeding the Cobra if the project comes useful.
Wallet: FL4CKfetEWBMXFs15ZAz4peyGbCuzVaoszRKcoVt3WfC
Read the Cobra Documentation
Supported Solana Markets:
- Raydium CLMM
- Meteora DLMM
- PumpFun
- PumpSwapAMM
- MeteoraDAMM v1
- MeteoraDAMM v2
- Meteora Dynamic Bonding Curve
- Raydium CPMM
- Raydium AMM V4
- Raydium Launchlab
Cobra composes of 3 parts:
- CobraRouter
- CobraNET (Optional)
- CobraWallets (Optional)
and a CLI, a Command Line Interface wrapper around CobraRouter and CobraWallets:
Check out How to run CLI
After setting up Cobra properly, the features are:
- Generating Wallets, Grinding Custom Wallets
- Buying, selling on supported markets (& in Pump.fun AMM - creating new pools)
- Detecting mint's market and pool address
- Fetching pool's states/ keys (for developers)
- Interfacing with supported markets using available methods (for developers)
$ git clone https://github.com/FLOCK4H/Cobra
$ pip install -r req.txt
🖱️ I am a developer
2. Install CobraRouter module:
$ cd CobraRouter
$ pip install .from CobraRouter.detect import CobraDetector
from CobraRouter.router import Router
import asyncio
from solana.rpc.async_api import AsyncClient
import aiohttp
async def main():
client = AsyncClient("https://api.apewise.org/rpc?api-key=")
session = aiohttp.ClientSession()
router = Router(client, session)
detector = CobraDetector(router, "https://api.apewise.org/rpc?api-key=")
detect = await detector._detect("9R1pCPM7GRr9F4gk978LqBQiPKfYStbZKc5iKV4imoon")
print(detect)
await client.close()
await session.close()
await router.close()
if __name__ == "__main__":
asyncio.run(main())Example output:
PS C:\Users\swear\Desktop> python .\test.py
BMBcZ9GWMCi9HaCE7BagrLxakzffy6fAGdEpihLRfVPw
[CobraRouter] Route winner (?): 675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8 -> BMBcZ9GWMCi9HaCE7BagrLxakzffy6fAGdEpihLRfVPw
('675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8', 'BMBcZ9GWMCi9HaCE7BagrLxakzffy6fAGdEpihLRfVPw')Learn how to interact with the library: Cobra Documentation
🖱️ I am a trader
Required variables are:
RUN_AS_CLI,HTTP_RPC, andPRIVATE_KEY.
Helius can be free tier.
Current fastest HTTP RPC Provider: Apewise
Create or edit secrets.env file; Here you can control SLIPPAGE, which is 1..100 range, and PRIORITY_FEE_LEVEL which is a String and options are: low, medium, high, turbo.
RUN_AS_CLI=True
HTTP_RPC="https://api.apewise.org/rpc?api-key=" # apewise.org -> fastest right now
# CLI CONFIG SECTION
PRIVATE_KEY=2wY3abcde5Pj4xxxxxxxxxxxxxxxxxxxxxxxxxxxx
SLIPPAGE=30
PRIORITY_FEE_LEVEL="high" # "low", "medium", "high", "turbo"
$ python main.py
CobraNET is an optional Telegram wrapper around the CobraRouter and CobraWallets, and allows you to host your own Dex Router via Telegram Bot.
Create secrets.env where you run the application, make sure to set:
secrets.env
RUN_AS_CLI=False
BOT_TOKEN=TELEGRAM_BOT_TOKEN_FROM_BOTFATHER
HTTP_RPC="https://api.apewise.org/rpc?api-key=" # apewise.org -> fastest right now
HELIUS_API_KEY="your-helius-free-or-not-api-key"
For database operations you will need PostgreSQL installed: PostgreSQL
Initialize the database:
$ cd Cobra
$ python database.py
Run the Cobra with Telegram support:
$ python main.py
Test your bot by entering /start inside the conversation.
Learn more about CobraNET here: Cobra Documentation
Discord: FLOCK4H.CAVE, Telegram: FLOCK4H.CAVE
Telegram private handle: @dubskii420
Copyright 2025 FLOCK4H
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
