Skip to content

[Certora] Net credit after pending fee stays constant#988

Open
jhoenicke wants to merge 11 commits into
mainfrom
certora-credit-nondecreasing
Open

[Certora] Net credit after pending fee stays constant#988
jhoenicke wants to merge 11 commits into
mainfrom
certora-credit-nondecreasing

Conversation

@jhoenicke

@jhoenicke jhoenicke commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

The net credit for a user is defined as credit - pendingFee after calling updateView (applying bad debt).

This spec file shows that this value is not affected by any operation except withdraw,take,liquidate.

For take and withdraw we show that other users do not affect the value.
For liquidate we show that the value is unaffected if no new bad debt occured (lossIndex unchanged).

We also prove that after maturity the pending fee is zero.

corresponding thread

The netCredit is the credit after updatePendingView minus all
future pending fees.  This value should never decrease as long
as the user is not actively trading on the market or withdrawing
the funds.

The only notable exception is a liquidate that causes bad debt,
so the rule for liquidate assumes no bad debt.
@jhoenicke jhoenicke mentioned this pull request Jun 15, 2026
73 tasks

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c9f4d1aa07

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread certora/specs/CreditNondecreasing.spec Outdated
Comment thread certora/specs/NetCredit.spec
Comment thread certora/specs/NetCredit.spec
@jhoenicke jhoenicke force-pushed the certora-credit-nondecreasing branch from c9f4d1a to 5e5c7d9 Compare June 15, 2026 16:37

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5e5c7d9969

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread certora/specs/NetCredit.spec
@jhoenicke jhoenicke changed the title [Certora] Net Credit Nondecreasing [Certora] Net credit after pending fee stays constant Jun 16, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 18981c0f6c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread certora/specs/NetCredit.spec
Comment thread certora/specs/CreditNondecreasing.spec Outdated
Comment thread certora/specs/CreditNondecreasing.spec Outdated
Comment thread certora/specs/CreditNondecreasing.spec Outdated
Comment thread certora/specs/CreditNondecreasing.spec Outdated
Comment thread certora/specs/CreditNondecreasing.spec Outdated
Comment thread certora/specs/CreditNondecreasing.spec Outdated
Comment thread certora/specs/CreditNondecreasing.spec Outdated
jhoenicke and others added 2 commits June 18, 2026 14:52
Co-authored-by: Quentin Garchery <garchery.quentin@gmail.com>
Signed-off-by: Jochen Hoenicke <hoenicke@gmail.com>
- use uint256 instead of mathint for ghost function.
- allow different market
- seller and buyer case for take
Comment thread certora/specs/NetCredit.spec Outdated
Comment thread certora/specs/NetCredit.spec Outdated
Comment thread certora/specs/NetCredit.spec Outdated
QGarchery and others added 3 commits June 19, 2026 18:00
Signed-off-by: Quentin Garchery <garchery.quentin@gmail.com>
Co-authored-by: Jochen Hoenicke <hoenicke@gmail.com>
Signed-off-by: Jochen Hoenicke <hoenicke@gmail.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 64da25e7d9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread certora/specs/NetCredit.spec

@lilCertora lilCertora left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, nice spec

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants