Skip to content

The sponsored-reserves minimum-balance formula wrongly adds liabilities.selling #2771

Closed

Description

@kalepail

Note

Automated notice: Stellar Raven filed this issue from its automated evaluation pipeline. The issue includes evidence and a public source record. Please verify the live surface before you act.

Finding

The sponsored-reserves guide states this minimum-balance formula under "Effect
on minimum balance":

(2 base reserves + numSubEntries + numSponsoring - numSponsored) * baseReserve + liabilities.selling

The + liabilities.selling term is wrong for minimum balance.

Stellar Core computes the two values separately. getMinBalance in
src/transactions/TransactionUtils.cpp sums 2, numSubentries, and
numSponsoring, subtracts numSponsored, and multiplies by baseReserve.
Selling liabilities are not a factor. getAvailableBalance then subtracts
sellingLiabilities from the balance after it subtracts the minimum balance,
for protocol V_10 and later.

Selling liabilities therefore reduce the spendable balance. They do not raise
the minimum balance.

The Lumens page on the same site explains minimum balance without any
liabilities term. The two official pages give different formulas for the same
quantity.

A reader who follows the sponsored-reserves formula overstates the minimum
balance whenever the account has open sell offers. Any client that reproduces
the formula rejects valid transactions.

Evidence

The live page reads and the Core source lookup ran on 2026-08-14.

The Core lookup named the exact file, src/transactions/TransactionUtils.cpp,
and the exact protocol boundary, V_9 for the entry count and V_10 for the
selling-liability subtraction.

Additional recorded evidence:

Recommendation

Remove + liabilities.selling from the minimum-balance formula on the
sponsored-reserves page. The corrected formula is:

(2 + numSubEntries + numSponsoring - numSponsored) * baseReserve

Add one separate sentence for spendable balance:

available balance = balance - minimum balance - liabilities.selling

Use the same two-part split on the Lumens page so both pages state one
definition of each quantity.

Source Record

Raven recorded this finding as sd-043 (stellar-docs, discovered 2026-08-14).

Public source record: improvements/stellar-docs/sd-043-sponsored-reserves-min-balance-liabilities.md

Immutable source snapshot: dbc466e55105

Resolution Handoff

When you deploy a fix, link the resolving issue or pull request to the source record.
Then notify Raven through:

https://github.com/stellar-experimental/stellar-raven/issues/new?template=upstream-improvement-ready.yml&title=%5Bupstream-ready%5D%20sd-043%3A%20

Include the finding ID and the resolving issue or pull request.
Include the deployed version or timestamp. Include the smallest live recheck.
Raven verifies the live surface before it sets the finding to fixed-upstream.
An issue closure or merged pull request does not prove the fix.
A separate reviewer repeats the live check before Raven retires the active finding.
Raven keeps a commit-pinned snapshot when one is available.

Activity

  1. added
    raven
    on Aug 19, 2026
  2. ElliotFriend commented on Sep 8, 2026

    @ElliotFriend
    Contributor

    Deployed and handed back to Raven for independent recheck: stellar-experimental/stellar-raven#131

    Fixed by #2806 (merge commit ad0accbd, 2026-09-08T15:05:25Z), deploy succeeded 15:10:43Z, corrected content observed live at 2026-09-08T15:37:28Z. All three parts of the recommendation shipped: + liabilities.selling is out of the minimum-balance formula, the available balance = balance - minimum balance - liabilities.selling identity is stated, and lumens.mdx now words the split identically, so the two pages give one definition of each quantity.

    The finding's reading of getMinBalance and getAvailableBalance was re-verified against stellar-core directly before the change and held up.

  3. kalepail commented on Sep 8, 2026

    @kalepail
    ContributorAuthor

    Raven independently rechecked sd-043 on 2026-09-08 and confirmed the original trigger is resolved live.

    Live recheck: 2026-09-08T15:50:00Z rendered Sponsored Reserves and Lumens pages matched the corrected minimum-balance formula and separate available-balance identity; stellar-core 7e64393b independently confirmed the same split.

    The active finding is being retired under the ephemeral improvements lifecycle. Immutable source snapshot: https://github.com/stellar-experimental/stellar-raven/blob/767c981a9304bd74b167357ffdf9a39dd017cce4/improvements/stellar-docs/sd-043-sponsored-reserves-min-balance-liabilities.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    raven

    Type

    No type

    Projects

    • Status
      No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions