feat(vibenet): add Liquidations validity transactions demo - #175
Open
haardikk21 wants to merge 2 commits into
Open
haardikk21 wants to merge 2 commits into
haardikk21 wants to merge 2 commits into
Conversation
Borrowers hold VibeLend positions near their liquidation price and a rival keeper liquidates with plain transactions. Users arm a validity liquidation ahead of time, pinned to the pool reserve, the position slot, and an expiry block, and compare how many blocks each side takes. Also extracts the Solidity/JSON highlighter into a shared CodeSnippet used by Race the Agent and Liquidations. Co-authored-by: OpenCode <opencode-noreply@coinbase.com>
Co-authored-by: OpenCode <opencode-noreply@coinbase.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Collaborator
🟡 Heimdall Review Status
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds Liquidations, a third validity-transactions demo at
/vibenet/demos/validity/liquidations.Borrowers (vibenet actors) keep VibeLend loans open near their liquidation price while the VIBE/USDV pool moves. A rival keeper liquidates with plain transactions about three seconds after a loan goes under water. The user can liquidate by hand, or arm a validity liquidation ahead of time that the sequencer includes the first block the price allows. The page shows how many blocks each liquidation took after the position went under water.
VibeLend (
lib/contracts/VibeLend.sol+ artifact): minimal lending market. VIBE collateral, USDV debt, spot price read from the AMM pool reserves. A position is liquidatable whencollateral * price * 80% < debt, andliquidate()pays the caller 5% of the collateral. It's deployed through Nick's CREATE2 proxy, so the UI predicts the address (lib/lending.ts).Validity predicates on an armed liquidation:
<=ceiling. The price check is reduced to a single reserve bound, derived in the page's advanced details.=its current value, so the tx is never included if the keeper or borrower changes the position first. It's dropped rather than reverted.<=expiry (15/30/60s).UI
+X VIBErewards read from theLiquidatedevent, and a recent-liquidations feed with blocks-under-water.Shared: extracted the Solidity/JSON highlighter from Race the Agent into
components/CodeSnippet.tsx. Race the Agent now uses it; its output is unchanged.Wiring: catalogue card, sitemap, metadata test, and a
trackValidityLiquidation(attempt, status)analytics helper (row added toAGENTS.md). llms.txt / agents.md are regenerated in a separate commit (the post-commit hook isn't installed in my clone, so I rannpm run llms && npm run agentsby hand with the external target).Depends on base/vibenet#66 (VibeLend deploy in setup + borrower/keeper actors). #66 is merged and deployed: VibeLend is live at
0x8bC80e109f90426554C1c2fD24f0c0036d104Da4and the host actors run the borrower and keeper roles. The UI computes the same address from the live USDV/pair.Linear: CHAIN-5663 (parent CHAIN-5660)
Screenshots
Validity Transactions index: new Liquidations card

Liquidations

Liquidations, dark mode, after a validity liquidation landed (1,250 VIBE earned)

Liquidations: advanced details

Race the Agent (shared CodeSnippet, no visual change intended)


Test plan
npx tsc --noEmit -p .cleannpx vitest run app/vibenet: 278 pass. New:lib/lending.test.ts(price, health, liquidation-price math, predicate/slot encoding),liquidations/attempts.test.ts(nonce gating, under-water tracking and reset on recovery, reward totals),components/CodeSnippet.test.ts, sitemap/metadata entriesnpx eslint app/vibenet/demos/validity: warnings only, no errorsnpm run llms -- --check: current