Fee Mechanism of Infinity

First, there is 0% fees to deposit SOL or LSTs into the Infinity Pool. The previous section gives us a fair price for every pairwise swap within the pool. But in order to make money Infinity needs to charge fees.

Every asset in the pool has an inputFee and outputFee. The total fee for swap is the sum of the input and output fee.

Let’s examine a hypothetical bSOL->scnSOL swap. What fee will Infinity charge?

Assuming the following fees:

assetinputFeeoutputFee

bSOL

2

5

scnSOL

3

4

The inputFee for bSOL is 2 basis points (bps) and the outputFee for scnSOL is 4 bps. The total fee is therefore 6 bps.

In this version of the program, the fee is flat: it does not increase as you swap more bSOL. Future versions of the program will be able to support ramping fees if we deem it desirable. We have abstracted out the pricing module into a separate program so it can be easily upgraded without touching the rest of the codebase.

Why do we charge fees in this way? And how do we determine inputFee and outputFee for each asset? These fees are set dynamically by the Infinity pool manager. Let’s see how this fee structure allows us to provide economic incentives to rebalance the pool.

Last updated

Logo

Copyright © 2024 Sanctum Labs