Submitted by pkqs90, also found by 0xRobocop, BenRai, Brenzee, 0xStalin, alix40, 3n0ch, Honour, silver_eth, trachev, Nyx, KupiaSec, ether_sky, and VAD37
When a user places a credit sell limit order, it may be either:
However, for case number 2, it does not charge a swap fee for the borrower, which contradicts to the swap fee definition.
Lets first see how LiquidateWithReplacement works. There are two steps:
Note that step 2 is the same as buying credit using the BuyCreditMarket function.
However, according to the docs, all cash and credit swaps should charge swap fees on the borrower. The issue here is the swap in LiquidateWithReplacement does not charge swap fees.
Say two users setup the same sell limit order.
The first users order was bought by a user via BuyCreditMarket, and the second users order was bought by LiquidateWithReplacement. However, the swap fee is only charged to the first user. This is unfair and is not mentioned anywhere expected in the documents.
Also charge swap fees during executeLiquidateWithReplacement.
aviggiano (Size) acknowledged and commented:
hansfriese (judge) commented:
