dcrdex
dcrdex copied to clipboard
maxbuy/maxsell: take redemption fees into account
It seems when maxbuy/maxsell is calculated only swap fee is taken into account (but not redemption fee) as a "limiting factor",
namely when I try to place limit order of size N (where N is the value maxsell shows) on DCR-USDC market my request gets rejected with error message along the lines of "attempting to lock more polygon for redemption that is currently available. 4x > x" (presumably because I don't have enough POL to actually redeem the trade of size N),
I guess this is only relevant to validate for account-based assets (since for assets such as DCR and BTC you can pay any fees you need subtracting it from the funds you receive as redemption beneficiary).