Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transaction Resolver resolves InTransaction into IntraTransaction for Existing RP2 Input #227

Open
macanudo527 opened this issue Mar 18, 2024 · 5 comments
Assignees

Comments

@macanudo527
Copy link
Collaborator

What?

When using the ODS plugin with existing data, the resolver creates IntraTransactions from Buy InTransactions that have fees. For some reason, this doesn't affect buys without fees.

Temporary Workaround

Replacing the unique ids from the buys in the original ODS with __unknown prevents the resolver from matching the transactions.

@eprbell
Copy link
Owner

eprbell commented Mar 18, 2024

The resolver turns a buy/in transaction into an intra one if there is also an out transaction with a unique id matching the buy/in transaction. Can you search through your debug logs for the unique id of the buy/in transaction and see if it occurs in an out transaction as well?

@macanudo527
Copy link
Collaborator Author

Yeah, there are pairs of transactions in/out that share the same transaction id but are on the same exchange and have different assets. Basically, when I buy BTC, I do it in USDT, so there is a BTC buy, InTransaction, and a USDT sell, OutTransaction that share the same unique id. This isn't a problem when I use the rest API, but for some reason when using the existing RP2 plugin, it combines these transactions. They are on the same exchange and use different assets so this should never occur. Putting some kind of filter on the resolver would prevent this from happening. I'm just not sure why it happens on existing rp2 input.

I have a strange feeling we've had this bug before.

@eprbell
Copy link
Owner

eprbell commented Mar 19, 2024

That suggests there may be a bug in the way the plugin for that exchange (which one btw?) is assigning unique ids. Maybe the raw data contains other fields (or combination of fields) that can be used as unique ids for in/out transactions?

@macanudo527
Copy link
Collaborator Author

So, the original plugin is okay. If I run the Binance REST API plugin, it works fine. Everything is okay.

It's just when I take the output of that run in ODS form ( and use the existing RP2 data plugin that reads previously generated ODS files in) and feed it back into dali-rp2 is when things cause trouble. It generates IntraTransactions where the to and from exchanges are equal. Binance to Binance, Can you think of a situation where the resolver should do that?

I guess my point is the resolver should never generate an IntraTransaction where the from and to exchanges are equal. That seems like a bug to me. Especially if it is generating it from two transactions with completely different assets.

@eprbell
Copy link
Owner

eprbell commented Mar 20, 2024

Thanks for clarifying. A few comments:

  • it is possible to have a legitimate intra transaction to and from the same wallet/exchange (e.g. if you send some coins to an external address and that address is actually a receive address for the source wallet/exchange): this is typically used to consolidate utxos (on wallets);
  • I agree that the resolver should not try to match two transactions that have same unique id but different assets (but same asset is OK as mentioned above): we should fix that. Could you attach a small input file to repro the issue (unless you're planning on fixing it yourself)?
  • I guess I don't understand what is the difference between running the Binance rest plugin vs the feeding back the ODS: isn't the data the same? If not what is the difference?

@macanudo527 macanudo527 self-assigned this Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants