The Frictionless protocol is designed to automate cash operations across the lifecycle of a fund, part of this automation is the collection of contracted fee structures within a fund, such as management and/or performance fees.
The smart contracts for securities exchange, transfer, ERC20 swap and FX swaps may be programmed to automatically collect fees for Managers, opening new revenue streams for Managers whilst ensuring the visibility of fees for Investors and Managers alike.
The following diagram illustrates the design of the fee module, which enables the definition of fees to be automatically collected by a defined fee recipient during any of the value exchange functions in the protocol.
Fees may be configured to be collected in the following transactions:
P2P (bi-lateral) transfer of tokens between permissioned counterparties, for example, a direct transfer of securities between two Investors, such as a secondary trade.
Exchange of securities, executed by the protocol during a primary issuance, in the form of management fees upon committed capital or deployed capital.
Settlement of securities, executed by the protocol or by the Investor.
Conversion of an ERC20 token to/from a FrictionlessFundDepositToken, for example, converting USDC to the USD equivalent FrictionlessFundDepositToken or conversion of another ERC20 collateral.
FX swap of FrictionlessFundDepositToken of different currencies.
The fee architecture permissions the protocol admin to establish fees, this ensures that the market integrity for fees is maintained, for example, the FX rates are taken from our FX partner's spot and forward rates quoted, and the conversion of ERC20 stablecoins such as USDC and USDT to it's USD equivalent FrictionlessFundDepositToken.
Inherits: IAbstractFeeModule
Copyright © 2023 DEFYCA Labs S.à.r.l Permission is hereby granted, free of charge, to any person obtaining a copy of the Frictionless protocol smart contracts (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL DEFYCA LABS S.à.r.l BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Use SafeERC20
for any ERC20 token in the conversion
represents 0 bps in fees (the minima of fees or 0%)
represents 10000 bps in fees (the maxima of fees or 100%)
Shouldnt arrise due to validation, but being doubly sure, we can't compute incorrect fees.
Validates the FeeInfo, specifically validates the non zero address of the feeRecipientAddr and the range for the feeInBps (0 to MAX_FEES_IN_BPS).
Parameters
feeInfo_
FeeInfo
the FeeInfo to validate. throws AbstractFeeModuleInvalidFeeRecipient
if the feeRecipientAddr is a zero address throws AbstractFeeModuleInvalidFee
if the feeInBps is not in the valid range (ZERO_FEES_IN_BPS to MAX_FEES_IN_BPS)
Author: DEFYCA Labs S.à.r.l
Copyright © 2023 DEFYCA Labs S.à.r.l Permission is hereby granted, free of charge, to any person obtaining a copy of the Frictionless protocol smart contracts (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL DEFYCA LABS S.à.r.l BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
get the FeeInfo for a given key.
Parameters
Returns
get the feeInBps value for a given key
Parameters
Returns
get the feeRecipientAddr value for a given key
Parameters
Returns
Calculates the actual fee in absolute terms for a given fee in basis points.
Parameters
Returns
Event emitted during _setTokenFee
error thrown if the recipient is a zero address
error thrown if the feesInBps is outside the valid range
Struct which defines the FeeInfo, representing the fee in basis points and the recipient of the fees on-chain.
<none>
uint256
the feeInBps value
tokenFeeKey_
bytes32
the key as generated by the function getTokenFeeKey
<none>
address
the feeRecipientAddr value
tokensAmount_
uint256
the amount of tokens used to determine the base calculation.
feeInBps_
uint256
the fee in basis points for calculation.
feeAmount_
uint256
the actual fee in absolute terms for a given fee in basis points.
feeKey_
bytes32
the key as generated by the function getTokenFeeKey
<none>
FeeInfo
FeeInfo the fees associated with a token transfer.
tokenFeeKey_
bytes32
the key as generated by the function getTokenFeeKey