Fees
Protocolink charges fees based on the token amount and transaction type
Last updated
Protocolink charges fees based on the token amount and transaction type
Last updated
This page explains the fee mechanism in the Protocolink contracts. The overview fee structure can be found at .
Protocolink calculates the fees on-chain or off-chain depending on the user called function. When users call the Protocolink contract directly (e.g., ), Protocolink calculates the fees on-chain. When users call the Protocolink contract with API data (e.g., ), Protocolink charges the off-chain fee.
If users call the Router contract without the API data, Protocolink will calculate and charge the on-chain fee in the execute()
function. The on-chain fee is charged from the token amounts transferred in the transaction. For ERC-20 tokens, the on-chain fee is charged in the _doPermit2()
function, and for native tokens, the on-chain fee is charged in the _chargeByMsgValue()
function. Protocolink charges the fee from the Agent.
Protocolink also charges the flash loan fee before returning the control flow back to flash loan services. You can find out more details in the AaveV3FlashloanCallback.
If users call the Router contract with API data, Protocolink will charge the off-chain fee in the executeWithSignerFee()
function. The fees are calculated in Protocolink's API server off-chain and are charged by token types. If the token is an ERC-20 token, the fee is charged from the user address. If the token is a native token, the fee is charged from the Agent address.