Fees are implemented as partner contracts. A partner contract is created by calling the function
registerPartner(address partnerBeneficiary, uint256 partnerPercentage)on the PartnerRegistry (currently on mainnet at
- partnerBeneficiary is the address you want to receive the fees at
- partnerPercentage is the percentage fee you want to take.
partnerPercentageis out of 10^18 (i.e., 10% is 10^17 and 0.1% is 10^15 )
registerPartneris called, the registry will emit a
PartnerRegistered(address partnerContract)event (where
partnerContractis the address of the contract you've created).
When you want to accrue fees, you will include
partnerContractin your API request to the
"sourceAmount": int, // send either sourceAmount OR destinationAmount, not both
The encoded payload that is returned will include your partner contract. When the transaction is executed, the fee (in any ERC20/ETH) will be sent to your partner contract.
To collect your fees, someone must call the
payout()function on your partner contract. Anybody can call this, and it will payout the appropriate fees to the
partnerBeneficiaryand to Totle.
The API has a default partner contract with a
partnerPercentageof 0 and a
totlePercentageof 0 (which is used when one is not passed to the API). When a fee is selected, a default 50:50 profit split will be applied. If you expect large trading volumes then we're happy to discuss a custom fee structure.