Missing event data when using mangrove order
peterMangrove opened this issue · 3 comments
Describe the bug
When taking offers with Mangrove order, no event data is given.
To Reproduce
Steps to reproduce the behavior:
let result = await market.buy({ volume: 2000, price:1.3, mangroveOrder: { fillOrKill: true }});
console.log(result);
All arrays with event data is empty
successes: [], tradeFailures: [], posthookFailures: [], offerWrites: []
Expected behavior
The arrays should contain data about the offers that was taken
Screenshots
When taking offers using a normal marketOrder we get arrays with data. Taking offers with MangroveOrder should be the same.
successes: [ { offerId: 1102, got: 384.8336600809039, gave: 386.496327 }, { offerId: 1675, got: 1336.6361670819056, gave: 1342.479945 }, { offerId: 1553, got: 1226.487338165033, gave: 1231.86479 }, { offerId: 2344, got: 107.1174332739401, gave: 107.588989 }, { offerId: 1447, got: 253.95988832819228, gave: 255.078022 }, { offerId: 2129, got: 140.14857377080585, gave: 140.766669 }, { offerId: 1166, got: 426.4170480750237, gave: 428.304528 }, { offerId: 1608, got: 992.8209014306427, gave: 997.255029 }, { offerId: 1859, got: 131.57898979355287, gave: 132.167349 } ], tradeFailures: [ { offerId: 4620, reason: '0x6d67762f6d616b65725472616e736665724661696c0000000000000000000000', FailToDeliver: 1315.8444138618922, volumeGiven: 1321.487386 }, { offerId: 4285, reason: '0x6d67762f6d616b65725472616e736665724661696c0000000000000000000000', FailToDeliver: 1211.9005015285418, volumeGiven: 1217.099917 }, {
Additional context
Look in the "tradeEventManagement" file for the method "resultOfMangroveOrderEventCore". This method handles the filtering of events.
When this is fixed, the how to "Use Fill or Kill" should be updated with correct output.
After this issue has been resolved, it should also be considered whether to add a section to https://docs.mangrove.exchange/SDK/guides/fill-or-kill, where the FoK order fails, due to not being able to complete the order fully - "noPartialFill".