> For the complete documentation index, see [llms.txt](https://docs.familio.trade/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.familio.trade/around-the-family/leaderboard-feed-live.md).

# Leaderboard, feed and live updates

The website is not the chain. The chain is the source of truth; an **indexer** copies events into a database so lists, cards and Telegram can render without scanning every log on every page load.

## How the indexer works

A cron job runs **every minute**: `eth_getLogs` from the factory (new families) and from every known vault, then upserts into Supabase (`family_vaults`, `family_events`, `family_members`, `family_bags`). Events are keyed on `(tx_hash, log_index)` so a replay is a no-op.

Robinhood Chain produces on the order of 10 blocks per second. Each tick walks a bounded window (thousands of blocks), writes the cursor after each chunk, and splits a failing log range rather than wedging forever. The global pass stays a few blocks behind the tip so a lagging RPC cannot skip a block; anything a fast path misses, the cron still covers.

**Per-vault real-time.** When a family page is open, the browser watches the vault and `POST`s `/api/v1/family/sync` as soon as it sees a new log, or when a transaction you just sent confirms. That indexes **that vault** to the tip in seconds instead of waiting for the next cron minute. Many tabs collapse into one sync (about three seconds of debounce). If a vault has no new events but its last mark is older than \~20 seconds, bags are re-valued anyway so a page you are watching still moves with the market.

## Snapshots and 7D return

Every **ten minutes** a second cron re-values every vault at current pool prices, writes a `family_snapshots` row, and rolls 7D / 30D.

**Value** is the vault's bags (and free quote) marked at those prices — "what the bags would fetch at the last snapshot." Thin tokens are marked to the pool they actually trade in, not to a wish. The leaderboard copy is explicit about that.

**7D return** is the change in **value per share** over about seven days, in basis points.

`value_per_share = (valueQuote + lifetime distributed) / totalShares`

Lifetime payouts are added back so a family that distributes cash does not look like it lost money. 30D is the same window at 30 days. All-time on a family page is `(value + distributed − contributed) / contributed` when contributed > 0.

New families have no baseline until the first snapshot; the leaderboard empty state says so.

Snapshots older than 90 days are pruned.

## The feed

The family page **is** the feed: joins, leaves, evicts, buys, sells, payouts, claims, locks, door changes, fee changes, pinned notes, crew changes, tracked/ignored bags, airdrops. Reactions and comments are off-chain (wallet-signed). Accounting rows (`FeesAccrued`) are stored but not shown.

The global tape on the home page is recent buys, sells and payouts across families. Private rows keep the verb and the token, lose amounts and hashes.

## Leaderboard

`/leaderboard` has two layers:

**Heads strip (top).** One row per **person** who runs families — aggregated across every vault they head. Ranked on the same metrics (7D, 30D, all-time, paid-out, riders). When a family **closes** or winds down, it drops off the **families** board below, but its history rolls into the head's career line (`endedCount`, lifetime paid out). Private families you are not in still rank at their true position; numbers blur for outsiders.

**Families board (below).** 7D, 30D, all-time, paid-out, biggest. Ranked on the real figures for every family (including private). Outsiders get the order and the names; private rows show "private" instead of the number.

Small and new vaults sit below the line until they have enough history to be comparable. Starting a family when the board is empty makes you number one by default.

## Auto-send keeper

The same ten-minute cron that snapshots also runs a **keeper**: for members who flipped auto-send **on**, if claimable quote is above a dust threshold, it calls `claimFor` and pushes to their wallet. With auto-send **off**, payouts stay claimable in the vault until the member pulls them. Toggling the flag is one small on-chain transaction (`setAutoSend`). Anyone could call `claimFor`; it can only pay the member. The keeper key is gas money, nothing else.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.familio.trade/around-the-family/leaderboard-feed-live.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
