Integration Reference

Overview

MonBridgeDex is a production-grade DEX aggregator deployed on Monad that supports both Uniswap V2 and V3 protocols. It provides optimal routing, multi-hop swaps, split trading, and advanced features like TWAP validation and adaptive slippage.

Contract Address: 0x7dd7fc9380e3107028a158f49bd25a8a8d48b225

Network: Monad Mainnet (Chain ID: 143)


Key Features

  • ✅ Multi-DEX Aggregation: Compares V2 and V3 routers for best rates

  • ✅ Split Trading: Automatically distributes large trades across 2-4 routers

  • ✅ Multi-Hop Routing: Optimizes paths including WETH intermediary routes

  • ✅ Adaptive Slippage: Dynamic slippage based on price impact

  • ✅ Flash Loan Protection: TWAP validation for V3 pools

  • ✅ Fee-on-Transfer Support: Handles tokens with transfer fees


React Integration Example

1. Setup & Dependencies

2. Contract Configuration

3. React Hook for Swapping

4. React Component Example


JavaScript (Vanilla) Integration Example

Complete Swap Implementation


Python Integration Example

Using Web3.py


Advanced Features

1. Split Trading (Multi-Router Execution)

For large trades, MonBridgeDex can automatically split orders across multiple routers:

2. Custom Slippage Configuration

3. Fee-on-Transfer Token Support


Important Notes

Security

  1. Always validate addresses: Ensure token addresses are correct before swapping

  2. Check slippage: Monitor price impact and adjust slippage accordingly

  3. Test with small amounts: Test integration with small amounts first

  4. Handle errors: Implement proper error handling for failed transactions

Gas Optimization

  1. Approve once: Use MaxUint256 for approvals to avoid repeated approval transactions

  2. Batch operations: Consider batching multiple swaps if possible

  3. Monitor gas prices: Check network gas prices before executing large trades

Best Practices

  1. Use auto-slippage (pass 0) for most cases - the contract calculates optimal slippage

  2. For large trades, use getBestSwapDataWithSplits() to check if splitting is beneficial

  3. Always wait for confirmations before updating UI

  4. Cache WETH address to avoid repeated calls

Contract Fees

  • Fee: 0.1% (10 basis points) on all swaps

  • Fee is automatically deducted from input amount

  • No additional gas overhead


Support & Resources

  • Explorer: MonadScan

  • Network: Monad Mainnet (Chain ID: 143)

  • RPC: https://rpc.monad.xyz

For integration support, ensure you:

  • Test on Monad testnet first if available

  • Monitor transaction receipts for errors

  • Implement proper wallet connection flow

  • Handle network switching to Chain ID 143

Last updated