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

Activity Table drops some transfer events #138

Closed
NIXBNT opened this issue Jan 22, 2025 · 1 comment
Closed

Activity Table drops some transfer events #138

NIXBNT opened this issue Jan 22, 2025 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@NIXBNT
Copy link
Collaborator

NIXBNT commented Jan 22, 2025

When doing the ranking of stratinfo to join onto the transfer events, sometimes the transfer actions inherit a "deleteme" tag due to incorrect sorting.
To fix the issue an extra order by deleteme asc should be added to the RankedCompleteInfo table beginning here: https://github.com/bancorprotocol/carbon-backend/blob/main/src/activity/activity.service.ts#L924

Note that the ordering and filtering was also updated from date to block_number

The corrected table

RankedCompleteInfo AS (
  SELECT
    ci.*,
    ROW_NUMBER() OVER (
      PARTITION BY vm.id
      ORDER BY
        ci.block_number DESC, deleteme asc
    ) AS rn
  FROM
    voucher_minimal vm
    LEFT JOIN complete_renamed ci ON ci.id = vm.id
    AND ci.block_number <= vm.block_number
),
@NIXBNT NIXBNT added the bug Something isn't working label Jan 22, 2025
@NIXBNT
Copy link
Collaborator Author

NIXBNT commented Jan 23, 2025

This is solved in recent query updates

@NIXBNT NIXBNT closed this as completed Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants