Skip to content

Conversation

@kuwiez
Copy link

@kuwiez kuwiez commented Sep 17, 2025

Description

This PR adds a new example Quick Test Swap that demonstrates a minimal end-to-end token swap on BNB Smart Chain Testnet.
It includes both:

  • A local AMM (constant product x * y = k) simulation.
  • A real on-chain swap using the PancakeSwap V2 Router (tBNB → CAKE).

The example also includes slippage checks, clean formatting via Prettier, and documentation in README.md.

Type of change

  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

  • Ran local simulation with:
    npx ts-node index.ts --chain local --amount 1 --slippage 0.5

✅ Produced expected swap output with correct math.
Ran live testnet swap with:
npm run swap:testnet -- --execute true
✅ Transaction successfully mined on BSC Testnet:
Txn submitted: 0xee5cac4db4f6a2c9c61a2effc51acbab9ef79bcd8553402a278fb98af2889ddf
Mined in block 65714391

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Copy link

@futures996 futures996 left a comment

Choose a reason for hiding this comment

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

OK

@futures996
Copy link

E AÍ COMUNIDADE BNB SMART CHAIN!!

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.

4 participants