> ## 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.

# Stockline Documentation

> Buy stocks. Borrow against them. Earn on dollars.

<Card title="Stockline is live on testnet." img="https://mintcdn.com/mystockline/pS48XIpI7ezPciHd/assets/diagrams/using/testnet-light.svg?fit=max&auto=format&n=pS48XIpI7ezPciHd&q=85&s=b05dc16b1d247663f5b4d933543553bd" href="https://app.mystockline.xyz/faucet" cta="Open testnet" arrow width="1200" height="420" data-path="assets/diagrams/using/testnet-light.svg">
  Get free test money and try everything.
</Card>

Stockline is a lending protocol on Robinhood Chain where people buy US stocks, borrow dollars against them, and earn on their dollars. Borrowers put up stock tokens as collateral and take out USDG. Suppliers deposit dollars into one pool and earn the interest borrowers pay. The core is immutable; risk parameters sit behind a timelock; every balance and rule is readable onchain.

These docs cover the protocol end to end: how to use the app, the concepts behind every number, smart contract references, integration guides, and the STK token. Every page is also available as markdown for agents and tooling: append .md to any URL, or send an Accept: text/markdown header.

## Get familiar with Stockline

<CardGroup cols={2}>
  <Card title="Stockline 101" icon="https://mintcdn.com/mystockline/pS48XIpI7ezPciHd/assets/icons/cards/stockline-101.svg?fit=max&auto=format&n=pS48XIpI7ezPciHd&q=85&s=6f93e727adc05284469f86b191a48970" href="/introduction/stockline-101" width="48" height="48" data-path="assets/icons/cards/stockline-101.svg">
    Learn the basics.
  </Card>

  <Card title="Borrow" icon="https://mintcdn.com/mystockline/pS48XIpI7ezPciHd/assets/icons/cards/borrow.svg?fit=max&auto=format&n=pS48XIpI7ezPciHd&q=85&s=0831506e01e1b149d0d9844de20f7ff3" href="/using/borrow" width="48" height="48" data-path="assets/icons/cards/borrow.svg">
    Dollars against your stocks.
  </Card>

  <Card title="Earn" icon="https://mintcdn.com/mystockline/pS48XIpI7ezPciHd/assets/icons/cards/earn.svg?fit=max&auto=format&n=pS48XIpI7ezPciHd&q=85&s=8326efc27297821ea52c624c3a866764" href="/using/earn" width="48" height="48" data-path="assets/icons/cards/earn.svg">
    Your dollars, working.
  </Card>

  <Card title="Market hours" icon="https://mintcdn.com/mystockline/pS48XIpI7ezPciHd/assets/icons/cards/market-hours.svg?fit=max&auto=format&n=pS48XIpI7ezPciHd&q=85&s=395e1c236672d6b5a9f0c6dc064f58c5" href="/using/market-hours" width="48" height="48" data-path="assets/icons/cards/market-hours.svg">
    What changes on weekends.
  </Card>
</CardGroup>

## Safety

<CardGroup cols={2}>
  <Card title="If your stock falls" icon="https://mintcdn.com/mystockline/pS48XIpI7ezPciHd/assets/icons/cards/if-your-stock-falls.svg?fit=max&auto=format&n=pS48XIpI7ezPciHd&q=85&s=c1a5c5dbaefe9f1eb24c524ca3bd5e8d" href="/using/if-your-stock-falls" width="48" height="48" data-path="assets/icons/cards/if-your-stock-falls.svg">
    What gets sold, and when.
  </Card>

  <Card title="Security" icon="https://mintcdn.com/mystockline/pS48XIpI7ezPciHd/assets/icons/cards/security.svg?fit=max&auto=format&n=pS48XIpI7ezPciHd&q=85&s=b951dca9f96d21891bcb96b1cf0799a0" href="/resources/security" width="48" height="48" data-path="assets/icons/cards/security.svg">
    Audits, bug bounty, and access controls.
  </Card>
</CardGroup>

## Integrate Stockline

<CardGroup cols={2}>
  <Card title="Positions" icon="https://mintcdn.com/mystockline/pS48XIpI7ezPciHd/assets/icons/cards/positions.svg?fit=max&auto=format&n=pS48XIpI7ezPciHd&q=85&s=8ad445af452acd4ca9df9bbdcf9a1536" href="/developers/positions/borrowing-power" width="48" height="48" data-path="assets/icons/cards/positions.svg">
    Read and open loans.
  </Card>

  <Card title="Liquidators" icon="https://mintcdn.com/mystockline/pS48XIpI7ezPciHd/assets/icons/cards/liquidators.svg?fit=max&auto=format&n=pS48XIpI7ezPciHd&q=85&s=e985204da51e9d63b0641c3d18b6af78" href="/developers/liquidators" width="48" height="48" data-path="assets/icons/cards/liquidators.svg">
    Run one.
  </Card>
</CardGroup>

### Quickstart

<CodeGroup>
  ```typescript Read a position theme={"system"}
  import { createPublicClient, http, parseAbi } from "viem"
  import { addresses } from "./addresses" // /resources/addresses

  const lensAbi = parseAbi([
    "function maxBorrow(address account) view returns (uint256)",
    "function liquidationPrice(address account, uint16 bookId) view returns (uint256)",
  ])
  const client = createPublicClient({ transport: http() })
  const power = await client.readContract({
    address: addresses.riskLens,
    abi: lensAbi,
    functionName: "maxBorrow",
    args: [account],
  })
  ```

  ```typescript Open a loan theme={"system"}
  await wallet.writeContract({
    address: addresses.stockline,
    abi: coreAbi,
    functionName: "setOperator",
    args: [addresses.positionRouter, true],
  })
  await wallet.writeContract({
    address: addresses.positionRouter,
    abi: routerAbi,
    functionName: "openPosition",
    args: [bookId, supplyAmount, borrowAmount, emptyPermit],
  })
  ```

  ```typescript Zap in theme={"system"}
  await wallet.writeContract({
    address: addresses.zap,
    abi: zapAbi,
    functionName: "zapSupply",
    args: [usdc, amountIn],
  })
  ```

  ```typescript Read the regime theme={"system"}
  const regime = await client.readContract({
    address: book.oracle,
    abi: oracleAbi,
    functionName: "regime",
  })
  const canBorrow = regime === 0
  ```
</CodeGroup>

TypeScript, React, and Solidity walks live under [Getting started](/developers/getting-started/typescript).

## Quick links

<CardGroup cols={2}>
  <Card title="Addresses" icon="https://mintcdn.com/mystockline/pS48XIpI7ezPciHd/assets/icons/cards/addresses.svg?fit=max&auto=format&n=pS48XIpI7ezPciHd&q=85&s=9c56f17bc40a733df6d9d9b605ceba6f" href="/resources/addresses" width="48" height="48" data-path="assets/icons/cards/addresses.svg">
    Every contract, every network.
  </Card>

  <Card title="Parameters" icon="https://mintcdn.com/mystockline/pS48XIpI7ezPciHd/assets/icons/cards/parameters.svg?fit=max&auto=format&n=pS48XIpI7ezPciHd&q=85&s=37c1a45ec1f8e83500b97d459eafd730" href="/resources/parameters" width="48" height="48" data-path="assets/icons/cards/parameters.svg">
    Every book, every tier, live.
  </Card>
</CardGroup>

Start with Stockline 101 if you will use the app. Start with Developers if you will read a position. Start with Books and tiers if you need the live LTV table. Every number on Using Stockline pages links to Parameters or the concept page that generates it.
