Projects by Sharvina · Algorithms, markets & governance

PROJECTS / ECONOMICS IN THE BROWSER

Questions.
Made runnable.

A collection of working models, open assumptions and things worth testing.

06 interactive models / Open source / Built to be questioned

A wireframe world crossed by a stepped price signal. An illustration of connected economic systems.

THE WORLD, WITH A FEW VARIABLES LEFT OPEN.

SHARVINA / THE 60-SECOND PATH

Two questions.
Evidence you can open.

I study how rules distribute access and influence, from DAO votes to India’s admissions counselling.

01 / DAO GOVERNANCE

4 of 15 outcomes changed.

The preprint reweights observed votes by square root. It holds behaviour fixed; it does not predict what voters would do under new rules.

Read the original SSRN preprint ↗
02 / MULTI-ROUND ALLOCATION

One tier lost in 50/50 paired trials.

Early Freeze forfeited an upgrade for one selected synthetic applicant. Repeated withdrawal scenarios make this a conditional finding, not a student-wide regret rate.

Inspect every paired result ↗
ONE ENGINEERING CHALLENGE

A seat assigned. A match missing.

A displacement could update a program’s list without updating the winner’s own state. A regression test now checks both records and the displaced applicant.

Open the regression test ↗

TWO FLAGSHIP PROJECTS / GOVERNANCE + ALLOCATION

Who gets a seat?
Who gets a say?

Two projects about allocation and influence. The findings below are bounded by the data and assumptions behind them.

01 / SSRN WORKING PAPER & COMPUTATIONAL PIPELINE

Arbitrum governance counterfactuals

Sharvina’s work: researched and wrote the SSRN preprint and pursued the subsequent Sybil study. Original pipeline ↗ · Contribution record ↗

HEADLINE RESULT / SSRN PREPRINT

Square-root reweighting changed the winning choice in 4 of 15 sampled Arbitrum proposals (26.7%).

Data & limitations · Reported in the SSRN preprint; selected high-turnout proposals, not all DAO decisions. Reweighting holds observed votes fixed. The Sybil preview below is a separate analytical model.

Stack Python · NumPy · pandas · Matplotlib · requests · Snapshot GraphQL

Scope Paper: ~850,000 Snapshot vote records / 15 proposals. Repo includes pagination and reconstruction checks; complete raw ballots are not archived.

Grounding & checks

  • Archived grounding: 15 proposal records report 866,320 votes in total; this is not a count of unique voters.
  • Voting-power scale: 42.1m–240.5m recorded Snapshot score per proposal. Scores are not dollars or unique token holdings.
  • Inspect: proposal IDs and metadata · aggregation and provenance. Metadata totals differ from the paper’s processed ballot count.
Under the hood · architecture & edge cases
  1. Snapshot GraphQL → paginated vote collection
  2. Choice mapping → linear / square-root tallies
  3. Reconstruction checks → outcome comparison

An edge case that changes the conclusion

At nine equal wallets and an opposing gap of 2W, the added weight is exactly 2W: a tie. A strict reversal first occurs at ten wallets. The implementation checks both the boundary and the integer immediately below it.

(√k − 1)W > G

Read the strict-boundary checks ↗. Four published W/G summaries imply minimum equal-split counts of 4, 7, 230 and 894 wallets. These are analytical thresholds from summaries, not observed exploits. The collector still needs robust handling of equal-timestamp page boundaries. Complete raw ballots are not archived here; this preview checks the analytical calculation, not an observed attack.

IDENTITY SPLITTING / FIXED TOKEN BUDGET

One balance. Many voices.

Equal splits, no identity cost and fixed opposing tally. Analytical illustration, not an observed attack.

02 / ALLOCATION MECHANISMS

JoSAA allocation audit

Sharvina’s work: framed the counselling-fairness question and developed the original matching, quota and multi-round audit project. Contribution record ↗

KEY MODEL RESULT

Early Freeze cost the selected applicant one preference tier in 50/50 paired trials.

Data & limitations · Single-round applicant DSIC is established theory. This project studies implementation and multi-round decisions using synthetic preferences.

Stack Python standard library · pytest · JavaScript ES modules · SVG · GitHub Pages

Grounding & checks

  • Target: university-admissions allocation: 60 applicants / 17 programs in the static audit, 80 applicants in the dynamic audit. Synthetic preferences; no documented official source/year for the sample cutoff table.
  • Check: 50 paired trials concern one selected applicant and four possible upstream withdrawal sets, repeatedly sampled. Each pair shares the same withdrawal; trial-level matches are published.
  • Measured locally: 1,081 matching runs in 1.62 s median; five timed samples after warm-up, Python 3.9.6, macOS ARM64. Timing record ↗
Under the hood · architecture & edge cases
  1. Sample ranks → synthetic preferences
  2. DA kernel → round actions → paired withdrawals
  3. Assignment ledger → assertions → versioned JSON

What broke during development

A later, higher-priority applicant could win a seat in the program list while their own current_match stayed empty. The repair updates both sides of the assignment.

assert allocation["P"] == ["higher"]
assert higher.current_match == "P"
assert lower.current_match is None

Read the displacement regression ↗

Performance boundary: program-side sorting and a list queue make this an inspectable small-market implementation. The timing is for this synthetic workload, not a national-scale or browser benchmark.

Interface hypothesis: preview which upgrades Freeze rules out before asking an applicant to commit. This requires user testing; it is not a validated policy recommendation.

COUNTERFACTUAL PREVIEW / TWO APPLICANTS

A vacancy. Two decisions.

Illustrative two-seat example. The linked audit uses larger synthetic cohorts.

RESEARCH DEVELOPMENT / WHAT CHANGED + WHAT IS VERIFIED

The objections
became the next question.

DAO / START → CHALLENGE → FOLLOW-UP

Reweighting is only the start.

Sharvina’s initial line of inquiry was quadratic voting. The preprint compared outcomes with observed votes held fixed. In editorial feedback on a rejected submission, an editor questioned the novelty of changed outcomes and noted that capital concentration could respond to new voting rules.

That objection prompted the Sybil follow-up: what happens when one balance is split among identities? The equal-split model isolates one response; it still does not model endogenous concentration or actual voter behaviour.

Follow the analytical extension ↗
JoSAA / MOTIVATION → MODEL → BOUNDARY

Fair in which round?

Living in India amid the JEE admissions race made Sharvina curious about counselling fairness. The project connects matching theory to explicit quota rules and Freeze, Float and Slide decisions.

The distinction that matters: single-round DSIC is established theory; it does not settle the consequences of an irreversible action when later vacancies appear. The synthetic audit explores that narrower question, without claiming to validate official JoSAA outcomes.

Read method, results & limitations ↗
VALIDATION / EVIDENCE STATUS

Preprint ≠ peer review.

Public: SSRN working paper, source histories, benchmark JSON and automated checks. The hosted technical notes are project documentation.

Author-reported: editorial feedback and rejection, paraphrased here from private correspondence. The correspondence is not published for independent verification; the feedback is not an endorsement.

No independently verified user study, external replication or peer-reviewed acceptance is presented. Internal tests support reproducibility, not external validation.

Inspect internal CI ↗

ONE COMPUTATIONAL LABORATORY / SIX ESTABLISHED MODELS

Learn the mechanism.
Then stress-test it.

An educational companion to the two research projects: six implementations of established finance and economics models, with synthetic inputs, seeded runs and shared numerical checks. These are not six original research papers.

LAB PREVIEW / MARKET MICROSTRUCTURE

From the quote
to the actual fill.

HEADLINE MODEL RESULT / SEED 42

A 1,200-share sweep consumes ten price levels and pays 52.808 bps against the $100 midpoint in the default book.

Data & limitations · Synthetic, static single-venue order book. No cancellations, hidden orders, exchange fees or latency.

Stack JavaScript ES modules · SVG · node:test · GitHub Actions / Pages

Collection Six models, including market microstructure, AMMs, hedging, portfolio tails, bank networks and auctions.

Grounding & checks

  • Real friction: a displayed quote covers limited liquidity. The model exposes the fills behind the average execution price.
  • Checks: price priority, FIFO at the same price, partial fills and book exhaustion each have explicit tests.
  • Reproduce: seed 42 and the full input set are carried into the simulator link and numerical exports.
Under the hood · architecture & edge cases
  1. Seed + controls → synthetic resting orders
  2. Price/time sort → fills → remaining quantity
  3. Shared model output → SVG, explanation and export

When liquidity runs out

An unfilled market order must not invent a fill or become a resting limit order. The fill ledger preserves the unexecuted remainder; try a 4,000-share order in the preview.

Read the exhaustion and FIFO tests ↗. This implementation sorts an array and removes filled orders from its front; a production exchange would need different data structures and execution constraints.

THE EXPERIMENT COLLECTION / 01—06

Choose a world.
Change its rules.

Six ways to investigate markets, risk and incentives. Each model includes adjustable assumptions, worked examples, checks and downloadable results.

Markets ↘Risk & networks ↘Incentives ↘

01 / HOW TRADES BECOME PRICES.

Market execution

Illustration for Order-book execution, not simulated output

EXPERIMENT 01 / DATA STRUCTURES & MATCHING

Order-book execution ↗

Why does a large trade pay more than the price on the screen?

SEEDED MODEL EXAMPLE / SEED 42

1,200 shares consume ten price levels: VWAP $100.528 and 52.808 bps cost against the $100 midpoint.

Grounding & checks

  • Real friction: Price–time priority, partial fills and exhausted liquidity.
  • Validation: FIFO and no-invented-liquidity assertions.
GitHub · Model source ↗

Limitations · Static synthetic book; no cancellations, hidden liquidity or latency.

Stack JavaScript ES modules · SVG · node:test · GitHub Pages

Computation 40 resting orders · price/time matching · fill ledger

What can I explore?

Fill-by-fill execution, VWAP and the cost of consuming liquidity.

The maths, code & limitations →
Illustration for Automated market makers, not simulated output

EXPERIMENT 02 / NONLINEAR PRICING & INVARIANTS

Automated market makers ↗

What does an automated market maker charge for a large trade?

SEEDED MODEL EXAMPLE / SEED 42

A 1,000 A swap against 5,000 A reserves receives 83,124.896 B after a 0.3% fee. Separately, a doubled external price implies −5.719% LP return relative to holding, before fees.

Grounding & checks

  • Real friction: A swap changes reserves; fees alter the invariant.
  • Validation: Zero-fee identity, fee growth and doubled-price divergence.
GitHub · Model source ↗

Limitations · Two-token constant-product model; no arbitrage path, MEV or fee-income forecast.

Stack JavaScript ES modules · SVG · node:test · GitHub Pages

Computation Closed-form reserve accounting · two sampled curves

What can I explore?

Swap output, price impact, fee accounting and LP divergence loss.

The maths, code & limitations →

02 / WHAT A RISK MEASURE OR A HEDGE CAN LEAVE OUT.

Risk & networks

Illustration for Discrete delta hedging, not simulated output

EXPERIMENT 03 / STOCHASTIC SIMULATION

Discrete delta hedging ↗

If an option can be replicated, why does a real hedge still lose money?

SEEDED MODEL EXAMPLE / SEED 42

Even with matched 20% pricing/path volatility, discrete hedging produces $0.934 sample P&L dispersion across 600 paths at weekly rebalancing and 2 bps costs.

Grounding & checks

  • Real friction: More rebalancing also means more transaction costs.
  • Validation: Paired cost/no-cost paths and a self-financing cash ledger.
GitHub · Model source ↗

Limitations · GBM paths and discrete rebalancing; no volatility surface, jumps or real execution.

Stack JavaScript ES modules · SVG · node:test · GitHub Pages

Computation 600 seeded GBM paths · 52 intervals · self-financing ledger

What can I explore?

Replication error, trading costs and volatility misspecification.

The maths, code & limitations →
Illustration for Portfolio tail risk, not simulated output

EXPERIMENT 04 / LINEAR ALGEBRA & STATISTICS

Portfolio tail risk ↗

Can two models agree on volatility and disagree on how bad losses get?

SEEDED MODEL EXAMPLE / SEED 42

Holding analytic volatility at 11.857%, switching Gaussian shocks to standardized t₅ changes worst-5% mean loss from 17.704% to 19.742% in the seeded example.

Grounding & checks

  • Real friction: The same covariance can hide very different tail losses.
  • Validation: Covariance construction, weight sums and seeded tail comparisons.
GitHub · Model source ↗

Limitations · Synthetic stationary returns; tail estimates depend on the assumed distribution.

Stack JavaScript ES modules · SVG · node:test · GitHub Pages

Computation 12,000 return draws · 1,326 grid portfolios · covariance-preserving sampling

What can I explore?

Covariance, a grid frontier and losses beyond the 95% quantile.

The maths, code & limitations →
Illustration for Interbank contagion, not simulated output

EXPERIMENT 05 / GRAPHS & FIXED POINTS

Interbank contagion ↗

How can a loss at one bank reach a bank that never held the damaged asset?

SEEDED MODEL EXAMPLE / SEED 42

In the default eight-bank ring, a 100-unit loss at Bank 1 produces three secondary defaults and 55.702 units of outside-creditor losses.

Grounding & checks

  • Real friction: A creditor’s asset is another bank’s liability.
  • Validation: Hand-solved chain, limited liability and clearing residual.
GitHub · Model source ↗

Limitations · Stylized fixed liabilities and pro-rata clearing; no liquidity runs or fire sales.

Stack JavaScript ES modules · SVG · node:test · GitHub Pages

Computation 8 banks + outside creditor · iterative pro-rata clearing

What can I explore?

Payment shortfalls and secondary defaults across three networks.

The maths, code & limitations →

03 / HOW THE RULES CHANGE THE WAY PEOPLE BID.

Incentives & allocation

Illustration for Auction design, not simulated output

EXPERIMENT 06 / GAME THEORY & PAIRED EXPERIMENTS

Auction design ↗

Can different payment rules raise the same expected revenue?

SEEDED MODEL EXAMPLE / SEED 42

With five bidders and no reserve, both formats have $66.67 theoretical expected revenue. The 10,000 paired draws estimate $66.776 versus $66.713.

Grounding & checks

  • Real friction: Revenue equivalence depends on bidders and payment rules.
  • Validation: Shared value draws and analytic no-reserve revenue.
GitHub · Model source ↗

Limitations · Independent uniform private values and risk-neutral bidders; no collusion or entry costs.

Stack JavaScript ES modules · SVG · node:test · GitHub Pages

Computation 10,000 paired value draws · reserve-aware first-price bids

What can I explore?

Equilibrium bids, reserves, sale rates and expected seller revenue.

The maths, code & limitations →

THE METHOD / FROM QUESTION TO CODE

The interesting part is
where the model breaks.

Every experiment starts with assumptions. Read them, test a boundary case, and inspect the code before trusting a result.

Read the field guide ↗
Related: JoSAA allocation audit ↗   ·   DAO Sybil resilience ↗