BrainDex Documentation
  • šŸ’”Introduction
    • What is BrainDex?
  • šŸ’User Guides
    • How to Make a Swap
  • ⚔Protocol Information
    • Contracts
    • Technical Documentation
      • The BrainDex Router
        • Contract Interactions
      • The BrainDex Executor
    • Router Fees
    • Supported Chains and DEXes
    • Audit
  • ā”Faq
    • FAQ
  • šŸ‘©ā€šŸ’»Developer Documentation
    • Your API endpoint
    • BrainDex Integration Quickstart
    • BrainDex API Integration
      • Pathfinder API - Requesting a Route
      • Pathfinder API - the Route Request Response
    • BrainDex Router Interaction
      • Sending a Swap Transaction
    • A Complete Example
Powered by GitBook
On this page
  1. Protocol Information

Router Fees

PreviousThe BrainDex ExecutorNextSupported Chains and DEXes

Last updated 2 years ago

BrainDex takes a fee equal to half of the difference between the amount out minimum after slippage and the actual amount received, with a maximum fee of 0.2% and a minimum fee of 0.05%.

Fee Calculation - amountOutMin after fees

Because the router fee depends on the difference between the passed amountOutMin parameter and the actual amount received, for the sake of this example we will assume that amountOutMin and amount received are equal. In practice, because the router fee is half of the difference floored at 0.05%, the amount received after router fees will never be lower than the following equation:

Amt=xāˆ—0.9995Amt = x * 0.9995Amt=xāˆ—0.9995

Please see for the precise implementation.

⚔
BrainDexRouterV2.sol