hackquest logo

ArbiScore

On-chain credit scores that lower your collateral: a Rust risk model on Arbitrum Stylus, with lending markets in Paxos USDG and test USDC that price every loan from your repayment history.

视频

项目图片 1
项目图片 2
项目图片 3
项目图片 4

技术栈

Rust
Solidity
Next
React
Ethers
Python
Stylus
Chainlink

描述

Every DeFi lender asks the same collateral of everyone. On Aave V3 on Arbitrum, any wallet can borrow up to 80% of its WETH's value, so it needs at least 125% collateral: a wallet with two years of clean repayments gets exactly the same terms as one created this morning, because the protocol can't tell them apart and has no way to chase bad debt. I sampled 20,857 wallets that had borrowed on Aave V3 on Arbitrum One before March 2026. In the next six months, 2.25% of them were liquidated. The other 97.75% got no credit for it.

ArbiScore scores a wallet's repayment history on-chain and lets a lending market use that score in the same transaction. Prime borrowers post 105%, then 112% and 118%, and Subprime borrowers post 125%, the same as Aave. A score only ever lowers collateral below the market rate: wallets are pseudonymous, so charging a bad borrower more would just send them elsewhere. New and bad histories both get market terms, so switching wallets never helps. For lenders, the point is that a proven borrower can borrow more against the same collateral, priced by their record.

How it works:

- The model. A fixed-point logistic regression in Rust, deployed on Stylus. It reads the wallet's latest 64 loans and weights each repayment by how recent it is, how big it was, and how long it was held. Loans repaid inside 14 days earn nothing, and every loan pays interest, so borrow-and-repay loops can't farm a score. I tested 1, 3 and 64 loops on a fresh wallet, and the score didn't move.

- The weights are fitted to real outcomes: 1,791 Aave borrowers, with features taken from their history before a cutoff and labels from whether they were liquidated in the 180 days after. I added guardrails that cost 0.03 AUC, because the unconstrained fit leaned on Aave activity and volume, which are cheap to farm. Then I tested on a second, earlier period without refitting. The shipped model held up in both periods (AUC 0.744, then 0.724 on the earlier one), while the unconstrained fit fell to 0.66 on at-risk wallets. One result didn't go my way: on the earlier period, my original hand-set weights scored slightly higher (0.735 vs 0.724). So the claim is a measured, stable model, not that fitting made it better. One caveat: the six-month label window includes April's rsETH exploit, when Aave froze WETH on Arbitrum for about a month, and that may have shifted liquidations. The earlier test period ends before the exploit, and the model held there too.

- Two ERC-4626 markets share one engine: Paxos USDG and a faucet test USDC. A repayment in either improves your terms in both. APR is fixed per loan (utilization plus a tier premium). Each tier's liquidation threshold sits below its borrow ratio, and the Chainlink ETH/USD feed has staleness checks.

- Hard to game. A wallet can hold at most 3 open loans per market, so many tiny loans can't buy a score. The 16 most recent liquidations always count, so new loans can't bury them. While any loan is overdue and unpaid, the score is capped at Subprime, and repaying late counts partly as a default: credit halves for every 5 days late, since the vault lets anyone liquidate a loan 3 days past due. I tested these with 102,000 fairness checks on 3,000 random histories and a set of attacks against the contracts; both are in the repo.

- Portable credit. New users can bring their Aave V3 history from Arbitrum One. A server indexes the wallet's history and signs it (EIP-712). The CreditImporter contract checks the signature, that it's your wallet, and that the wallet has no history yet.

Why Stylus, with real numbers: I ran the identical model through a Solidity engine and the Stylus engine on Arbitrum Sepolia. Scoring a full 64-loan history costs about 432k gas in Solidity and 213k in Stylus, so the live path is about 2× cheaper. Storage reads cost the same on both VMs and cap the gain; the arithmetic alone is about 6× cheaper. Solidity can run today's model, and the README says so. What Stylus buys is headroom: in a benchmark hook that runs the model 16 times over the same loans (the markets don't call it), Stylus is 11× cheaper.

The same model exists in Rust, Solidity and TypeScript, and all three return identical scores on 420 shared test vectors. The dashboard uses the TypeScript copy to re-check every on-chain score in your browser.

What isn't done:

- Collateral is test WETH, priced by the real Chainlink feed.

- The USDG pool is small (about 300 USDG), because the Paxos testnet faucet pays 100 USDG per request and was down for several days; a live USDG borrow and repay works. The test USDC market has 1,000,000 of liquidity and runs the same vault code.

- No keeper bot watches for liquidations, although liquidate() is implemented and fuzz-tested.

- The Aave importer trusts one attester key. Storage proofs are the fix, and they didn't fit in three weeks.

The Stylus engine was deployed with cargo stylus deploy from a pinned Docker build, and cargo stylus verify reproduces it exactly. Arbiscan can't show it as verified yet: its Stylus verifier stops at cargo-stylus 0.10.7, and this build needs 0.10.9.

A note on origins: this is a solo project. AI coding tools (Google Antigravity and Claude Code) proposed options and wrote most of the code; I chose the problem and made the product calls, and the README lists them with their costs. An unrelated ETHGlobal project from 2025 used the name ARBISCORE for a Q-learning idea; its repo has no scoring or lending code, and this project shares none of it.

Try it: https://arbiscore-openhouse.vercel.app

It opens in a sandbox with four sample borrowers, one per tier. Connect a wallet on Arbitrum Sepolia to use the live markets. The judge access code for the two demo Aave imports is available from the organisers.

本次黑客松进展

I researched the idea with Google Antigravity and started the repository on 19 September 2026, five days into the buildathon; I had no earlier prototype or codebase. During that research I also came across an older, unrelated project with the same name: ARBISCORE (https://ethglobal.com/showcase/arbiscore-0yqup) from ETHGlobal Agentic Ethereum (February 2025), which proposed a Q-learning credit agent on Stylus. Its repository is a Stylus template with an empty contract, so there was nothing to build on, and this project uses none of it. Everything below was built during the buildathon.

During the buildathon I:

- Deployed two lending markets (Paxos USDG and test USDC) on one shared Stylus credit engine on Arbitrum Sepolia. All the Solidity contracts are verified on Arbiscan and Sourcify. When the Paxos faucet came back, I seeded the USDG market and tested a live USDG borrow and repay.

- Measured Stylus against Solidity on Sepolia with the same model and the same inputs, instead of asserting a gas saving.

- Fitted the model's weights to about 1,800 real Aave V3 borrowers with no look-ahead, and tested them on a second, earlier period. The data, scripts and both results (including the one where the hand-set weights did better) are in research/fit-weights and the README.

- Built portable credit: attested Aave imports, restricted to your own wallet, with the two demo borrowers behind an access code, because Aave history is public and anyone could otherwise import someone else's good record.

- Closed six scoring and security holes, found through 102,000 fairness checks on random histories and attacks against the contracts:

- The engine owner could rewrite credit histories; demo mode is now off, so no one can.

- The Aave indexer silently dropped liquidations when a position was partly repaid; it now tracks positions and records every liquidation.

- An unpaid overdue loan faded over time, so a borrower who stopped paying slowly gained score. It now counts as a full default and caps the score at Subprime until it's repaid.

- Dust farming: 64 simultaneous $1 loans lifted a fresh wallet to Near-Prime for $0.18 of interest. The vault now allows 3 open loans per borrower per market.

- Burying: new loans could push old liquidations out of the scoring window. The engine now always counts the 16 most recent liquidations.

- Late repayments were cheap: a borrower who let two loans run two months overdue and then repaid them ended a tier higher than they started. The late part of a repayment now counts as a default, credit halves every 5 days late, and a loan repaid 15+ days late never scores above not having borrowed.

- Moved the Stylus build to a reproducible cargo-stylus Docker pipeline, and redeployed.

- Tightened the dashboard:

- Transactions are simulated before the wallet opens, and contract errors are shown in plain English.

- The ETH price is live from Chainlink everywhere.

- The layout works on phones.

- Aave imports are batched and cached, so they finish in a second or two.

- The sandbox has one sample borrower per tier, and it flags loans that on-chain rules would already let anyone liquidate.

- Connected wallets see their ETH, WETH, USDG and USDC balances, with faucet buttons for the test tokens.

- A wallet the engine has never seen shows "No score yet" at market terms, instead of a placeholder number.

- The dashboard reads the chain through a dedicated QuickNode endpoint, locked to the site's domain, so it stays responsive when the public RPC is busy.

融资状态

Not raised. ArbiScore is a solo, self-funded project started during this buildathon, and it's live on Arbitrum Sepolia only.

I'm open to grants and early-stage funding to take it toward mainnet. The next pieces of work are known and listed in the README:

- Replace the trusted Aave attester with storage proofs.

- Run a liquidation keeper.

- Refit the model's weights on more periods, then on ArbiScore's own repayment history.

- Get an external audit before any mainnet deployment.

队长
OOLAMILEYE DUDUYEMI
项目链接
部署生态
Arbitrum OneArbitrum One
赛道
DeFiInfra