Know what your protocol depends on and their Risk Scores propogating through Multi-hop graphs
A DeFi protocol is never just its own contracts. Behind every pool there's a proxy someone can upgrade, an admin key or multisig, a governance timelock and oracles from another team. Each of those depends on more contracts in turn. A protocol's real risk is the risk of that whole chain, but block explorers show one address at a time. Nothing puts the chain together and nothing tells you when a link in it changes.
Macaron is a risk engine built on a multi-hop dependency graph. Give it a protocol's core contracts and it walks outward hop by hop:
Each contract in the graph gets a risk score from seven checks: whether it's upgradeable, who the admin is, the multisig threshold, the timelock delay, oracle staleness, source verification and known incidents. Scores flow along the graph's edges, so a weak link two hops away still raises the protocol's overall score. You can see where the risk comes from, not just how big it is.
The checks are generic. EIP-1967 proxies, Safe multisigs, timelocks and Chainlink feeds turn up across most of DeFi, so adding a protocol mostly means giving Macaron its starting contracts.
The graph lives on Arkiv for structured querying. The raw evidence (full graph JSON, RPC trace log, bytecode) lives on Swarm, and each Arkiv entity links to its Swarm file. A Chainlink CRE workflow re-reads each protocol's key pointers from mainnet on a schedule. It hashes them into a fingerprint and rebuilds the graph only when something actually moved.
In the UI you can click any node to trace its path back to the core contract, filter by hop, open its Arkiv entity in the explorer and follow the RPC calls behind its score on the audit page.
For the hackathon we ran it end to end on Aave V3: 15 contracts across 3 hops, all written to Arkiv's Rabdi testnet. Next we plan to add more lending markets, DEXs and vaults and to link protocols to each other when one reads another's oracle or holds its tokens. Then a problem in one protocol shows up in the score of every protocol that depends on it.
There are four parts: ingestion, storage, the CRE watcher and the frontend. One of us built each part and we agreed the interfaces in docs/ first so everyone could work in parallel against mock data.
Ingestion (graph-service, TypeScript/Node) - The only protocol-specific step is the seed list of hop 0 contracts. For Aave we take it from the Aave address book. From there everything is generic. We read EIP-1967 implementation and admin slots straight from mainnet RPC to resolve proxies. We query the Safe Transaction API for signer sets and thresholds and follow AaveOracle.getSourceOfAsset() out to the Chainlink feeds. Verification status comes from Sourcify. The scorer is deterministic, so the same chain state always gives the same score. That was important because CRE has to be able to reproduce the result.
Storage (Arkiv + Swarm) -
We use three Arkiv entity types:
We chose that lifetime on purpose. A risk score nobody has re-checked in a week shouldn't be served as current. We index the fields the UI actually filters on (protocolId, hop, category, riskScore, sourcifyStatus) and store everything else as plain attributes. Big blobs go to Swarm. Arkiv only holds the reference, so queries stay small.
CRE workflow (@chainlink/cre-sdk, run with the CRE CLI) - A cron trigger reads 18 pointers from Aave on mainnet in one Multicall3 call at the finalized block: pool and configurator revisions, the registry getters, oracle sources for 5 assets, the emergency admin, the Safe threshold and owners and the governance executor. It sorts and keccak256-hashes them into a fingerprint and compares that with the fingerprint stored in Arkiv. If they match, it stops. If they differ, it calls POST /rebuild on graph-service, which re-ingests, re-scores and writes fresh Arkiv entities and Swarm evidence. The list of calls is in a shared fingerprint-spec.json, so CRE and graph-service always hash exactly the same thing.
Frontend (Next.js, TypeScript, Tailwind) - We draw the graph with our own SVG layout code, in hop lanes or a tree view. Node data is read from Arkiv with @arkiv-network/sdk. There's an audit page that walks through the 5 steps behind a score, with the exact storage slots and RPC calls.
What was hacky:

