Skip to content

Manual Liquidation forked Mainnet test#176

Open
jordanschalm wants to merge 7 commits intomainfrom
jord/liquidation-test-mainnet-fork
Open

Manual Liquidation forked Mainnet test#176
jordanschalm wants to merge 7 commits intomainfrom
jord/liquidation-test-mainnet-fork

Conversation

@jordanschalm
Copy link
Member

@jordanschalm jordanschalm commented Feb 19, 2026

This PR adds a test script for testing manual liquidation against an instance of forked Mainnet.

The test script:

  • modifies the Pool to use a mock DEX/oracle
  • creates a user and liquidator account
  • attempts liquidation on a healthy position and verifies that it fails
  • modifies the mock collateral pricing to cause the user position to become unhealthy
  • attempts liquidation and verifies that it succeeds
jordanschalm and others added 5 commits February 18, 2026 16:19
Shell script that exercises the full manual liquidation flow against a
running mainnet fork: configures mock oracle/DEX, creates user and
liquidator accounts, opens a position, verifies liquidation fails on a
healthy position, drops the FLOW price, then verifies liquidation
succeeds on the now-unhealthy position.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… config

- Relocated fork-test/ to integration/liquidation-fork-mainnet/
- Use a temporary copy of flow.json so the base config is never modified
- Overlay extra config (network, accounts, deployments) via -f flag
- Deploy FungibleTokenConnectors to fork (not present on mainnet)
- Store all test artifacts in gitignored tmp/ directory

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Uses __PROJECT_DIR__ placeholder expanded at runtime via sed,
keeping the template portable. Dynamic test accounts (fork-user,
fork-liquidator) are still written to a separate runtime config.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Make flow.json read-only while the test runs instead of creating a
temporary copy. This prevents the Flow CLI from writing merged config
(fork accounts, networks, deployments) back into the project file.
Remove the now-unnecessary flow.fork-test.json gitignore entry.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Instead of chmod or sed-rewriting paths, copy flow.json to
flow.fork-test.json at the project root so relative paths resolve
naturally. Deleted on exit via trap; gitignored for interrupted runs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jordanschalm jordanschalm marked this pull request as ready for review February 19, 2026 19:25
@jordanschalm jordanschalm requested a review from a team as a code owner February 19, 2026 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant