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

# Rates

> Returns a full table of dual hedge rate proposals for all configured currency pairs. Each rate represents a pair of customer and supplier leg proposals routed through the functional currency. Partners can pre-fetch and cache these rates for both legs.



## OpenAPI

````yaml GET /dual-hedge-offline-rates
openapi: 3.1.0
info:
  title: Grain API
  version: 1.0.0
  description: >-
    Grain's API provides a comprehensive set of endpoints for managing hedging,
    spot transactions, pricing, and fund movements - enabling seamless
    integration of FX workflows into your platform. Each API call follows REST
    conventions, uses secure authentication, and returns standardized responses
    for consistency across environments.
  license:
    name: Creative Commons Attribution 3.0
  contact:
    name: Grain Finance
    url: https://docs.grainfinance.co
    email: support@grainfinance.co
  termsOfService: https://grainfinance.co/terms-of-service/
  x-apiClientRegistration:
    url: https://grainfinance.co/partners
servers:
  - url: https://api.grainfinance.co/v1
    description: Grain API
security: []
tags:
  - name: Hedges
    description: >-
      Hedge objects represent transactions that lock exchange rates for future
      dates. A single hedge locks an exchange rate for a future transaction
      between two currencies.
  - name: Dual Hedges
    description: >-
      A dual hedge mitigates FX risk by automatically generating two linked
      hedge legs - a customer leg and a supplier leg - both routed through the
      customer's functional currency. This structure reduces exposure to
      currency fluctuations for both cash flow and accounting purposes, while
      allowing independent tracking and reporting of each hedge leg.
  - name: Customers
    description: >-
      Customer objects represent your end customers on the Grain platform. A
      customer must be created before a hedge or spot transaction can be
      initiated.
  - name: Pricing
    description: >-
      Pricing endpoints provide access to FX rates for currency pairs that are
      not being hedged. These endpoints can be used for live rate display or
      bulk retrieval to support high-volume quoting workflows.
  - name: Spots
    description: >-
      Spot objects represent currency conversions executed for immediate or
      near-term settlement.
  - name: Conversions
    description: >-
      Conversion objects represent currency conversions executed for immediate
      or near-term settlement.
  - name: Wallets
    description: Endpoints to view balances, manage funding, and perform transfers.
paths:
  /dual-hedge-offline-rates:
    get:
      tags:
        - Dual Hedges
      description: >-
        Returns a full table of dual hedge rate proposals for all configured
        currency pairs. Each rate represents a pair of customer and supplier leg
        proposals routed through the functional currency. Partners can pre-fetch
        and cache these rates for both legs.
      operationId: Offline Quotes
      parameters:
        - description: |-
            Optional query parameter specifying currency pairs.
            Multiple pairs can be provided as a comma-separated list.
            Please encode the query param beforehand.
            For example, ?pairs=EURUSD%2CGBPEUR represents ?pairs=EURUSD,GBPEUR
          in: query
          name: pairs
          required: false
          schema:
            type: string
      responses:
        '200':
          description: Offline Dual Rates Retrieved
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetOfflineDualRatesResponse'
        '400':
          description: >-
            The request failed because it is not well-formed or is syntactically
            incorrect or violates schema.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: >-
            Authentication failed due to missing authorization header, or
            invalid authentication credentials.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: The request failed because the resource does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: >-
            The request failed because it is either semantically incorrect or
            has failed business validation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OfflineRatesInvalidRequestError'
        '500':
          description: The request failed because an internal server error occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - api-key: []
components:
  schemas:
    GetOfflineDualRatesResponse:
      properties:
        functionalCurrency:
          type: string
          description: Represent the functional currency of the partner.
          example: EUR
        tenorCalculationDate:
          type: string
          description: >-
            Date in ISO 8601 format yyyy-MM-dd.

            This is the date that will be used to calculate the difference in
            days between the offline revision creation date and the hedge future
            endAt date.

            The difference in days will be used to find the right tenor in the
            offline table.
          example: '2023-12-21'
        validUntilTs:
          type: number
          format: double
          description: >-
            Unix timestamp of expiration for the specific revision.

            Indicates the maximum duration during which this revision is valid
            for accepting hedge requests.
          example: 1703770471
        rates:
          $ref: '#/components/schemas/IPartnerDualRatesByTenorResponse'
        revision:
          type: number
          format: double
          description: >-
            Unique identifier for the offline rates revision. This id is used
            later to accept an offline rate.
          example: 156
      required:
        - functionalCurrency
        - tenorCalculationDate
        - validUntilTs
        - rates
        - revision
      type: object
      description: >-
        Represents the response of an offline dual rates request, including a
        revision snapshot with a time-to-live (TTL) indicating validity.

        Rates are organized by currency pair, with each pair associated with
        rates for various tenors.
    ErrorResponse:
      description: An API Error
      properties:
        message:
          type: string
          description: A short explanation of the error.
          example: Can't perform this action
        reason:
          type: string
          description: A detailed description of the reason for the failure.
          example: >-
            Supplied object is in *Cancelled* state, which prevents performing
            this action
      required:
        - message
      type: object
      additionalProperties: false
    OfflineRatesInvalidRequestError:
      description: An API Error
      properties:
        message:
          type: string
          description: A short code of the error.
          example: CURRENCY_PAIRS_INVALID
        reason:
          type: string
          description: A detailed description of the reason for the failure.
          example: >-
            Invalid format for the 'pairs' parameter. Each pair must include two
            currencies concatenated, and multiple pairs should be
            comma-separated. eg: EURUSD,GBPUSD
      required:
        - message
      type: object
      additionalProperties: false
    IPartnerDualRatesByTenorResponse:
      properties: {}
      additionalProperties:
        properties:
          '7':
            $ref: '#/components/schemas/InnerDualRateByTenor'
          '14':
            $ref: '#/components/schemas/InnerDualRateByTenor'
          '30':
            $ref: '#/components/schemas/InnerDualRateByTenor'
          '60':
            $ref: '#/components/schemas/InnerDualRateByTenor'
          '90':
            $ref: '#/components/schemas/InnerDualRateByTenor'
          '120':
            $ref: '#/components/schemas/InnerDualRateByTenor'
          '150':
            $ref: '#/components/schemas/InnerDualRateByTenor'
          '180':
            $ref: '#/components/schemas/InnerDualRateByTenor'
          '210':
            $ref: '#/components/schemas/InnerDualRateByTenor'
          '240':
            $ref: '#/components/schemas/InnerDualRateByTenor'
          '270':
            $ref: '#/components/schemas/InnerDualRateByTenor'
          '300':
            $ref: '#/components/schemas/InnerDualRateByTenor'
          '330':
            $ref: '#/components/schemas/InnerDualRateByTenor'
          '360':
            $ref: '#/components/schemas/InnerDualRateByTenor'
        required:
          - '360'
          - '330'
          - '300'
          - '270'
          - '240'
          - '210'
          - '180'
          - '150'
          - '120'
          - '90'
          - '60'
          - '30'
          - '14'
          - '7'
        type: object
      type: object
      example:
        USDMXN:
          '7':
            '7': 20.417557
          '14':
            '7': 20.4176
            '14': 20.43836
          '30':
            '7': 20.41811
            '14': 20.43955
            '30': 20.48901
          '60':
            '7': 20.419121
            '14': 20.44655
            '30': 20.49801
            '60': 20.57601
          '90':
            '7': 20.431121
            '14': 20.469955
            '30': 20.49901
            '60': 20.588101
            '90': 20.655895
          '120':
            '7': 20.445421
            '14': 20.488955
            '30': 20.52212
            '60': 20.588101
            '90': 20.675295
            '120': 20.736896
          '150':
            '7': 20.467231
            '14': 20.491052
            '30': 20.58913
            '60': 20.628103
            '90': 20.696212
            '120': 20.756834
            '150': 20.820784
          '180':
            '7': 20.485262
            '14': 20.511089
            '30': 20.599162
            '60': 20.658111
            '90': 20.7262189
            '120': 20.776855
            '150': 20.850123
            '180': 20.895173
          '210':
            '7': 20.495427
            '14': 20.531376
            '30': 20.61911
            '60': 20.673787
            '90': 20.746512
            '120': 20.79001
            '150': 20.868908
            '180': 20.9017322
            '210': 20.982573
          '240':
            '7': 20.501275
            '14': 20.568922
            '30': 20.638009
            '60': 20.689201
            '90': 20.7589105
            '120': 20.815097
            '150': 20.88991
            '180': 20.9416654
            '210': 20.999219
            '240': 21.064359
          '270':
            '7': 20.533312
            '14': 20.5701129
            '30': 20.645689
            '60': 20.70933
            '90': 20.7820018
            '120': 20.845088
            '150': 20.91334
            '180': 20.97550416
            '210': 21.027219
            '240': 21.087219
            '270': 21.127955
          '300':
            '7': 20.56772
            '14': 20.5998477
            '30': 20.66901
            '60': 20.72901
            '90': 20.8001
            '120': 20.86501
            '150': 20.92501
            '180': 20.98501
            '210': 21.04501
            '240': 21.10501
            '270': 21.16501
            '300': 21.208609
          '330':
            '7': 20.59811
            '14': 20.612275
            '30': 20.67901
            '60': 20.73901
            '90': 20.8101
            '120': 20.87501
            '150': 20.935056
            '180': 20.9950551
            '210': 21.0450199
            '240': 21.1050123
            '270': 21.1650154
            '300': 21.225019
            '330': 21.268019
          '360':
            '7': 20.62459
            '14': 20.629922
            '30': 20.68901
            '60': 20.74901
            '90': 20.8201
            '120': 20.887716
            '150': 20.94701
            '180': 21.00701
            '210': 21.06701
            '240': 21.12701
            '270': 21.18701
            '300': 21.24701
            '360': 21.28701
      description: >-
        Dual rates information organized by currency pairs and tenors.

        The structure includes currency pairs as keys, each associated with a
        nested object containing tenors and corresponding rate.
    InnerDualRateByTenor:
      properties:
        '7':
          type: number
          format: double
        '14':
          type: number
          format: double
        '30':
          type: number
          format: double
        '60':
          type: number
          format: double
        '90':
          type: number
          format: double
        '120':
          type: number
          format: double
        '150':
          type: number
          format: double
        '180':
          type: number
          format: double
        '210':
          type: number
          format: double
        '240':
          type: number
          format: double
        '270':
          type: number
          format: double
        '300':
          type: number
          format: double
        '330':
          type: number
          format: double
        '360':
          type: number
          format: double
      required:
        - '7'
      type: object
  securitySchemes:
    api-key:
      type: http
      scheme: basic
      description: >-
        Basic authentication using the partner API keys from
        https://console.grainfinance.co/keys

````