<aside> 💡 This document is a draft for discussion as part of this Balancer forum discussion. The final form will be added to docs.xave.co

</aside>

<aside> 💡 TLDR: here is a sample tx that dispersed protocol fees 50:50 to Xave and Balancer fee collector addresses https://polygonscan.com/tx/0x5cc8e0358a20f694efb3577d21dca31bb4c7a7daddf0222dc82a763846ac22df

</aside>

This page describes the implementation and live transaction demo of FXPool fee splits between LPs, Balancer and Xave as discussed in the Balancer forum.

Fee Split Breakdown

https://notion2charts.com/embed/cached/72ee4634-152f-4809-a951-7f1793c80fd8

Breakdown

Sample Sequence Flow

Untitled

  1. Trade is executed → See sample trade tx
  2. Total 8 bps is deducted from token out and stays in pool
  3. 5.04 (63%) bps stays in the pool and is paid to LPs upon withdrawal
  4. 2.96 bps (37%) is tracked in code via the public variable FXPool.totalUnclaimedFeesInNumeraire (numeraire means USD in our code)
  5. On every LP deposit/withdraw, FXPool.totalUnclaimedFeesInNumeraire (in the form of minted LP tokens or BPT-XSGD-USDC) is paid to the protocol fee distributor contract (EthProtocolFeesDistributor/ PolygonProtocolFeesDistributor ) → See sample LP deposit
  6. Anyone can call the public function disperseFees(address token). token param is the contract address of the LP token paid as protocol fees. Upon calling, half the unclaimed fees in the protocol fees distributor will be sent to Xave fee collector multisig and half will be sent to
    1. Balancer’s fee collector

    2. Xave fee collector

      1. Ethereum mainnet
      2. Polygon
    3. See sample tx showing disperseFees call. In this tx, it sent a total unclaimed 116 BPT-XSGD-USDC each as fees to both the Xave and Balancer fee collector

      Disperse Protocol Fees (with figures).png

Resources