airswap-web
airswap-web copied to clipboard
Fetch `protocolFee` from SwapContract and use instead of hard coded values
Currently 1.0007
is used in a few places for last look calculations, and text around the interface says 0.07%. We should use the onchain value for future proofing.
Hi @gpxl-dev, regarding this issue, do I fetch the signerFee from the SwapContract instance, ie.
const contract = ethers.Contract(swapContractAddress, swapContractAbi, provider);
const signerFee = contract.protocolFee();
Please advise if I'm going in the right direction?
@francisldn correct, this is the right direction. Note that AFAIK current deployments still use signerFee
instead of protocolFee
. Also note that contract.protocolFee()
would return a promise, so you would need to assign signerFee
to the value it resolves to rather than the promise itself.