Skip to content

Conversation

@devin-ai-integration
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Jan 4, 2026

docs: update gas numbers with verified mainnet tx (85,292 gas)

Summary

Updates both README.md and BALANCER_COMPARISON.md with verified gas numbers from a real mainnet transaction, replacing outdated/unverified claims.

Key changes:

  • Verified gas measurement: 85,292 gas from real mainnet tx
  • LIQFlashYul is ~1.1% cheaper than Balancer V2's minimum observed USDC flash loan (85,292 vs 86,268 gas)
  • Removed unverified claims (~41k warm, ~73k cold, 40-50% cheaper)
  • Updated README.md gas comparison table with source attribution
  • Updated README.md gas breakdown section with verified numbers

Updates Since Last Revision

Found and verified a real mainnet flash loan transaction:

  • Real mainnet tx: 85,292 gas (authoritative)
  • Tenderly simulation (deployed borrower): 85,292 gas (matches!)
  • Tenderly simulation (fresh borrower): 83,988 gas

The previous README claims (~73k cold, ~41k warm) could not be reproduced and appear to have used a different measurement methodology. This PR replaces them with verified receipt-level gasUsed from actual transactions.

Review & Testing Checklist for Human

  • Verify the mainnet tx is representative - Check 0x35274dd1... is a valid LIQ flash loan with minimal callback
  • Confirm modest gas advantage is acceptable - PR changes claim from "40-50% cheaper" to "~1.1% cheaper" (85,292 vs 86,268). This is a significant messaging change.
  • Review removal of warm/cold distinction - We couldn't verify different warm/cold numbers, so README now shows single verified gas figure
  • Check competitor estimates - Aave, Morpho, Euler numbers are still marked "Estimated" - verify these are reasonable

Test Plan

# Verify the mainnet tx gas
cast receipt 0x35274dd1af81d4424cfa35cadff05508a3148a72805730bfef8de9f6d686af5c --rpc-url https://ethereum-rpc.publicnode.com | grep gasUsed

# Run Tenderly E2E test (requires TENDERLY_ACCESS_KEY)
npx tsx script/test-tenderly.ts

Notes

The document went through several iterations:

  1. Initial: Used Foundry gasleft() measurements (62,846 warm)
  2. Revision: Aligned with README's unverified numbers (~73k/~41k)
  3. Revision: Used Tenderly E2E test results (83,998 gas)
  4. Final (current): Verified against real mainnet tx (85,292 gas)

The previous README numbers (~41k warm) likely measured Tenderly trace "call-frame gas" rather than receipt gasUsed, which explains the discrepancy.

Link to Devin run: https://app.devin.ai/sessions/55585942721f4bcaa48cdfa0c67d9110
Requested by: Player 53627 (github.stagnate430@passmail.com) / @igor53627

…bers

- Replace outdated LIQFlashV2/LIQFlashFinal/LIQFlashPaid references with current LIQFlashYul implementation
- Add detailed gas breakdown from forge test traces
- Update comparison summary with accurate benchmarks (62,846 gas warm vs Balancer's 86,268 min)
- Fix gas savings calculations (1.37x cheaper vs USDC, not 5.5x)
- Update reproduction instructions with forge test command

Co-Authored-By: Player 53627 <github.stagnate430@passmail.com>
@devin-ai-integration
Copy link
Contributor Author

Original prompt from Player 53627
https://github.com/igor53627/liq/blob/main/research/BALANCER_COMPARISON.md should we update this file? do you need Tenderly keys for test? 

You only need to look in the following repo: igor53627/liq

@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@changeset-bot
Copy link

changeset-bot bot commented Jan 4, 2026

⚠️ No Changeset found

Latest commit: 233b76b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link

coderabbitai bot commented Jan 4, 2026

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

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


Comment @coderabbitai help to get the list of available commands and usage tips.

devin-ai-integration bot and others added 3 commits January 4, 2026 20:31
- Remove misleading 'x cheaper' claims that compared different measurement bases
- Clarify that Foundry gasleft() deltas don't include 21k intrinsic tx gas
- Update estimated real tx gasUsed to ~85-90k (comparable to Balancer's 86k min)
- Remove WETH comparison (LIQFlashYul is USDC-only)
- Remove misleading 'vs avg' comparison (callback logic dominates, not protocol)
- Add honest 'Key Observations' section explaining comparable gas costs
- List actual advantages of each protocol fairly

Co-Authored-By: Player 53627 <github.stagnate430@passmail.com>
- Use README's Tenderly-measured gas numbers (~73k cold, ~41k warm)
- Add comparison table matching README format (vs Aave, Balancer, Morpho, Euler)
- Add gas savings percentages vs competitors
- Add 'Why LIQ Beats Morpho/Euler' section explaining transfer+balanceOf pattern
- Update gas breakdown to match README's component breakdown
- Add note explaining warm vs cold definitions

Co-Authored-By: Player 53627 <github.stagnate430@passmail.com>
- Replaced unverified README numbers with actual Tenderly E2E test results
- Flash loan (cold): 83,998 gas (verified via script/test-tenderly.ts)
- LIQ vs Balancer USDC min: ~2.6% cheaper (83,998 vs 86,268)
- Added methodology section explaining measurement basis (receipt gasUsed)
- Removed unverified percentage claims (40-50% cheaper)
- Added all operation gas costs from Tenderly test

Note: The README claims ~73k cold / ~41k warm, but actual Tenderly
measurement shows 83,998 gas for cold flash loan. README may need updating.

Co-Authored-By: Player 53627 <github.stagnate430@passmail.com>
@devin-ai-integration devin-ai-integration bot changed the title docs: update BALANCER_COMPARISON.md with accurate LIQFlashYul gas numbers docs: update BALANCER_COMPARISON.md with verified Tenderly gas numbers Jan 4, 2026
- Updated README.md gas comparison table with verified numbers
- Updated BALANCER_COMPARISON.md with real mainnet tx data
- LIQ: 85,292 gas (verified via etherscan.io/tx/0x35274dd1...)
- Balancer USDC min: 86,268 gas (from on-chain data)
- Removed unverified claims (~41k warm, ~73k cold)
- Added link to real mainnet flash loan transaction

Co-Authored-By: Player 53627 <github.stagnate430@passmail.com>
@devin-ai-integration devin-ai-integration bot changed the title docs: update BALANCER_COMPARISON.md with verified Tenderly gas numbers docs: update gas numbers with verified mainnet tx (85,292 gas) Jan 4, 2026
@igor53627 igor53627 merged commit 2df64c0 into main Jan 4, 2026
2 checks passed
@igor53627 igor53627 deleted the devin/1767557933-update-balancer-comparison branch January 4, 2026 21:12
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