{"id":31037089,"url":"https://github.com/0xfnzero/pumpfun-sdk","last_synced_at":"2025-09-14T04:48:57.079Z","repository":{"id":294164457,"uuid":"986113792","full_name":"0xfnzero/pumpfun-sdk","owner":"0xfnzero","description":null,"archived":false,"fork":false,"pushed_at":"2025-05-19T06:27:08.000Z","size":238,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-19T07:32:45.939Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/0xfnzero.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-19T06:10:33.000Z","updated_at":"2025-05-19T07:22:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"3bf6f817-e55b-4fe0-99b1-0bd2c03a2a14","html_url":"https://github.com/0xfnzero/pumpfun-sdk","commit_stats":null,"previous_names":["0xfnzero/pumpfun-sdk"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/0xfnzero/pumpfun-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xfnzero%2Fpumpfun-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xfnzero%2Fpumpfun-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xfnzero%2Fpumpfun-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xfnzero%2Fpumpfun-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/0xfnzero","download_url":"https://codeload.github.com/0xfnzero/pumpfun-sdk/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xfnzero%2Fpumpfun-sdk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275062957,"owners_count":25398888,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-14T02:00:10.474Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-09-14T04:48:52.125Z","updated_at":"2025-09-14T04:48:57.071Z","avatar_url":"https://github.com/0xfnzero.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PumpFun Rust SDK\n\n[中文](https://github.com/0xfnzero/pumpfun-sdk/blob/main/README_CN.md) | [English](https://github.com/0xfnzero/pumpfun-sdk/blob/main/README.md) | [Telegram](https://t.me/fnzero_group) | [Discord](https://discord.gg/3At4eaUt)\n\nA comprehensive Rust SDK for seamless interaction with the PumpFun Solana program. This SDK provides a robust set of tools and interfaces to integrate PumpFun functionality into your applications.\n\n\n# Explanation\n1. Add `create, buy, sell` for pump.fun.\n2. Add `logs_subscribe` to subscribe the logs of the PumpFun program.\n3. Add `yellowstone grpc` to subscribe the logs of the PumpFun program.\n4. Add `jito` to send transaction with Jito.\n5. Add `nextblock` to send transaction with nextblock.\n6. Add `0slot` to send transaction with 0slot.\n7. Submit a transaction using Jito, Nextblock, and 0slot simultaneously; the fastest one will succeed, while the others will fail. \n\n## Usage\n```shell\ncd `your project root directory`\ngit clone https://github.com/0xfnzero/pumpfun-sdk\n```\n\n```toml\n# add to your Cargo.toml\npumpfun-sdk = { path = \"./pumpfun-sdk\", version = \"2.4.3\" }\n```\n\n### logs subscription for token create and trade  transaction\n```rust\nuse pumpfun_sdk::{common::logs_events::PumpfunEvent, grpc::YellowstoneGrpc};\n\n// create grpc client\nlet grpc_url = \"http://127.0.0.1:10000\";\nlet client = YellowstoneGrpc::new(grpc_url);\n\n// Define callback function\nlet callback = |event: PumpfunEvent| {\n    match event {\n        PumpfunEvent::NewToken(token_info) =\u003e {\n            println!(\"Received new token event: {:?}\", token_info);\n        },\n        PumpfunEvent::NewDevTrade(trade_info) =\u003e {\n            println!(\"Received dev trade event: {:?}\", trade_info);\n        },\n        PumpfunEvent::NewUserTrade(trade_info) =\u003e {\n            println!(\"Received new trade event: {:?}\", trade_info);\n        },\n        PumpfunEvent::NewBotTrade(trade_info) =\u003e {\n            println!(\"Received new bot trade event: {:?}\", trade_info);\n        }\n        PumpfunEvent::Error(err) =\u003e {\n            println!(\"Received error: {}\", err);\n        }\n    }\n};\n\nlet payer_keypair = Keypair::from_base58_string(\"your private key\");\nclient.subscribe_pumpfun(callback, Some(payer_keypair.pubkey())).await?;\n```\n\n### Init pumpfun instance for configs\n```rust\nuse std::sync::Arc;\nuse pumpfun_sdk::{common::{Cluster, PriorityFee}, PumpFun};\nuse solana_sdk::{commitment_config::CommitmentConfig, signature::Keypair, signer::Signer};\n\nlet priority_fee = PriorityFee{\n    unit_limit: 190000,\n    unit_price: 1000000,\n    buy_tip_fee: 0.001,\n    sell_tip_fee: 0.0001,\n};\n\nlet cluster = Cluster {\n    rpc_url: \"https://api.mainnet-beta.solana.com\".to_string(),\n    block_engine_url: \"https://block-engine.example.com\".to_string(),\n    nextblock_url: \"https://nextblock.example.com\".to_string(),\n    nextblock_auth_token: \"nextblock_api_token\".to_string(),\n    zeroslot_url: \"https://zeroslot.example.com\".to_string(),\n    zeroslot_auth_token: \"zeroslot_api_token\".to_string(),\n    use_jito: true,\n    use_nextblock: false,\n    use_zeroslot: false,\n    priority_fee,\n    commitment: CommitmentConfig::processed(),\n};\n\n// create pumpfun instance\nlet payer = Keypair::from_base58_string(\"your private key\");\nlet pumpfun = PumpFun::new(\n    Arc::new(payer), \n    \u0026cluster,\n).await;\n```\n\n### pumpfun buy token\n```rust\nuse pumpfun_sdk::PumpFun;\nuse solana_sdk::{native_token::sol_to_lamports, signature::Keypair, signer::Signer};\n\n// create pumpfun instance\nlet pumpfun = PumpFun::new(Arc::new(payer), \u0026cluster).await;\n\n// Mint keypair\nlet mint_pubkey: Keypair = Keypair::new();\n\n// buy token with tip\npumpfun.buy_with_tip(mint_pubkey, 10000, None).await?;\n\n```\n\n### pumpfun sell token\n```rust\nuse pumpfun_sdk::PumpFun;\nuse solana_sdk::{native_token::sol_to_lamports, signature::Keypair, signer::Signer};\n\n// create pumpfun instance\nlet pumpfun = PumpFun::new(Arc::new(payer), \u0026cluster).await;\n\n// sell token with tip\npumpfun.sell_with_tip(mint_pubkey, 100000, None).await?;\n\n// sell token by percent with tip\npumpfun.sell_by_percent_with_tip(mint_pubkey, 100, None).await?;\n\n```\n\n### Telegram group:\nhttps://t.me/fnzero_group\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xfnzero%2Fpumpfun-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F0xfnzero%2Fpumpfun-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xfnzero%2Fpumpfun-sdk/lists"}