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

Add foundry/anvil harness for simulating and testing #24

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

haydenshively
Copy link
Member

@haydenshively haydenshively commented Apr 14, 2023

This addition makes it possible to replay prior liquidations, at least ones that were triggered by interest accrual (as opposed to price change). Simply run yarn sim <block_number> where block number is set to be 1 block prior to the liquidation/warning in question.

This code can be adapted to create unit tests and/or extended to support simulation of liquidations caused by price change. For that we'll need to do web3.eth.extend(...) and use some of the special methods listed here.

I tested this using the block number in index-sim.ts, and borrower 0x73e662293453f7d019865362e47e4ce590322926 was in fact liquidated on the simulated chain.

@haydenshively
Copy link
Member Author

@IanWoodard this is fixed now :)

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

Successfully merging this pull request may close these issues.

1 participant