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

# Simulate yield farming returns

> Calculates potential returns for yield farming based on investment amount and price changes



## OpenAPI

````yaml /api-reference/openapi.json post /v2/farming/{id}/simulate
openapi: 3.0.0
info:
  title: Nimbus API
  version: 1.0.0
  description: >-
    API for Nimbus


    ## Rate Limiting

    This API implements rate limiting to ensure fair usage and protect our
    services. The current rate limit is:


    - **40 requests per 1 minute** per IP address


    If you exceed this limit, you will receive a 429 (Too Many Requests)
    response. Please wait for the rate limit window to reset before making
    additional requests.


    If you need more, please contact us at **thanhle@getnimbus.io** or TG
    **@thanhle27** to get premium API Key.
servers:
  - url: https://api.getnimbus.io
    description: API server
security: []
tags: []
paths:
  /v2/farming/{id}/simulate:
    post:
      tags:
        - Farming
      summary: Simulate yield farming returns
      description: >-
        Calculates potential returns for yield farming based on investment
        amount and price changes
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
          example: >-
            suilend-lending:0x83556891f4a0f233ce7b05cfe7f957d4020492a34f5405b2cb9377d060bef4bf::spring_sui::SPRING_SUI
          description: The ID of the vault to simulate
        - in: query
          name: chain
          required: true
          schema:
            type: string
          description: The chain of the vault
          example: SUI
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - type
                - data
              properties:
                type:
                  type: string
                  enum:
                    - Pools
                    - Lending
                    - Staking
                  description: The type of yield farming
                data:
                  type: object
                  oneOf:
                    - required:
                        - priceChangeA
                        - priceChangeB
                        - weightA
                        - weightB
                        - value
                      properties:
                        priceChangeA:
                          type: number
                          minimum: 0
                          description: Expected price change for token A (percentage)
                        priceChangeB:
                          type: number
                          minimum: 0
                          description: Expected price change for token B (percentage)
                        weightA:
                          type: number
                          minimum: 0
                          description: Weight of token A in the pool
                        weightB:
                          type: number
                          minimum: 0
                          description: Weight of token B in the pool
                        value:
                          type: number
                          minimum: 0
                          description: Initial investment amount
                    - required:
                        - value
                        - priceChange
                      properties:
                        value:
                          type: number
                          minimum: 0
                          description: Initial investment amount
                        priceChange:
                          type: number
                          minimum: 0
                          description: Expected price change (percentage)
            example:
              type: Pools
              data:
                priceChangeA: 10
                priceChangeB: 20
                weightA: 50
                weightB: 50
                value: 100
      responses:
        '200':
          description: Simulation results for different time periods
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/SimulationResult'
        '400':
          description: Invalid parameters or missing required fields
        '500':
          description: Server error
components:
  schemas:
    SimulationResult:
      type: object
      properties:
        data:
          type: array
          items:
            type: object
            properties:
              date:
                type: string
                format: date-time
              value:
                type: number
                description: Value of the investment
        il:
          type: number
          description: Impermanent loss percentage
        ilAmount:
          type: number
          description: Impermanent loss amount

````