set_fees
An entrypoint that setups interface fee, swap fee, and auction fee that applies in time of each swap or flash_swap. Also it setups a reward for withdrawing auction fee that applies in time of calling withdraw_auction_fee entrypoint by any user.
Call parameters
type fees_t is [@layout:comb] record [
interface_fee : nat;
swap_fee : nat;
auction_fee : nat;
withdraw_fee_reward : nat;
]
interface_fee
nat
Float value multiplied by 1e+18
Fee that goes to referrers or UI/UX providers
swap_fee
nat
Float value multiplied by 1e+18
Fee that goes to the liquidity pool (for liquidity providers)
auction_fee
nat
Float value multiplied by 1e+18
withdraw_fee_reward
nat
Float value multiplied by 1e+18
Usage
const interfaceFee = 0.05 * 10 ** 18; // 0.05%
const swapFee = 0.05 * 10 ** 18; // 0.05%
const auctionFee = 0.4 * 10 ** 18; // 0.4%
const withdrawFeeReward = 3 * 10 ** 18; // 3%
const dexCoreAddress = "KT1...";
const fees = {
interface_fee: interfaceFee,
swap_fee: swapFee,
auction_fee: auctionFee,
withdraw_fee_reward: withdrawFeeReward,
};
const dexCore = await tezos.contract.at(dexCoreAddress);
const operation = await dexCore.methodsObject.set_fees(fees).send();
await operation.confirmation();
Errors
400
-sender
of the transaction is not current administrator.412
- non payable entrypoint (can't accept TEZ tokens during call of an entrypoint).
Last updated