In case if trading fee will be changed then refund will be done with wrong amount
In case if trading fee will be changed then refund will be done with wrong amount\\nWhen user creates quote, then he pays trading fees. Amount that should be paid is calculated inside `LibQuote.getTradingFee` function.\\n```\\n    function getTradingFee(uint256 quoteId) internal view returns (uint256 fee) {\\n        QuoteStorage.Layout storage quoteLayout = QuoteStorage.layout();\\n        Quote storage quote = quoteLayout.quotes[quoteId];\\n        Symbol storage symbol = SymbolStorage.layout().symbols[quote.symbolId];\\n        if (quote.orderType == OrderType.LIMIT) {\\n            fee =\\n                (LibQuote.quoteOpenAmount(quote) * quote.requestedOpenPrice * symbol.tradingFee) /\\n                1e36;\\n        } else {\\n            fee = (LibQuote.quoteOpenAmount(quote) * quote.marketPrice * symbol.tradingFee) / 1e36;\\n        }\\n    }\\n```\\n\\nAs you can see `symbol.tradingFee` is used to determine fee amount. This fee can be changed any time.\\nWhen order is canceled, then fee should be returned to user. This function also uses `LibQuote.getTradingFee` function to calculate fee to return.\\nSo in case if order was created before fee changes, then returned amount will be not same, when it is canceled after fee changes.
You can store fee paid by user inside quote struct. And when canceled return that amount.
User or protocol losses portion of funds.
```\\n    function getTradingFee(uint256 quoteId) internal view returns (uint256 fee) {\\n        QuoteStorage.Layout storage quoteLayout = QuoteStorage.layout();\\n        Quote storage quote = quoteLayout.quotes[quoteId];\\n        Symbol storage symbol = SymbolStorage.layout().symbols[quote.symbolId];\\n        if (quote.orderType == OrderType.LIMIT) {\\n            fee =\\n                (LibQuote.quoteOpenAmount(quote) * quote.requestedOpenPrice * symbol.tradingFee) /\\n                1e36;\\n        } else {\\n            fee = (LibQuote.quoteOpenAmount(quote) * quote.marketPrice * symbol.tradingFee) / 1e36;\\n        }\\n    }\\n```\\n