> ## Documentation Index
> Fetch the complete documentation index at: https://anypay-docs-update-api-reference-2026-06-22.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# YieldGetProviders

> List DeFi protocols available through the Trails earn system

## Overview

`YieldGetProviders` returns the DeFi protocols (providers) available through Trails' earn system — Aave, Morpho, Yearn, and others. Use the returned provider IDs as filter values for `YieldGetMarkets`.

The SDK's `useEarnProviders` hook wraps this endpoint — prefer it in React apps.

## Request Parameters

All fields are optional.

| Field    | Type   | Description                   |
| -------- | ------ | ----------------------------- |
| `limit`  | number | Number of providers to return |
| `offset` | number | Pagination offset             |

## Response

Returns `payload` containing an array of provider objects. Each provider includes:

| Field     | Description                                                             |
| --------- | ----------------------------------------------------------------------- |
| `id`      | Provider identifier — use as the `provider` filter in `YieldGetMarkets` |
| `name`    | Human-readable protocol name                                            |
| `url`     | Protocol website                                                        |
| `logoUrl` | Protocol logo image URL                                                 |

## Examples

### List all providers

```typescript theme={null}
const response = await fetch('https://trails-api.sequence.app/rpc/Trails/YieldGetProviders', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'X-Access-Key': 'YOUR_ACCESS_KEY',
  },
  body: JSON.stringify({}),
})

const { payload } = await response.json()
const providers = JSON.parse(payload)

providers.forEach(provider => {
  console.log(`${provider.id}: ${provider.name}`)
})
```

## SDK alternative

In React, use the `useEarnProviders` hook:

```tsx theme={null}
import { useEarnProviders } from '0xtrails'

const { data: providers } = useEarnProviders()
```

## See also

* [YieldGetMarkets](/api-reference/endpoints/yield-get-markets) — Filter markets by provider ID
* [Markets & Providers](/sdk/composable-actions/markets-and-providers) — SDK hooks reference


## OpenAPI

````yaml trails-api.gen.json post /rpc/Trails/YieldGetProviders
openapi: 3.0.0
info:
  title: Trails API
  version: 0.0.1
servers:
  - url: https://trails-api.sequence.app
    description: Trails API
security: []
paths:
  /rpc/Trails/YieldGetProviders:
    post:
      tags:
        - Trails
      summary: YieldGetProviders returns available yield protocol providers.
      description: >
        Returns the DeFi protocols (Aave, Morpho, Yearn, etc.) available through
        Trails' earn system.

        Use provider IDs as filter values for YieldGetMarkets.
      operationId: Trails-YieldGetProviders
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GetYieldProvidersRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetYieldProvidersResponse'
        4XX:
          description: Client error
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ErrorWebrpcEndpoint'
                  - $ref: '#/components/schemas/ErrorWebrpcRequestFailed'
                  - $ref: '#/components/schemas/ErrorWebrpcBadRoute'
                  - $ref: '#/components/schemas/ErrorWebrpcBadMethod'
                  - $ref: '#/components/schemas/ErrorWebrpcBadRequest'
                  - $ref: '#/components/schemas/ErrorInvalidArgument'
                  - $ref: '#/components/schemas/ErrorUnavailable'
        5XX:
          description: Server error
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ErrorWebrpcBadResponse'
                  - $ref: '#/components/schemas/ErrorWebrpcServerPanic'
                  - $ref: '#/components/schemas/ErrorWebrpcInternalError'
                  - $ref: '#/components/schemas/ErrorUnexpected'
components:
  schemas:
    GetYieldProvidersRequest:
      type: object
      properties:
        limit:
          type: integer
          format: int32
          description: Number of providers to return
        offset:
          type: integer
          format: int32
          description: Pagination offset
    GetYieldProvidersResponse:
      type: object
      required:
        - payload
      properties:
        payload:
          type: object
          description: JSON array of provider objects
          additionalProperties: true
    ErrorWebrpcEndpoint:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: WebrpcEndpoint
        code:
          type: number
          example: 0
        msg:
          type: string
          example: endpoint error
        cause:
          type: string
        status:
          type: number
          example: 400
    ErrorWebrpcRequestFailed:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: WebrpcRequestFailed
        code:
          type: number
          example: -1
        msg:
          type: string
          example: request failed
        cause:
          type: string
        status:
          type: number
          example: 400
    ErrorWebrpcBadRoute:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: WebrpcBadRoute
        code:
          type: number
          example: -2
        msg:
          type: string
          example: bad route
        cause:
          type: string
        status:
          type: number
          example: 404
    ErrorWebrpcBadMethod:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: WebrpcBadMethod
        code:
          type: number
          example: -3
        msg:
          type: string
          example: bad method
        cause:
          type: string
        status:
          type: number
          example: 405
    ErrorWebrpcBadRequest:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: WebrpcBadRequest
        code:
          type: number
          example: -4
        msg:
          type: string
          example: bad request
        cause:
          type: string
        status:
          type: number
          example: 400
    ErrorInvalidArgument:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: InvalidArgument
        code:
          type: number
          example: 2000
        msg:
          type: string
          example: Invalid argument
        cause:
          type: string
        status:
          type: number
          example: 400
    ErrorUnavailable:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: Unavailable
        code:
          type: number
          example: 2002
        msg:
          type: string
          example: Unavailable resource
        cause:
          type: string
        status:
          type: number
          example: 400
    ErrorWebrpcBadResponse:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: WebrpcBadResponse
        code:
          type: number
          example: -5
        msg:
          type: string
          example: bad response
        cause:
          type: string
        status:
          type: number
          example: 500
    ErrorWebrpcServerPanic:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: WebrpcServerPanic
        code:
          type: number
          example: -6
        msg:
          type: string
          example: server panic
        cause:
          type: string
        status:
          type: number
          example: 500
    ErrorWebrpcInternalError:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: WebrpcInternalError
        code:
          type: number
          example: -7
        msg:
          type: string
          example: internal error
        cause:
          type: string
        status:
          type: number
          example: 500
    ErrorUnexpected:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: Unexpected
        code:
          type: number
          example: 2001
        msg:
          type: string
          example: Unexpected server error
        cause:
          type: string
        status:
          type: number
          example: 500

````