You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CreateOffer with tfFillOrKill flag will always results in a tecKILLED result if the exchange rate on the offer is better than, but doesn't exactly match, the order book rate.
Offer should fill and not be killed because TAKER is offering to pay 101 XRP for 100 ONE and maker is offering to sell 100 ONE for 100 XRP. Since TAKER is offering MORE XRP than the MAKER is asking, the order should match and execute with a tesSUCCESS result.
@gregtatcam has a unit test reproducing what @nhartner is observing. It looks like the problem was introduced with the flowCross amendment which went live August of 2020. @gregtatcam has offered to write an amendment with a fix.
Introduce the `fixFillOrKill` amendment.
Fix an edge case occurring when an offer with `tfFillOrKill` set (but
without `tfSell` set) fails to cross an offer with a better rate. If
`tfFillOrKill` is set, then the owner must receive the full TakerPays.
Without this amendment, an offer fails if the entire `TakerGets` is not
spent. With this amendment, when `tfSell` is not set, the entire
`TakerGets` does not have to be spent.
For details about OfferCreate, see: https://xrpl.org/offercreate.htmlFixXRPLF#4684
---------
Co-authored-by: Scott Schurr <[email protected]>
Issue Description
CreateOffer
withtfFillOrKill
flag will always results in atecKILLED
result if the exchange rate on the offer is better than, but doesn't exactly match, the order book rate.Steps to Reproduce
Enable Default Ripple flag on ISSUER (ex. https://test.bithomp.com/explorer/424CF9443FBBE23734DF9E49BA2297D2A2ECE58C11F01B4EE8FD251F63E85A6C)
Create trustlines:
Send a payment of 100 units of currency ONE from ISSUER to MAKER (ex. https://test.bithomp.com/explorer/BBFBC0CB6B6ECE68050E8C57E7F7F33F0437D9EF03E638F74D70DFF5DBF1B06B)
Create an offer on MAKER account to sell 100 units of currency ONE for 100 XRP (ex. https://test.bithomp.com/explorer/DDFF0C28494332C491147A9A85AC8F5C1A988A848B4366271E72A67266AF5556)
Create an offer on TAKER account to buy 100 units of currency ONE for 101 XRP with
tfFillOrKill
flag (ex. https://test.bithomp.com/explorer/7251BC0895848886B9419FC1E209DABAAA2BE3BD66CB690BABFD92D660EA4743)Expected Result
Offer should fill and not be killed because TAKER is offering to pay 101 XRP for 100 ONE and maker is offering to sell 100 ONE for 100 XRP. Since TAKER is offering MORE XRP than the MAKER is asking, the order should match and execute with a
tesSUCCESS
result.Actual Result
Offer is killed with
tecKILLED
status. (see https://test.bithomp.com/explorer/7251BC0895848886B9419FC1E209DABAAA2BE3BD66CB690BABFD92D660EA4743)Note:
tfImmediateOrCancel
flag is used instead, the offer for 101 XRP for 100 ONE also gets fully matchedEnvironment
Reproduced on testnet and mainnet
The text was updated successfully, but these errors were encountered: