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

DB Invariant tests #1

Open
7 of 9 tasks
Schwartz10 opened this issue Feb 27, 2024 · 6 comments
Open
7 of 9 tasks

DB Invariant tests #1

Schwartz10 opened this issue Feb 27, 2024 · 6 comments
Assignees

Comments

@Schwartz10
Copy link

Schwartz10 commented Feb 27, 2024

Macro invariants (system wide aggregates):

  • Aggregate total shares in the DB should match the iFIL.totalSupply()
  • Total agents in database should match agentCount in the agentFactory link
  • Total principal added up for all agents in the DB should match pool.totalBorrowed()
  • Total assets from DB match pool.totalAssets.
  • The total active miners in the DB should match the total miners in the contracts link
  • Total interest paid across all agents should match the total lifetime earnings (TBD on how to do this - should be able to deduce this from iFIL price x iFIL circulation?)

Micro invariants (on a per account basis):

  • The Agent's liquid FIL should match what's in the contract link
  • The agent's principal should match db vs contracts link
  • Depositor total shares should match iFIL.balanceOf()
@jimpick
Copy link
Collaborator

jimpick commented Mar 15, 2024

@jimpick jimpick transferred this issue from another repository Mar 18, 2024
@jimpick
Copy link
Collaborator

jimpick commented Mar 18, 2024

#3 implements Total Assets, Total Borrowed and Agent Count

@Schwartz10
Copy link
Author

Schwartz10 commented Jun 10, 2024

  • Depositors balance should never be 0
  • iFIL price matches pool.convertToAssets(1e18) (ganzai just coded up a ifil price db fetcher)

@jimpick
Copy link
Collaborator

jimpick commented Jun 18, 2024

#12 implements Pool Total Assets, Total Borrowed and Agent Count

@jimpick
Copy link
Collaborator

jimpick commented Jun 19, 2024

#14 Checks the miner counts for each agent on the node and compares to the API

@jimpick
Copy link
Collaborator

jimpick commented Jun 26, 2024

#16 Checks the agent principal using the econ endpoint (which calls it liabilities)

jimpick added a commit that referenced this issue Jul 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