Commit Graph

256 Commits

Author SHA1 Message Date
dependabot[bot] 4290b54f31 build(deps): bump aiohttp in the uv group across 1 directory (#164)
---
updated-dependencies:
- dependency-name: aiohttp
  dependency-version: 3.13.4
  dependency-type: direct:production
  dependency-group: uv
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-12 22:11:50 +02:00
smypmsa 02692793a9 docs: add cli and skill links 2026-03-20 18:56:23 +00:00
smypmsa 73fe95efe4 docs: mention OpenClaw in pumpclaw ecosystem note
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-20 18:52:56 +00:00
smypmsa f8eb5eb8a0 docs: add ecosystem links to pumpfun-cli and pumpclaw
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-20 18:51:54 +00:00
Anton Sauchyk 546b94af6f fix(examples): add bonding_curve_v2 to learning examples (#160)
* fix(examples): add bonding_curve_v2 remaining account to learning examples

Add the required bonding_curve_v2 PDA as a remaining account to buy/sell
instructions in manual_buy, manual_sell, mint_and_buy, and mint_and_buy_v2
learning examples, matching the pump.fun program upgrade.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(examples): add bonding_curve_v2 to manual_buy_geyser and manual_buy_cu_optimized

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 23:54:18 +01:00
Anton Sauchyk 4a48f545c1 feat(pumpfun): update IDLs and add bonding_curve_v2 + cashback support (#159)
Update all 3 pump.fun IDL files (pump_fun, pump_swap, pump_fees) with
new cashback rewards and fee-sharing features. Fix IDL parser to handle
tuple struct types (OptionBool). Add bonding_curve_v2 remaining account
to all buy/sell instructions as required by the pump.fun program upgrade.

Key changes:
- Fix IDL parser crash on tuple struct fields (string vs dict)
- Add bonding_curve_v2 PDA derivation and append as remaining account
- Add is_cashback_coin field to TokenInfo and BondingCurve decoding
- Propagate is_cashback_enabled from CreateEvent/create_v2 to TokenInfo
- Conditionally include user_volume_accumulator for cashback sell txs

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 23:39:52 +01:00
Anton Sauchyk 0b6779ca34 Fix buy/sell transactions silently failing on-chain (#157)
* fix(core): disable account_data_size limit and add meta.err checking

The 12.5MB setLoadedAccountsDataSizeLimit was causing all buy transactions
to fail with MaxLoadedAccountsDataSizeExceeded since pump.fun migrated to
Token-2022. Transactions landed on-chain (fees paid) but inner instructions
were rejected — the bot paid gas for nothing.

Changes:
- Disable account_data_size in all bot configs (Token-2022 needs >12.5MB)
- Add meta.err check in get_buy_transaction_details() for clear error
  reporting when transactions fail on-chain
- Include tx signature in platform_aware.py error messages for debugging

Tested: full buy→sell→cleanup cycle works on pump_fun with geyser listener.


* fix(core): check meta.err in confirm_transaction to detect failed txs

Solana transactions can be "confirmed" (included in a block) but still
fail execution if inner program instructions are rejected. Previously,
confirm_transaction only checked that the tx landed on-chain, causing
silent failures in buy, sell, and cleanup operations.

Now fetches the transaction result after confirmation and checks
meta.err, returning False when the transaction failed. This fixes
the ATA cleanup issue where sells were silently failing with
Custom: 6003 errors, leaving non-zero token balances.


* fix(core): treat failed tx fetch as unconfirmed in confirm_transaction

When _get_transaction_result returns None (RPC failure, timeout, etc.),
the function was falling through to return True — silently treating an
unknown state as success. Now returns False with a warning log.

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 10:37:04 +01:00
dependabot[bot] c5b0161d05 build(deps): bump the uv group across 1 directory with 2 updates (#156)
---
updated-dependencies:
- dependency-name: aiohttp
  dependency-version: 3.13.3
  dependency-type: direct:production
  dependency-group: uv
- dependency-name: protobuf
  dependency-version: 6.33.5
  dependency-type: direct:production
  dependency-group: uv
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-17 10:20:46 +01:00
Alex Kuligowski 40ad32b8d0 feat(core): add RPC rate limiting and retry handling (#154)
* feat(core): add RPC rate limiting, retry logic, and 429 handling

Addresses #44 — users on free-tier RPC endpoints hit HTTP 429 errors
during buy transactions due to no rate limiting or retry handling.

- Add TokenBucketRateLimiter (new file: src/core/rpc_rate_limiter.py)
- Gate all RPC methods through rate limiter (both post_rpc and solana-py calls)
- Rewrite post_rpc() with retry loop, exponential backoff, jitter, and
  specific 429 detection with Retry-After header support
- Replace per-call aiohttp session with shared persistent session
- Wire node.max_rps from YAML bot config through to SolanaClient
- Fix cleanup manager and learning example to use SolanaClient abstraction
  instead of bypassing it via get_client()

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(core): address CodeRabbitAI review feedback on rate limiting PR

Validate max_rps > 0 in TokenBucketRateLimiter to prevent ZeroDivisionError
and infinite loops with fractional values. Add asyncio.Lock to _get_session
to fix race condition, handle non-numeric Retry-After headers gracefully,
replace dead json.JSONDecodeError with aiohttp.ContentTypeError, and combine
burn+close into a single transaction in cleanup example.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* docs: document RPC rate limiting feature in README

- Add section on built-in RPC rate limiting with token bucket algorithm
- Document configurable max RPS and automatic retry logic
- Update roadmap to mark "Configurable RPS" as completed
- Clarify benefits of rate limiting for provider compliance

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* fix: use math.ceil for burst_size to handle fractional max_rps

- Replace int(max_rps) with math.ceil(max_rps) in burst_size calculation
- Prevents infinite loop when max_rps < 1.0 (e.g., 0.5 RPS would result in burst_size=0)
- Ensures burst_size is always at least 1 for valid fractional rates
- Addresses CodeRabbit feedback on rpc_rate_limiter.py:27

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* fix(core): validate burst_size and fix table pipe consistency

Address remaining CodeRabbitAI review feedback: add burst_size
validation guard, fix TRY003 lint (use msg variable for ValueError),
break long line under 88 chars, and fix MD055 table pipe style in README.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(core): separate 429 retry budget from error retries in post_rpc

429 responses no longer count against max_retries — they use a dedicated
max_429_retries counter (default 10) so free-tier users hitting rate
limits won't exhaust retries prematurely. Also refresh the aiohttp
session inside the retry loop to avoid stale references after network
failures, and fix cleanup log message accuracy.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Anton Sauchyk <antonsauchyk@gmail.com>
2026-02-17 10:02:11 +01:00
Anton Sauchyk 31955103dc feat: add Windows compatibility for uvloop dependency (#155)
Fixes chainstacklabs/pumpfun-bonkfun-bot#152

Changes:
- Make uvloop optional with platform-specific markers (Unix only)
- Add winloop as Windows alternative for performance optimization
- Update code to gracefully fall back to standard asyncio when event loop
  libraries are unavailable
- Both bot_runner.py and universal_trader.py now detect platform and use
  appropriate event loop implementation

This resolves the blocking installation issue for Windows users while
maintaining performance benefits on all platforms. Windows users can now
install and run the bot with winloop for improved performance, or use
standard asyncio as fallback.

Related: https://github.com/smypmsa/gh-triage-reports/blob/main/issues/chainstacklabs-pumpfun-bonkfun-bot/issue-152-2026-02-08.md

Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-09 16:58:24 +04:00
Anton Sauchyk 9d93d859a8 Reduce RPC delays when selling (#150)
* feat(trading): enhance sell execution with token amount and price parameters to reduce RPC delays

* feat(trading): add method to fetch actual token balance after transaction to improve accuracy

* feat(trading): update account data size limit and enhance price calculations
2025-11-23 12:02:29 +01:00
Anton Sauchyk 03a4e7bcbc Add mayhem mode support and Token2022 integration (#149)
* feat: mayhem update in idl

* feat(examples): update bonding curve scripts

* feat(example): update listen_blocksubscribe

* feat(examples): update geyser listener

* feat(examples): update all new token listeners

* feat(examples): add comments, fix printing, formatting

* feat(examples): pumpswap buy and sell update with mayhem mode

* fix(examples): sell pump amm fee recipient

* feat(examples): update decode scripts

* feat(examples): update fetch price

* feat(examples): buy and sell bonding curve scripts

* feat(examples): add mint with mayhem mode enabled

* feat(examples): improve listening to wallet txs

* feat(examples): migration listener improvements

* feat(examples): global vol accumulator is not writable

* feat(examples): support token/token2022 programs in buy instructions

* feat(examples): token/token2022 for pumpswap buy

* feat(examples): token/token2022 supprot for sell instructions

* feat(bot): support create_v2 with token2022, mayhem mode, other fixes

* fix(bot): support only token2022 in logs and pumportal listeners

* feat(bot): token2022 support in cleanup flow

* fix(bot): update token program handling and improve price validation in trading logic

* feat(bot): enhance token program handling for LetsBonk integration
2025-11-18 13:09:37 +01:00
Anton Sauchyk 7ae8b560bd feat(pumpswap): update pool account to writable for buy/sell instructions (#146) 2025-11-04 17:06:22 +01:00
Anton Sauchyk b6928d1f5f feat(core): integrate account data size limit (#144)
* feat(core): integrate account data size limit in buyer and seller transaction

* refactor: format code for improved readability and consistency
2025-10-28 21:21:21 +01:00
smypmsa ec6d58665d docs(examples): update comments for cu optimization in manual buy script 2025-10-27 22:06:40 +00:00
smypmsa 3f20649d0e fix(examples): clarify cu optimized buy script 2025-10-27 22:01:13 +00:00
Anton 8367611ed7 feat(example): add pump buy script with compute unit optimization (#143) 2025-10-27 00:21:56 +01:00
Anton 68cac87aad Fix/update letsbonk fun instructions in the bot (#142)
* feat(core): support multiple initialize instruction variants in LetsBonkEventParser

* feat(core): add creator and platform fee vault derivation methods and update account handling in buy/sell instructions

* feat(letsbonk): add global_config and platform_config to TokenInfo and update address provider logic
2025-10-26 16:21:58 +01:00
Anton 7377e1757e docs: add info about geyser plugin 2025-10-26 14:27:35 +01:00
Anton d64b51da44 fix(examples): mint and buy script (#141)
* fix(examples): remove hardcoded token mints

* feat(core): update pump idls

* feat(examples): add track volume bool to mint script

* feat(examples): add extend acc instr to mint
2025-10-25 15:01:04 +02:00
Anton 25c376dd02 Feat/letsbonk examples (#140)
* feat: update letsbonk idl

* feat: add letsbonk examples
2025-10-22 00:20:30 +02:00
Anton e97e2f2d35 Merge pull request #135 from BSmick6/fix/add-build-system
build: Add build-system to install project scripts
2025-10-04 14:42:03 +02:00
smypmsa 3fb0a9a549 feat(examples): listen and parse wallet txs 2025-09-23 20:27:22 +00:00
BSmick6 4fa4eef7dd build: Add build-system to install project scripts
This change adds the standard [build-system] table to pyproject.toml,
which allows entry points like 'pump_bot' to be installed correctly
with 'uv pip install -e .'.

This resolves the warning: 'Skipping installation of entry points
because this project is not packaged'.
2025-09-04 08:17:10 -04:00
smypmsa 9731b179cc feat(core): add configurable cu limits 2025-09-03 15:05:12 +00:00
smypmsa e1e15dd539 feat(pumpfun): add fee_config and fee_program, close #132 2025-08-29 15:21:36 +00:00
smypmsa bdb5da4a1f feat: update pump idls 2025-08-29 14:50:52 +00:00
Anton ecb6a515b1 Merge pull request #129 from chainstacklabs/add-agents-md
Add AGENTS.md
2025-08-21 12:04:41 +00:00
Ake 63b5b5c56d Add AGENTS.md 2025-08-21 09:21:44 +08:00
smypmsa eefd15a6b7 fix(examples): module path 2025-08-14 16:56:41 +00:00
smypmsa 0dc7c28499 feat(examples): add bonding curve geyser-buy example 2025-08-14 16:44:19 +00:00
smypmsa 0eb8811d78 chore(examples): remove hardcoded token mints 2025-08-14 10:00:19 +00:00
smypmsa f8e0414ee7 fix(core): handle block listener errors 2025-08-14 09:49:01 +00:00
smypmsa f061a75498 feat: updated IDL from pump fun (volume accumulators) 2025-08-14 08:11:24 +00:00
Anton 093331874b docs(readme): tiny typo 2025-08-11 08:55:13 +02:00
Ake 1a934f6ffd Update README.md 2025-08-11 14:37:16 +08:00
smypmsa 7f544e93f9 docs: add rules for cursor, kiro, windsurf 2025-08-11 05:50:45 +00:00
smypmsa 8ab8932168 docs(claude): add claude code rules 2025-08-11 05:35:25 +00:00
Ake f2efd56f81 Merge pull request #127 from chainstacklabs/feat/platform-abstraction
Refactor platform support, add letsbonk
2025-08-06 17:06:33 +08:00
smypmsa cb5c9ed1cd chore: pumpportal time based config example 2025-08-05 20:48:03 +00:00
smypmsa a9c58faf9e fix(pump): derive associated bonding curve 2025-08-05 20:30:41 +00:00
smypmsa 329266611c fix(core): minor fixes in hardcoded values 2025-08-05 20:19:00 +00:00
smypmsa 874d148777 fix(core): use logger exception 2025-08-05 16:09:05 +00:00
smypmsa 83a7f9e4ad docs(readme): add letsbonk, update commands 2025-08-05 15:18:22 +00:00
smypmsa 53763b7123 fix(core): remove unused args, improve logging 2025-08-05 14:56:59 +00:00
smypmsa 7e644286a8 fix(core): remove redundant kwargs 2025-08-05 14:53:53 +00:00
smypmsa 2c2306e80b fix(core): add missing method to event parser interface 2025-08-05 14:53:07 +00:00
smypmsa 3e82cfa128 fix(core): replace os with pathlib 2025-08-05 14:51:48 +00:00
smypmsa 80b03748b0 fix(core): refactor dataclass to use class vars 2025-08-05 14:44:06 +00:00
smypmsa a831cafaf4 fix(core) import level 2025-08-05 14:41:36 +00:00