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

# Get pool detail

> One pool, with its price history and the caveats that apply to it.

For a pool holding a tokenized stock, `stock_reference` compares the pool's
price against the stock's own. They drift: the pool trades around the clock
while the stock trades in a session, and that gap is what a liquidity
provider is quoting against overnight.



## OpenAPI

````yaml /v2/combined_spec.json get /v2/risk_yield/pools/{pool_id}
openapi: 3.1.0
info:
  title: Compass API
  description: Compass Labs DeFi API
  version: 0.0.1
servers:
  - url: https://api.compasslabs.ai
    description: Production server
security:
  - ApiKeyAuth: []
paths:
  /v2/risk_yield/pools/{pool_id}:
    get:
      tags:
        - Risk Yield
      summary: Get pool detail
      description: >-
        One pool, with its price history and the caveats that apply to it.


        For a pool holding a tokenized stock, `stock_reference` compares the
        pool's

        price against the stock's own. They drift: the pool trades around the
        clock

        while the stock trades in a session, and that gap is what a liquidity

        provider is quoting against overnight.
      operationId: v2_risk_yield_pools_{pool_id}
      parameters:
        - name: pool_id
          in: path
          required: true
          schema:
            type: integer
            description: The pool id, as returned by `GET /pools`.
            title: Pool Id
          description: The pool id, as returned by `GET /pools`.
        - name: chain
          in: query
          required: true
          schema:
            type: string
            enum:
              - robinhood
            title: Chain
            default: robinhood
        - name: depth_words
          in: query
          required: false
          schema:
            type: integer
            maximum: 16
            minimum: 1
            default: 4
            title: Depth Words
          description: >-
            How many 256-tick words either side of the current price to read for
            the liquidity distribution. More is a wider picture and more node
            calls.
        - name: history
          in: query
          required: false
          schema:
            type: string
            enum:
              - 24h
              - 7d
              - 30d
            title: PoolHistory
            default: 7d
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DexPoolDetailResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-codeSamples:
        - lang: python
          label: Python (SDK)
          source: |-
            from compass_api_sdk import CompassAPI, models


            with CompassAPI(
                api_key_auth="<YOUR_API_KEY_HERE>",
            ) as compass_api:

                res = compass_api.risk_yield.risk_yield_pools_pool_id_(pool_id=174842, chain=models.V2RiskYieldPoolsPoolIDChain.ROBINHOOD, depth_words=4, history=models.PoolHistory.SEVEND)

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { CompassApiSDK } from "@compass-labs/api-sdk";

            const compassApiSDK = new CompassApiSDK({
              apiKeyAuth: "<YOUR_API_KEY_HERE>",
            });

            async function run() {
              const result = await compassApiSDK.riskYield.riskYieldPoolsPoolId({
                poolId: 174842,
                chain: "robinhood",
                depthWords: 4,
                history: "7d",
              });

              console.log(result);
            }

            run();
components:
  schemas:
    DexPoolDetailResponse:
      properties:
        pool:
          $ref: '#/components/schemas/DexPoolInfo'
        on_chain:
          anyOf:
            - $ref: '#/components/schemas/PoolOnChainState'
            - type: 'null'
        liquidity_distribution:
          items:
            $ref: '#/components/schemas/LiquidityBucket'
          type: array
          title: Liquidity Distribution
        hourly:
          items:
            $ref: '#/components/schemas/PoolHourlyPoint'
          type: array
          title: Hourly
        stock_reference:
          anyOf:
            - $ref: '#/components/schemas/StockReference'
            - type: 'null'
        warnings:
          items:
            type: string
          type: array
          title: Warnings
          description: Things worth knowing before providing liquidity here.
      type: object
      required:
        - pool
      title: DexPoolDetailResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    DexPoolInfo:
      properties:
        pool_id:
          type: integer
          title: Pool Id
        dex_version:
          $ref: '#/components/schemas/DexVersion'
        address:
          anyOf:
            - type: string
            - type: 'null'
          title: Address
          description: v3 pools have their own address; v4 pools share a manager.
        pool_key:
          type: string
          title: Pool Key
          description: The v4 PoolId, or the v3 pool address. Unique per chain.
        token0:
          $ref: '#/components/schemas/DexTokenRef'
        token1:
          $ref: '#/components/schemas/DexTokenRef'
        fee_ppm:
          type: integer
          title: Fee Ppm
        fee_pct:
          type: string
          title: Fee Pct
        tick_spacing:
          anyOf:
            - type: integer
            - type: 'null'
          title: Tick Spacing
        hooks:
          anyOf:
            - type: string
            - type: 'null'
          title: Hooks
        pair_class:
          $ref: '#/components/schemas/PairClass'
        stock_token:
          anyOf:
            - type: string
            - type: 'null'
          title: Stock Token
        meme_token:
          anyOf:
            - type: string
            - type: 'null'
          title: Meme Token
        stock_ticker:
          anyOf:
            - type: string
            - type: 'null'
          title: Stock Ticker
        launchpad_origin:
          anyOf:
            - $ref: '#/components/schemas/Launchpad'
            - type: 'null'
        watched:
          type: boolean
          title: Watched
          description: >-
            Whether the indexer follows this pool closely. Unwatched pools carry
            a price but no trailing metrics.
        lp_open:
          type: boolean
          title: Lp Open
          description: Whether anyone may add liquidity, or a hook forbids it.
        lp_earns_fees:
          type: boolean
          title: Lp Earns Fees
          description: >-
            Whether an external liquidity provider receives the swap fee.
            **False for every launchpad-graduated pool on this chain**, whose
            hook takes the fee for the protocol and the creator. Those pools
            trade heavily and pay you nothing.
        lp_fee_note:
          anyOf:
            - type: string
            - type: 'null'
          title: Lp Fee Note
          description: Why, in a sentence, when `lp_earns_fees` is false.
        tvl_usd:
          anyOf:
            - type: string
            - type: 'null'
          title: Tvl Usd
        tvl_confidence:
          anyOf:
            - type: string
            - type: 'null'
          title: Tvl Confidence
        volume_24h_usd:
          anyOf:
            - type: string
            - type: 'null'
          title: Volume 24H Usd
        volume_7d_usd:
          anyOf:
            - type: string
            - type: 'null'
          title: Volume 7D Usd
        fees_24h_usd:
          anyOf:
            - type: string
            - type: 'null'
          title: Fees 24H Usd
        fees_7d_usd:
          anyOf:
            - type: string
            - type: 'null'
          title: Fees 7D Usd
        swaps_24h:
          anyOf:
            - type: integer
            - type: 'null'
          title: Swaps 24H
        fee_apr_24h:
          anyOf:
            - type: string
            - type: 'null'
          title: Fee Apr 24H
          description: Percent. Exactly 0 when LPs earn no fees.
        fee_apr_7d:
          anyOf:
            - type: string
            - type: 'null'
          title: Fee Apr 7D
        fee_apr_full_range_24h:
          anyOf:
            - type: string
            - type: 'null'
          title: Fee Apr Full Range 24H
          description: >-
            Percent, and the honest one: what a *new* full-range dollar would
            have earned, rather than the return on liquidity already
            concentrated where the price happens to be.
        realized_vol_24h:
          anyOf:
            - type: string
            - type: 'null'
          title: Realized Vol 24H
          description: Annualized standard deviation, in percent.
        realized_vol_7d:
          anyOf:
            - type: string
            - type: 'null'
          title: Realized Vol 7D
        il_adjusted_apr_7d:
          anyOf:
            - type: string
            - type: 'null'
          title: Il Adjusted Apr 7D
          description: >-
            Fee APR less the expected impermanent-loss drag, `sigma^2/8`
            annualized. The number to sort by: a pool paying 200% on an asset
            that moves 400% is not a better position than one paying 20% on an
            asset that moves 30%.
        price:
          anyOf:
            - type: string
            - type: 'null'
          title: Price
          description: token1 per token0, decimals-adjusted.
        price_change_24h_pct:
          anyOf:
            - type: string
            - type: 'null'
          title: Price Change 24H Pct
        locked_share:
          anyOf:
            - type: string
            - type: 'null'
          title: Locked Share
          description: >-
            Fraction of the liquidity that can never be withdrawn — a
            launchpad's graduation position. It will not leave when the price
            moves, and it is not depth anyone chose to provide.
        meme_fdv_usd:
          anyOf:
            - type: string
            - type: 'null'
          title: Meme Fdv Usd
        ranked:
          type: boolean
          title: Ranked
          description: >-
            False when the pool is too thin for its APR to mean anything (under
            20 swaps in 24h or $1,000 of TVL). Such pools sort last.
          default: true
        created_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Created At
        last_swap_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Swap At
        stats_updated_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Stats Updated At
      type: object
      required:
        - pool_id
        - dex_version
        - pool_key
        - token0
        - token1
        - fee_ppm
        - fee_pct
        - pair_class
        - watched
        - lp_open
        - lp_earns_fees
      title: DexPoolInfo
    PoolOnChainState:
      properties:
        block_number:
          type: integer
          title: Block Number
        sqrt_price_x96:
          type: string
          title: Sqrt Price X96
        tick:
          type: integer
          title: Tick
        price:
          anyOf:
            - type: string
            - type: 'null'
          title: Price
        liquidity:
          type: string
          title: Liquidity
        lp_fee_ppm:
          anyOf:
            - type: integer
            - type: 'null'
          title: Lp Fee Ppm
          description: >-
            The fee the pool charges right now. A dynamic-fee pool can quote
            zero, which is what LPs earning nothing looks like from the chain.
        fee_growth_global0_x128:
          anyOf:
            - type: string
            - type: 'null'
          title: Fee Growth Global0 X128
        fee_growth_global1_x128:
          anyOf:
            - type: string
            - type: 'null'
          title: Fee Growth Global1 X128
        fetched_at:
          type: string
          format: date-time
          title: Fetched At
      type: object
      required:
        - block_number
        - sqrt_price_x96
        - tick
        - liquidity
        - fetched_at
      title: PoolOnChainState
      description: |-
        Read live, at request time.

        The indexer's numbers are minutes old, which is fine for ranking and not
        fine for sizing a position on an asset that moves this fast.
    LiquidityBucket:
      properties:
        tick_lower:
          type: integer
          title: Tick Lower
        tick_upper:
          type: integer
          title: Tick Upper
        price_lower:
          anyOf:
            - type: string
            - type: 'null'
          title: Price Lower
        price_upper:
          anyOf:
            - type: string
            - type: 'null'
          title: Price Upper
        liquidity:
          type: string
          title: Liquidity
        is_current:
          type: boolean
          title: Is Current
          description: Whether the pool's price sits in this bucket.
          default: false
      type: object
      required:
        - tick_lower
        - tick_upper
        - liquidity
      title: LiquidityBucket
      description: >-
        Active liquidity between two initialized ticks.


        This is the shape of the book. A range you open outside where the
        liquidity

        is will earn nothing while the price stays where it is; a range inside a

        wall of it earns a small share of a large pot.
    PoolHourlyPoint:
      properties:
        hour_start:
          type: string
          format: date-time
          title: Hour Start
        open:
          anyOf:
            - type: string
            - type: 'null'
          title: Open
        high:
          anyOf:
            - type: string
            - type: 'null'
          title: High
        low:
          anyOf:
            - type: string
            - type: 'null'
          title: Low
        close:
          anyOf:
            - type: string
            - type: 'null'
          title: Close
        close_source:
          anyOf:
            - type: string
            - type: 'null'
          title: Close Source
          description: >-
            SWAP when the hour traded, SNAPSHOT when it did not — an hour with
            no trades still has a price, and a series with holes cannot be used
            to measure volatility.
        volume_usd:
          anyOf:
            - type: string
            - type: 'null'
          title: Volume Usd
        lp_fees_usd:
          anyOf:
            - type: string
            - type: 'null'
          title: Lp Fees Usd
        swap_count:
          type: integer
          title: Swap Count
          default: 0
        tvl_usd_end:
          anyOf:
            - type: string
            - type: 'null'
          title: Tvl Usd End
      type: object
      required:
        - hour_start
      title: PoolHourlyPoint
    StockReference:
      properties:
        ticker:
          type: string
          title: Ticker
        reference_price_usd:
          anyOf:
            - type: string
            - type: 'null'
          title: Reference Price Usd
          description: From the Chainlink feed, multiplier applied.
        reference_source:
          anyOf:
            - type: string
            - type: 'null'
          title: Reference Source
        reference_updated_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Reference Updated At
        pool_implied_price_usd:
          anyOf:
            - type: string
            - type: 'null'
          title: Pool Implied Price Usd
        premium_pct:
          anyOf:
            - type: string
            - type: 'null'
          title: Premium Pct
          description: How far above (or below) the reference the pool is trading.
        reference_is_stale:
          type: boolean
          title: Reference Is Stale
          description: >-
            True when the feed has not posted for over two heartbeats — normal
            over a weekend, when the stock is not trading and the pool is.
          default: false
      type: object
      required:
        - ticker
      title: StockReference
      description: >-
        The pool price against the stock's own reference price.


        A tokenized stock trades in its pool around the clock while the
        underlying

        trades in a session. The gap between them is real information — it is
        what

        an LP is quoting against overnight — and it is not visible from either

        number alone.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    DexVersion:
      type: string
      enum:
        - V3
        - V4
      title: DexVersion
      description: >-
        Which Uniswap deployment a pool belongs to.


        v3 pools hold their own tokens and pay LPs the fee tier. v4 pools live
        in a

        shared PoolManager and may route the fee through a hook, which is where
        the

        launchpad pools' zero LP yield comes from.
    DexTokenRef:
      properties:
        address:
          type: string
          title: Address
        symbol:
          anyOf:
            - type: string
            - type: 'null'
          title: Symbol
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        decimals:
          anyOf:
            - type: integer
            - type: 'null'
          title: Decimals
          description: Null until read on chain; never assume 18 on this chain.
        kind:
          $ref: '#/components/schemas/DexTokenKind'
          default: OTHER
        price_usd:
          anyOf:
            - type: string
            - type: 'null'
          title: Price Usd
        price_source:
          anyOf:
            - $ref: '#/components/schemas/PriceSource'
            - type: 'null'
        price_confidence:
          anyOf:
            - type: string
            - type: 'null'
          title: Price Confidence
          description: 0-1. Below 0.6 the USD figures derived from it are indicative only.
        stock_ticker:
          anyOf:
            - type: string
            - type: 'null'
          title: Stock Ticker
      type: object
      required:
        - address
      title: DexTokenRef
      description: A token as every Risk Yield response describes it.
    PairClass:
      type: string
      enum:
        - MEME_STOCK
        - STOCK_STABLE
        - STOCK_ETH
        - STOCK_STOCK
        - MEME_ETH
        - MEME_STABLE
        - ETH_STABLE
        - OTHER
      title: PairClass
      description: What kind of pair a pool is, which is what the product is sorted by.
    Launchpad:
      type: string
      enum:
        - PONS_V1
        - PONS_V2
        - POOLS_TRADE
        - BAGS
      title: Launchpad
    DexTokenKind:
      type: string
      enum:
        - STOCK
        - STABLE
        - NATIVE
        - WRAPPED_NATIVE
        - MAJOR
        - LAUNCHPAD_MEME
        - OTHER
      title: DexTokenKind
    PriceSource:
      type: string
      enum:
        - CHAINLINK
        - RH_REST
        - LLAMA
        - POOL
        - PEG
      title: PriceSource
      description: >-
        Where a USD price came from, best first.


        Returned with every price because they are not equally trustworthy: a

        Chainlink feed is a measurement, a price read off a shallow pool is
        closer

        to a rumour.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        Your Compass API Key. Get your key
        [here](https://www.compasslabs.ai/dashboard).

````