Repository navigation
Feat/web redesign - #10
Merged
Merged
Conversation
lib/sim.ts reproduces, in the same integer arithmetic, the settlement split, the credit contract's repayment accounting (principal and fee parts, the reserve's 10% of fees), draw terms, the period minimum, provisions, default losses and vault share pricing with the virtual offset. Offer estimates call the underwriter's own @runway/scoring, now a web dependency (the lockfile gains only the workspace link). lib/live.ts reads the gateway oracle's INR rate and the vault. test/sim.test.ts pins it to hand-worked values: 36.68 / 33.345454 / 3.334546 for a 400 USDC sale at 9.17%, a 10 USDC fee split 9.000002 to lenders and 0.999998 to the reserve, the live testnet deposit of 200 USDC minting 199.820179 shares at price 1.000899, and the offer decisions (grade C at 42.50 for three 400 windows, declines for too new, uneven and low revenue).
A palette built on #274245 (ink) and #DFD6AE (sand): light sand surfaces with ink text, and ink bands with sand text for the header, hero and footer. Fraunces headings, Manrope body. The UI kit keeps its components and props and adds what explanations and previews need: page headers, card descriptions, info tips, "How this works" panels, callouts, step lists, preview boxes, progress bars, and error messages that translate contract codes into what to do next. A logo, an icon set, an animated money-flow diagram, scroll reveals and count-up numbers, all switched off under prefers-reduced-motion. The sticky header gets a mobile menu and highlights the current page; a footer links the guides and checks. Revenue windows are labelled by clock time, with the window in progress in sand.
/simulator has four live calculators, each showing its formulas with the numbers entered: the offer the underwriter would compute from a list of revenue windows (score parts, grade, limit and what bounds it, fee, repay share), a loan repaid sale by sale (principal, fee, reserve, merchant, still owed, and the per-period minimum), a lender's shares and their value after a repaid, late or defaulted loan (from the live vault), and the INR gateway's conversion at the live oracle rate with where the rupees and USDC sit. Presets cover the common cases, including the ones that get an offer declined.
/docs has eight pages written for newcomers: an overview and quick start; guides for merchants (every field, the revenue-window rules, decline reasons, loan states, the period minimum, rupee payouts, troubleshooting), lenders (shares, returns, withdrawals, risks) and customers (the quote checks, statuses, UPI); the INR gateway as a float plus an off-chain treasury, with its formulas and flows; worked examples following one loan through every balance; how to check each claim; and a glossary, FAQ and error-code table. JUDGES.md points to the docs and the simulator.
An ink hero with the animated money flow and calls to action, live testnet numbers (vault value, share price, active loans, rupee float, each waiting for its own read), a one-minute explanation, the four steps, an interactive payment split, what each role can do, how rupees and crypto enter and leave, what can be verified, a 30-minute quick start and an FAQ.
- Merchant: a landing page before connecting; registration previews the accounts it creates and warns if the wallet isn't registered with USDC; the dashboard's "next step" reads the on-chain state (windows with revenue, the live window clock, an offer estimate, the loan period's minimum and countdown), with copy and open for the link. - Capital: a step tracker, what each offer number means, and a live preview of the fee, owed amount, scaled repay share and period minimum while choosing how much to draw. - Settings: the order to do things in, and payouts in rupees at the live rate. - Pay: where the payment goes (the loan's share and the merchant's), a three-step crypto guide, and a USDC estimate before a UPI QR. - Lend: your position, the meaning of every vault number, and previews of shares for a deposit and USDC or rupees for a withdrawal. - Verify and Audit: what each check proves. Tested components keep every label, test id and button name.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
What this does
Redesigns the web app so a first-time visitor (merchant, lender, customer or judge) can use it without reading a guide, and adds in-app docs and simulators.
Look and feel
#274245("ink") and yellow sapling#DFD6AE("sand"), with Fraunces headings and Manrope body text.prefers-reduced-motion.Home page
Simulator (
/simulator)Four live calculators, each showing its formulas filled in with your numbers:
@runway/scoringcode.apply_regularsplit for each sale.Docs (
/docs)Eight pages: overview and quick start, merchants, lenders, customers, rupees and the INR gateway (who holds the rupees), worked examples with every balance, trust and checks, and a glossary with FAQ and error codes.
Every page explains itself and previews actions
ERR_COOLDOWN→ "The 120-second waiting period isn't over yet").Under the hood
apps/web/lib/sim.tsmirrors the contracts' integer maths exactly.test/sim.test.tspins it to hand-worked numbers, including the live testnet deposit (200 USDC → 199.820179 shares) and the vault's 1.000899 share price.@runway/scoring. The lockfile change is the 3-line workspace link only.Verified
next build --webpack: all 19 routes generated.