> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mystockline.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Developer overview

> Chain, addresses, and how the pieces fit.

Stockline is the lending core on Robinhood Chain. Frontends read `RiskLens` and send user transactions through `PositionRouter` and `Zap`.

<Frame>
  <img className="block dark:hidden" src="https://mintcdn.com/mystockline/T8zoJG9K_VZWCC6Y/assets/diagrams/developers/architecture-light.svg?fit=max&auto=format&n=T8zoJG9K_VZWCC6Y&q=85&s=17e6c7ea647227e369c77236d248d3e0" alt="App and periphery sit above governance, the immutable core, the equity oracle, and the assets they read." width="1200" height="620" data-path="assets/diagrams/developers/architecture-light.svg" />

  <img className="hidden dark:block" src="https://mintcdn.com/mystockline/T8zoJG9K_VZWCC6Y/assets/diagrams/developers/architecture-dark.svg?fit=max&auto=format&n=T8zoJG9K_VZWCC6Y&q=85&s=488ff27d19d1fe463c15e9980efd7248" alt="App and periphery sit above governance, the immutable core, the equity oracle, and the assets they read." width="1200" height="620" data-path="assets/diagrams/developers/architecture-dark.svg" />
</Frame>

|           | Testnet                           | Mainnet                               |
| --------- | --------------------------------- | ------------------------------------- |
| Name      | Robinhood Chain testnet           | Robinhood Chain                       |
| Chain ID  | 46630                             | 4663                                  |
| Addresses | [Addresses](/resources/addresses) | Same page, when a mainnet file exists |

Testnet USDG and faucet stocks use 18 decimals. Mainnet USDG is 6 decimals when that network is added. Do not assume 18.

How to read a position: resolve `bookId` from `RiskRegistry.bookIdOf(collateral)` or from [Books](/concepts/books-and-tiers). Call `RiskLens.snapshot(account)` for health, max borrow, per-book collateral, debt, and liquidation price. `uiMultiplier` is display only.

Gas is sponsored in the Stockline app via an embedded smart account. Your app can use any EOA or 4337 account.

## How the pieces fit

| Layer  | Contracts                                                    | What you do with them                                                                                                       |
| ------ | ------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------- |
| Read   | `RiskLens`, `RiskRegistry`, `EquityOracle`                   | Read health, max borrow, the line, book parameters, and the regime. No transactions.                                        |
| Act    | `PositionRouter`, `Zap`                                      | Open, add to, and close loans in one transaction. Zap swaps USDC, USDT, or ETH into USDG on the way in.                     |
| Core   | `Stockline`, `USDGPool`, `LiquidationModule`, `FeeCollector` | Immutable accounting. Call `Stockline` directly only when the router does not fit. Never call `LiquidationModule` directly. |
| Govern | `Timelock`, `Guardian`                                       | Parameter changes after a delay. Pause on `Stockline` only.                                                                 |

Every user action on `Stockline` has an `onBehalfOf` overload. A router can act for an account only after that account calls `setOperator(router, true)`, or signs `setOperatorWithSig`. The Stockline app does this once per account.

Every write on the core is gated by the oracle regime. `supplyCollateral`, `repay`, and `deleverage` are always live. `borrow` and `withdrawCollateral` need `LIVE`. Read [Market hours](/developers/market-hours) before you build a button that can be disabled on a weekend.

## ABIs

Each file is copied from Foundry output at build. Pin the file you integrate against.

| Contract          | ABI                                      |
| ----------------- | ---------------------------------------- |
| Stockline         | [Download](/abis/Stockline.json)         |
| USDGPool          | [Download](/abis/USDGPool.json)          |
| RiskRegistry      | [Download](/abis/RiskRegistry.json)      |
| InterestRateModel | [Download](/abis/InterestRateModel.json) |
| LiquidationModule | [Download](/abis/LiquidationModule.json) |
| FeeCollector      | [Download](/abis/FeeCollector.json)      |
| EquityOracle      | [Download](/abis/EquityOracle.json)      |
| Timelock          | [Download](/abis/Timelock.json)          |
| Guardian          | [Download](/abis/Guardian.json)          |
| PositionRouter    | [Download](/abis/PositionRouter.json)    |
| Zap               | [Download](/abis/Zap.json)               |
| RiskLens          | [Download](/abis/RiskLens.json)          |
| CreatorFeeRouter  | [Download](/abis/CreatorFeeRouter.json)  |
| Emissions         | [Download](/abis/Emissions.json)         |

Addresses: [Addresses](/resources/addresses). Guides: [TypeScript](/developers/getting-started/typescript), [Read borrowing power](/developers/positions/borrowing-power), [Liquidators](/developers/liquidators).
