drift-labs / gateway

Self hosted API gateway to easily interact with Drift V2 Protocol
Apache License 2.0
22 stars 12 forks source link

Unable to retrieve fill order details from API #71

Closed satwikkansal closed 2 months ago

satwikkansal commented 2 months ago

I posted an order, it was being retrieved through v2/orders API until it got filled, after which the endpoint returns empty array (as expected).

However, the v2/transactionEvent doesn't contain the fill event for the order, only createOrder event.

{'events': [{'orderCreate': {'order': {'slot': 288123613, 'price': '0', 'amount': '0.3', 'filled': '0', 'triggerPrice': '0', 'auctionStartPrice': '0', 'auctionEndPrice': '0', 'maxTs': 0, 'oraclePriceOffset': '0.0001', 'orderId': 18, 'marketIndex': 0, 'orderType': 'limit', 'marketType': 'perp', 'userOrderId': 49, 'direction': 'buy', 'reduceOnly': False, 'postOnly': False, 'immediateOrCancel': False, 'auctionDuration': 0}, 'ts': 1725614399, 'signature': '2gpP3Bx8arz2QubThUQkMNGRQ1rSo2Nbc96o3STvTVrom8rCnU8egzCKaagKMbLGnys4bamwR7Xfhvv749bWbQgP', 'txIdx': 6}}]}

the documentation specifies that there should be a fill event, is there something I'm missing?

wphan commented 2 months ago

On drift the fill happens in a separate transaction, which you might have missed if you were not listening on the websocket channel as the fill happened.

Currently the only way to look up the fill tx is through the UI (https://app.drift.trade/overview/history/tradeHistory), if use that tx sig in v2/transactionEvent it should show the fill events

satwikkansal commented 2 months ago

oh okay, so no way to find fills for an orderID through REST API?

wphan commented 2 months ago

correct, not at the moment