Closed kiates closed 1 year ago
Thanks for reporting issues! I have already seen similar cases of transfer transactions that are duplicated in Coinbase and Coinbase Pro: see these examples. The way I resolved these issues was to ignore the Coinbase Pro transaction and just process the Coinbase one (when I recognized it as a duplicate).
The tricky part is finding the pattern in these transactions that makes them recognizable as duplicates: that's what the if
statements in the examples above do. We have to do the same thing for this transaction and add a new if
statement: one possible candidate for the pattern is that your CBPro transaction doesn't have details/tx_service_transaction_id
.
Here's what I mean:
diff --git a/src/dali/plugin/input/rest/coinbase_pro.py b/src/dali/plugin/input/rest/coinbase_pro.py
index 4f37e3d..2bb79cc 100644
--- a/src/dali/plugin/input/rest/coinbase_pro.py
+++ b/src/dali/plugin/input/rest/coinbase_pro.py
@@ -70,6 +70,7 @@ _TRADE_ID: str = "trade_id"
_TRANSFER: str = "transfer"
_TRANSFER_ID: str = "transfer_id"
_TRANSFER_TYPE: str = "transfer_type"
+_TX_SERVICE_TRANSACTION_ID: str = "tx_service_transaction_id"
_TYPE: str = "type"
_USD_VOLUME: str = "usd_volume"
_WITHDRAW: str = "withdraw"
@@ -239,6 +240,10 @@ class InputPlugin(AbstractInputPlugin):
self.__logger.debug("Transfer is a Coinbase transaction already captured by Coinbase plugin: ignoring.")
return
+ if _TX_SERVICE_TRANSACTION_ID not in transfer_details:
+ self.__logger.debug("Transfer is a Coinbase transaction already captured by Coinbase plugin: ignoring.")
+ return
+
crypto_hash = transfer_details[_CRYPTO_TRANSACTION_HASH]
if transaction_details[_TRANSFER_TYPE] == _DEPOSIT:
Can you try if this solves the problem? I'll also test this with my own data.
That change definitely makes the resolver happy.
My own tests also passed. Question: what kind of transaction is it: does it have any peculiar features or is it just a normal transfer to an external address?
Here is how it looks int the Coinbase interface...
I know at some point Coinbase, Inc. transferred all my assets from Coinbase Pro to Coinbase as they were consolidating their brand. I expect that is the special part of this pattern. I'll see if I can access the Coinbase Pro side still.
Here is what I could find on the Coinbase Pro side...
This transaction doesn't look like a CBPro to CB transfer: it has the signature of a transfer to an external address and I was just curious if you remembered anything that stood out about it that might explain the slight difference compared to normal transfers (the missing details/tx_service_transaction_id
). If not, it's no big deal: I think it's ok to merge the fix.
When I process both Coinbase Pro and Coinbase transactions there is some kind of conflict or glitch that keeps the transactions from passing the resolver. Basically the same unique Id exists on both but one says the transaction came from Coinbase Pro and the other Coinbase.
Running each separately to look at the result files, here is the transaction from the Coinbase Pro ods:
... and here is the transaction from the Coinbase ods:
The interesting part is there is a transaction right before that shows a resolved Coinbase Pro to Coinbase transaction with a different unique ID.
I'm not sure what to make of this yet.