Skip to content

fix(trade): sell what a curve's real reserves can pay, explain buys past the curve - #28

Merged
smypmsa merged 1 commit into
v3-nextfrom
fix/curve-reserve-limits
Nov 8, 2026
Merged

smypmsa merged 1 commit into
v3-nextfrom
fix/curve-reserve-limits

Conversation

@smypmsa

@smypmsa smypmsa commented Nov 8, 2026

Copy link
Copy Markdown
Member

pump.fun prices a sell on the curve's virtual reserves but pays it out of its real reserves, and on some coins (mayhem mode) the two drift apart. A sell worth more than the real reserves reverted. sell now sells the most the curve can pay for and reports the rest as tokens_kept, or sends nothing (curve_short) when the curve can pay nothing. A buy that asks for more tokens than the curve has left now returns exceeds_curve with the tokens left, instead of the raw 6021 error.

Verified with unit tests and on surfpool: with a curve's real reserves lowered, the capped sell lands and one more token reverts with 6024.

…ast the curve

A sell larger than the curve's real reserves reverted; it now sells the most
they cover and reports the rest. A buy past the curve's remaining tokens now
says how many are left instead of a raw program error.

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

coderabbitai Bot commented Nov 8, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@smypmsa
smypmsa merged commit a5ad67a into v3-next Nov 8, 2026
6 checks passed
smypmsa added a commit that referenced this pull request Nov 9, 2026
* fix(migrate): pass the new pool's boost vault accounts to migrate_v2 (#27)

PumpSwap creates the pool's boost vault during the migration and reverts
without its authority and quote token account, which the IDL doesn't list.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* fix(trade): sell what a curve's real reserves can pay, explain buys past the curve (#28)

A sell larger than the curve's real reserves reverted; it now sells the most
they cover and reports the rest. A buy past the curve's remaining tokens now
says how many are left instead of a raw program error.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* feat: buy, sell and info for Raydium LaunchLab coins (#29)

A mint with no pump.fun curve is looked up on LaunchLab, under any launchpad's
platform config and any quote asset, with Token-2022 transfer fees counted.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* feat: trade graduated LaunchLab coins on Raydium CPMM (#30)

buy and sell follow a graduated LaunchLab coin to its CPMM pool, the way they
follow a pump.fun coin to PumpSwap; --force-amm covers both, and info shows
the pool.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* chore: release 0.3.0 (#31)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@smypmsa
smypmsa deleted the fix/curve-reserve-limits branch November 9, 2026 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant