Skip to content

feat(liquidation): PEPL support for GIGAHDX liquidations#1466

Open
iamyxsh wants to merge 8 commits into
gigahdx-liquidationsfrom
ys-pepl-support-liquidation
Open

feat(liquidation): PEPL support for GIGAHDX liquidations#1466
iamyxsh wants to merge 8 commits into
gigahdx-liquidationsfrom
ys-pepl-support-liquidation

Conversation

@iamyxsh
Copy link
Copy Markdown
Contributor

@iamyxsh iamyxsh commented May 26, 2026

Summary

  • Adds PEPL (liquidation worker) support for GIGAHDX-collateralized positions: routes liquidate dispatch to liquidate_gigahdx when collateral is either GIGAHDX (asset 67) or stHDX (asset 670), since PEPL resolves the underlying reserve address
  • Multi-pool PEPL support: --pap-contract now accepts comma-separated addresses, worker tracks borrowers per-pool
  • Fixes zombienet local config: para_id 2032→2034 to match chainspec, max_candidate_depth 3→4 to match runtime's UNINCLUDED_SEGMENT_CAPACITY
  • Adds scripts/gigahdx-liquidation/ e2e test project (Mocha + ethers) for fork-based liquidation testing

Test plan

  • pallet-gigahdx — 130 tests passed
  • pallet-gigahdx-rewards — 30 tests passed
  • pallet-liquidation — 8 tests passed
  • pallet-staking — 67 tests passed
  • runtime-integration-tests (gigahdx + gigahdx_rewards) — 92 tests passed
  • cargo fmt --check — clean
  • TypeScript compilation — clean
  • Zombienet local: parachain blocks producing and finalizing past Upgrade Substrate and ORML #30 (verified twice)
  • No fork-test overrides in prod code (GigaHdxLiquidationAccount, scraper concurrency reverted)

🤖 Generated with Claude Code

iamyxsh and others added 2 commits May 22, 2026 19:16
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 26, 2026

Crate versions that have not been updated:

  • liquidation-worker-support: v1.2.0
  • hydradx: v15.0.2
  • pallet-liquidation: v2.5.0
  • scraper: v1.6.0

hydradx-runtime: cargo and spec versions don't match.

Runtime version has not been increased.

iamyxsh and others added 3 commits May 26, 2026 20:10
Add query helpers (queries.ts) and 6 test groups inspired by
integration-tests/src/gigahdx.rs:

- Preconditions: pool approval, borrower stake, oracle price
- Dispatch routing: stHDX-670 and GIGAHDX-67 both hit liquidate_gigahdx
- Negative cases: wrong debt asset, no position, healthy position
- Post-liquidation state: borrower stakes/gigahdx reduced, TotalLocked
- Sequential liquidations: multiple 1-HOLLAR calls progressively drain
- Staking lifecycle: gigaStake creates record, unstaked account is null

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…oncurrency)

GigaHdxLiquidationAccount was returning //Bob for fork-test
convenience — restore PalletId(*b"gigaliq!") derivation.
Scraper CONCURRENCY was reduced to 50 for lark2 proxy — restore 1000.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@iamyxsh iamyxsh changed the base branch from master to gigahdx-liquidations May 26, 2026 15:06
iamyxsh and others added 3 commits May 26, 2026 22:14
…teral

Liquidation execution tests need Bob with DOT on the MAIN AAVE pool
(see gotcha #12). On forks without that, tests now skip gracefully
instead of failing in the before() hook. Negative and staking tests
still run unconditionally.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- liquidator.ts: use gigaStake (like Martin's integration tests) instead
  of MAIN pool DOT supply — avoids EVM-side token funding issues
- Healthy-position test: use Bob (staked, no debt) instead of shared
  borrower whose HF drops from prior test groups' price crashes
- TotalLocked test: seized HDX re-locks under liq_account, so total
  is preserved not decreased

All 15 e2e tests pass on lark2 fork zombienet.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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