Links

Liquidity Provider and Protocol Fees

These pages describe the breakdown and distribution of fees generated from the FXPools
Note: not all FXPools charge the same 8 bps per trade. See the subpages for the actual fees charged
Trading Fees
LP Fees
  1. 1.
    For every successful trade, a percentage of the transaction value is deducted as trading fees and remains in the pool
  2. 2.
    A portion of these fees is allocated to liquidity providers (LPs) and paid to them upon withdrawal, while the rest is allocated to the protocol. For a detailed breakdown of fee distribution between LPs and the Protocol for individual pools, please refer to the subsections of the Fee page and find the specific pool you are interested in for more details.
Protocol Fees
Disperse Protocol Fees
  1. 1.
    The FXPool tracks the protocol unclaimed fees from transactions through a public parameter, FXPool.totalUnclaimedFeesInNumeraire, where "numeraire" represents USD value in our code
  2. 2.
    On every LP deposit/withdraw, FXPool.totalUnclaimedFeesInNumeraire is paid to the protocol fee distributor contract
  3. 3.
    The disperseFees function can then be called by anyone, distributing half of the unclaimed fees to the Xave fee collector address and the other half to Balancer's fee collector.
_______________________________________________________________________________________________

Simulated Fee Computation

Simulated Transaction

Swap In (XSGD)
Swap Out (USDC)
100
75.57378887
XSGD/USD Price
USDC/USD Price
0.75637240
1.00003892

Sample Parameters and Fee Break Down:

Fee Break Down
Fees value (bps)
Fee Value (Numeraire)
LP Fees
5.04
0.03812117283
Protocol Fees (Xave)
1.48
0.01119431152
Protocol Fees (Balancer)
1.48
0.01119431152
Total Trading Fees
8
0.06050979814
Last modified 6mo ago