Repository navigation
feat(solvency): simulate agent_vault check_invariants and add public solvency page (#891) - #897
huangji6693-max wants to merge 1 commit into
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
|
Hi @huangji6693-max, please merge the latest
git fetch upstream
git merge upstream/main
git pushPlease merge rather than rebase or force-push, so review history stays intact. Thanks! |
|
Thanks for the work here, @huangji6693-max, and apologies for the earlier note asking you to merge main: I should have checked eligibility first. DukaPay Wave issues are worked only after applying on the issue through the Wave and being assigned. #891 was never assigned to you, and other contributors applied first, so I'm closing this PR. If you'd like to contribute, please apply on an open Wave issue and wait for assignment before starting. Thanks for understanding. |
Closes #891
Summary
Follow-up to #777 / #781:
GET /api/agents/solvency):sorobanService.simulateAgentVaultInvariants(agentAddresses)to simulatecheck_invariantsonagent_vaultfor all active agents and decode per-agent(agent, holds, float, max_allowed)tuples in stroops.getPublicSolvencyinbackend/src/controllers/agentMvpController.tsto combine indexedcollateral_balancewith on-chaincheck_invariantssimulation results (holds,float,maxAllowed), compute network-wide totals, and remove the unusedhaircut_bpsread path fromgetPublicSolvency.publicSolvencyRateLimiter(60 req/min per identity) and briefcacheServicecaching (agents:solvency:public, 30s TTL)./solvency):usePublicSolvencyhook infrontend/src/app/hooks/useApi.tsand public/[locale]/solvencypage (no wallet connection required).Invariant HoldsvsInvariant Violated), prominent violation alert banner when any invariant is violated, network totals, and a per-agent table with collateral, float, max allowed float, invariant status badge, and Stellar Explorer link.backend/src/__tests__/agentMvp.test.tscoveringno agents,holds, andviolated.frontend/src/app/[locale]/solvency/page.test.tsxcovering empty state, holds state with explorer link, and violated invariant alert.Verification
cd backend && npm test -- src/__tests__/agentMvp.test.ts && npm run typecheck— 7/7 tests passingcd frontend && npm test -- solvency/page.test.tsx && npm run i18n:validate && npm run typecheck— 3/3 tests passing