Flowcarbon Docs

Dynamic Fee Structure

The unbundle, swap, retire, and redeem functions have dynamic fees associated with them. The dynamic fee is rather simple; it will be more expensive to act of younger vintages than to act on older vintages. This is to incentivize retirement of older carbon credits and to keep the bundles young.
The dynamic fee is implemented using a 'rake back' contract. A max fee is set in the bundle contract for all functions. When one of the functions is initiated, the contract is executing the function on behalf of the user account and the rake back contract determines what amount of this max fee should be sent back to the requestor.
So say for example that the max fee is 15% and if Sarah requests to unbundle 100 bundle tokens into a 2020 GCO2. Here, the bundle token contract will automatically collect 15 GCO2 in fees account and 85 will be sent to the rake back contract. The rake back contract will contain logic on what the fee actually is; given that 2020 is a relatively recent vintage, but not the most recent, let's say the actual fee is 10%. So in this case the rakeback contract will pull 5 GCO2 back from the fees and send 90 GCO2 back to Sarah.
The purpose of the rake back contract is to ensure that the bundle and GCO2 contracts are immutable. The logic of the contracts cannot be changed. Fee structures may change over time, but those updates will occur in the rake back contract.