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

Struggling to add date where filter to AccountTransactions query #57

Closed
modersohn opened this issue Feb 26, 2022 · 5 comments
Closed

Struggling to add date where filter to AccountTransactions query #57

modersohn opened this issue Feb 26, 2022 · 5 comments
Assignees

Comments

@modersohn
Copy link
Collaborator

Hey there

I'm struggling to optionally limit the GetAccountTransactions query to a date range and have pushed my current state to feature/TransactionCSVExport on my fork - where I added you as a contributor too (It's probably way to early to open a PR for this).

Could you possibly help me out with that one? Just running/debugging the GetAccountTransactions test should be sufficient to see the problem in action.

Thanks and cheers

@fudgebucket27
Copy link
Owner

yep will take a look!

@modersohn
Copy link
Collaborator Author

modersohn commented Mar 2, 2022

I've spent a bit more time researching this.

  1. The only timestamp we have for a transaction, is the timestamp from the block this transaction was part of.

  2. Which is odd, because in the iOS wallet app I see a different timestamp, presumably from when I placed the order

  3. Timestamp is only part of Block_filter, it is not part of Transaction_filter4.

  4. Finally it seems one filter the top query category, so this won't work for block timestamp:

         query swap
           {
             orderbookTrades (first: 10,
               where: {
                 fillAmountBorSA: false
                 fillAmountBorSB: false
             })
              {
               id
               block (
                 where:
                 {timestamp_gt: 1643908528}
               ){
                 timestamp
               }
               accountIdA
               accountIdB
               fillAmountBorSA
               fillAmountBorSB
               fillBA
               fillBB
               fillSA
               fillSB
               feeA
               feeB
               tokenA {
                 symbol
                 decimals
               }
               tokenB {
                 symbol
                 decimals
               }
             }
         }
    
  5. So it seems we're out of luck?

  6. No wonder the official explorer can't offer filtering, but this will eventually have to be rectified, imagine someone accumulating many thousands of transactions over the years.

  7. Would your fork of the subgraph (mentioned here hosted services on thegraph are being sunsetted eventually #50) offer us a solution?

  8. Could you possibly ask/feature request this on discord?

modersohn added a commit to modersohn/Lexplorer that referenced this issue Mar 2, 2022
* commented out non-working code for GetAccountTransactions with
  date range - does not seem to be supported right now, see fudgebucket27#57
* disabled start/stop Date edits from export dialog
@fudgebucket27
Copy link
Owner

  1. yeh the fork of the subgraph aint gonna help as its a complete copy of the original subgraph. i just wanted to deploy it to the decentralized mainnet of subgraph as the hosted service is still centralized.

  2. The devs have never replied to any feature requests that ive seen posted in any relevant channels there. Also the explorer and the subgraph are made by contractors apparently so we would have to raise this issue in those relevant repositories.

@modersohn
Copy link
Collaborator Author

Thanks for confirming my suspicions. I went ahead and opened an issue in the original subgraph repository (deliberately not linking it).

If everything else fails, I need to search for the range of block numbers and then use the block id for filtering.

@modersohn
Copy link
Collaborator Author

PR #61 works around the limitation by getting the first and last block id within the timespan and then uses Transaction_filter blockgte/lte to achieve the same effect. Unfortunately that means an additional request but at least it is working!

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