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

# Calculate convenience-yield factors.

> Use this operation to evaluate the convenience-yield curve supplied in the request between one start
maturity and one or more end maturities. Maturities are integer day offsets from the curve's date axis and
returned factors preserve the order of `EndMats`. `Extrapolate` controls evaluation beyond the
last curve point. The calculation uses only the supplied curve and does not modify market data.



## OpenAPI

````yaml /risk-and-pricing/atoti-risk-services/apis-endpoints/openapi/openapi.mintlify.json post /api/MarketData/GetConvenienceYield
openapi: 3.0.4
info:
  title: Derivitec Api 1.0
  version: '1.0'
servers:
  - url: https://api.riskportal.activeviam.com
security:
  - oauth2: []
  - apikey: []
tags:
  - name: AdminUser
  - name: AtotiReport
  - name: AtotiSession
  - name: BloombergOAuth
  - name: Bond
  - name: BondYieldCurvePage
  - name: BookAccess
  - name: Books
  - name: Commodity
  - name: Counterparties
  - name: Currencies
  - name: Equity
  - name: EquityDividend
  - name: EquityPage
  - name: FeatureFlag
  - name: Fx
  - name: FxPage
  - name: GroupAccess
  - name: Home
  - name: LegacyPosition
  - name: MarketData
  - name: MarketDataProvider
  - name: MarketDataProviderAccess
  - name: Meta
  - name: Notification
  - name: Organisation
  - name: PnLReport
  - name: PortfolioAccess
  - name: Portfolios
  - name: Position
  - name: PositionFilter
  - name: PricingEnvironment
  - name: PricingEnvironmentAccess
  - name: RateAsset
  - name: RateAssetPage
  - name: Report
  - name: ReportDefinition
  - name: ReportHistoryLauncherQuery
  - name: ReportLauncher
  - name: ReportQuery
  - name: ReportQueryViewUser
  - name: ReportRestriction
  - name: ReportView
  - name: RiskReport
  - name: Tradable
  - name: TradeBooking
  - name: User
  - name: VarReport
  - name: VarReportQuery
  - name: YieldCurvePage
paths:
  /api/MarketData/GetConvenienceYield:
    post:
      tags:
        - MarketData
      summary: Calculate convenience-yield factors.
      description: >-
        Use this operation to evaluate the convenience-yield curve supplied in
        the request between one start

        maturity and one or more end maturities. Maturities are integer day
        offsets from the curve's date axis and

        returned factors preserve the order of `EndMats`. `Extrapolate` controls
        evaluation beyond the

        last curve point. The calculation uses only the supplied curve and does
        not modify market data.
      operationId: GetConvenienceYield
      requestBody:
        description: >-
          The calculation payload. `Curve` is required with a commodity
          name/exchange, value date, aligned day `Maturities` and dimensionless
          `DiscountFactors`; `EndMats` must be non-empty and `StartMat` is a day
          offset.
        content:
          application/json-patch+json:
            schema:
              $ref: '#/components/schemas/ApiGetConvenienceYieldRequest'
          application/json:
            schema:
              $ref: '#/components/schemas/ApiGetConvenienceYieldRequest'
          text/json:
            schema:
              $ref: '#/components/schemas/ApiGetConvenienceYieldRequest'
          application/*+json:
            schema:
              $ref: '#/components/schemas/ApiGetConvenienceYieldRequest'
      responses:
        '200':
          description: >-
            Returns one calculated convenience-yield factor for each requested
            end maturity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiGetConvenienceYieldResponse'
        '400':
          description: BadRequest
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
      security:
        - oauth2: []
        - apikey: []
components:
  schemas:
    ApiGetConvenienceYieldRequest:
      required:
        - $type
      type: object
      properties:
        curve:
          $ref: '#/components/schemas/ConvenienceYieldCurve'
        start_mat:
          type: integer
          description: Start maturity as a day offset shared by the requested intervals.
          format: int32
        end_mats:
          type: array
          items:
            type: integer
            format: int32
          description: >-
            End maturities as day offsets for the requested factors, in result
            order.
          nullable: true
        $type:
          type: string
          enum:
            - >-
              Derivitec.Web.Core.MarketData.ApiGetConvenienceYieldRequest,
              Derivitec.Web.Core
      additionalProperties: false
      description: >-
        Requests convenience factors from a supplied curve across maturity
        intervals.
    ApiGetConvenienceYieldResponse:
      required:
        - $type
      type: object
      properties:
        is_success:
          type: boolean
          description: >-
            Whether the operation completed successfully. The default is `true`;
            error outcomes set it to `false`.
          example: true
        error_messages:
          type: array
          items:
            type: string
          description: >-
            Messages explaining operation-level failures. The collection is
            empty by default.
          nullable: true
        factors:
          type: array
          items:
            type: number
            format: double
          description: >-
            One convenience-yield factor for each requested end maturity, in
            request order.
          nullable: true
        $type:
          type: string
          enum:
            - >-
              Derivitec.Web.Core.MarketData.ApiGetConvenienceYieldResponse,
              Derivitec.Web.Core
      additionalProperties: false
      description: Returns convenience factors evaluated for the requested intervals.
    ConvenienceYieldCurve:
      required:
        - $type
      type: object
      properties:
        provider_id:
          type: string
          description: >-
            Market-data provider code recorded as the source of the
            contribution. Defaults to Derivitec.
          nullable: true
        derivitec_created:
          type: string
          description: Timestamp at which the market-data record was created.
        derivitec_modified:
          type: string
          description: Optional timestamp of the record's latest modification.
          nullable: true
        uploaded_date_time:
          type: string
          description: >-
            Optional timestamp at which the contribution was uploaded.
            UploadRateAssets ignores the supplied value on each rate asset and
            stores the current UTC time.
          nullable: true
        derivitec_modified_by:
          type: string
          description: >-
            Principal recorded as the latest modifier. UploadRateAssets ignores
            the supplied value on each rate asset and stores the authenticated
            user identifier.
          nullable: true
        uploaded_by:
          type: string
          description: >-
            Principal recorded as the uploader. UploadRateAssets ignores the
            supplied value on each rate asset and stores the authenticated user
            identifier.
          nullable: true
        rolled:
          type: boolean
          description: Whether the contribution has been rolled.
          example: false
        commodity_id:
          $ref: '#/components/schemas/CommodityId'
        discount_factors:
          type: array
          items:
            type: number
            format: double
          description: Dimensionless convenience factors paired by index with Maturities.
          nullable: true
        extrapolate:
          type: boolean
          description: >-
            Whether the curve may be evaluated beyond its supplied maturities;
            initialized to true.
        maturities:
          type: array
          items:
            type: integer
            format: int32
          description: >-
            Maturities expressed as day offsets and paired by index with
            DiscountFactors.
          nullable: true
        value_date:
          type: string
          description: Curve value date.
          format: date-time
        $type:
          type: string
          enum:
            - >-
              Derivitec.Web.Core.MarketData.ConvenienceYieldCurve,
              Derivitec.Web.Core
      additionalProperties: false
      description: >-
        Commodity convenience-yield curve represented by day-offset maturities
        and dimensionless factors.
    CommodityId:
      required:
        - $type
      type: object
      properties:
        name:
          type: string
          description: Display name.
          nullable: true
        exchange:
          type: string
          description: Exchange component of the commodity key.
          nullable: true
        $type:
          type: string
          enum:
            - Derivitec.Web.Core.MarketData.CommodityId, Derivitec.Web.Core
      additionalProperties: false
      description: Commodity business key formed from name and exchange.
  securitySchemes:
    oauth2:
      type: oauth2
      description: >-
        OAuth2 access-token requested from AWS Cognito and provided as a Auth
        Bearer header
      flows:
        implicit:
          authorizationUrl: https://auth.riskportal.derivitec.com/oauth2/authorize
          scopes: {}
    apikey:
      type: apiKey
      description: API-Key requested via the site and provided as a header
      name: x-api-key
      in: header

````