Concept · 01

Repo as Balance Sheet

Every repository is a tiny on-chain corporation. Assets, liabilities, income, expenses — viewable as a live financial statement at app.gitsea.io/r/<owner>/<name>.

In plain English

A repo today is just a folder of code. With GITSEA, it becomes a small entity with money in a treasury, splits paid to its contributors when work merges, money streaming in from repos that depend on it, and (eventually) the ability to borrow against future cash flow. Same idea as a tiny company, but with no paperwork — all on Base.

What it is

When a repository links to GITSEA, the protocol records a repo entity — an on-chain object identified by a bytes32 repoId (the keccak hash of "owner/name"). The entity has an owner address, a splits-config root (a hash pointing to off-chain asset.toml), and a token-by-token treasury.

From that moment, every economic event in the repo (a merge, a stream settlement, a credit draw, an insurance payout) flows through it.

How it works

The conceptual balance sheet has four ledgers:

LedgerWhat lives thereWhere it's tracked
AssetsTreasury balances per token, royalty receivables, escrowed bounty pools, underwriting collateral.RepoVault.balances[repoId][token]
LiabilitiesUnpaid contributor splits, underwritten insurance, debt drawn from credit lines.CreditLine.lines[id].owed, off-chain
IncomeRoyalty streams in, merge fees, sponsorships, governance rebates.RoyaltyRouter events + SplitsEngine events
ExpensesStorage (Filecoin/Arweave), audits paid from treasury, claim payouts.RepoVault Withdraw events

These compose into the standard equity equation. The repo's equity at any moment is:

equity(t) = assets(t) − liabilities(t)
        = treasury + receivables + collateral − splits_owed − debt_drawn − claims_open

A repo with negative equity (more drawn than is in the treasury) is still operational, but cannot draw further until the cash flow restores it.

What it looks like

Exampleacme/date-fp · live snapshotThursday 14:02 UTC

Assets · $4,287.12

  • Treasury: $4,212.40 (USDC $3,820 · GSEA $392.40)
  • Receivables (next epoch streams): $74.72

Liabilities · $5,000.00

  • Credit line drawn: $5,000.00 (collateralized by repo equity, 28 days remaining)

Income (epoch) · $87.40 MRR equivalent

  • 1,437 dependent repos streaming
  • 28 merge events × avg split $0.41
  • 4 active sponsorships

Expenses (epoch) · $12.10

  • Filecoin pinning: $0.40
  • Audit invoice draw: $5,000 amortized
  • Sleeper pool contribution: $0.20

Equity · −$712.88 (post-audit; positive within 9 epochs at current MRR)

Why it matters

Three things become possible the moment a repo has a balance sheet:

  1. Credit pricing. Lenders can read MRR, equity, and history. They price a credit line without a human in the loop.
  2. Insurance pricing. Underwriters can quote a merge insurance premium against revert rate × volume.
  3. Comparability. You can rank repos by real economic primitives, not by stars.

Where the data comes from

SourceWhat we read
GitHub App / Gitlawb peerCommits, PRs, contributors, dependency graph.
On-chain (Base)Splits, streams, credit, insurance, governance.
Filecoin / ArweaveStorage receipts, audit logs.
asset.tomlSplits, royalty overrides, insurance config.

Reading a balance sheet via SDK

import { GitSea } from "@gitsea/sdk";

const ga = new GitSea({ rpc: "https://base.publicnode.com" });
const sheet = await ga.repo("acme/date-fp").balanceSheet();

console.log(sheet.equity);          // bigint, wei
console.log(sheet.income.mrrUsd);   // 87.40
console.log(sheet.streams[0]);      // { from: "calendar-utils", rate: ... }

Gotchas