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

Reconcile relays with balance ledgers occasionally #224

Open
Tracked by #220
plor opened this issue May 2, 2024 · 1 comment
Open
Tracked by #220

Reconcile relays with balance ledgers occasionally #224

plor opened this issue May 2, 2024 · 1 comment
Assignees

Comments

@plor
Copy link
Contributor

plor commented May 2, 2024

Currently there are two ledgers in the postgres database, PaymentLedger and RelayLedger. Payment ledger is CREDITed when a user burns ERC-20 via event watcher, this increases the balance on the account. As relays are used the RelayLedger is CREDITed to indicate usage (also refers to app and chain (endpoint) for reference. We need a process that occasionally (daily, weekly, etc) DEBITs both ledgers with the corresponding tx to balance them. Basically a DEBIT to the PaymentLedger will show up on the accounting page as ledgers used. The DEBIT on the relay ledger will indicate that those relays have been accounted for.

I'm not sure where is the best place for this process to live as it is a sort of admin function that we don't have in our stack currently. It should be as simple as a SQL query, so perhaps we program it into the backend and have an external process call it on whatever cadence we wish. Thoughts?

@plor
Copy link
Contributor Author

plor commented May 6, 2024

I'm thinking a good place for this until we find something better will be a backend endpoint (we'll want some authorization). We can decide to manually run it for now, come up with a plan for automating.

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

3 participants