> ## 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.

# Get transaction payload for DEFI actions

> Generate transaction payload based on operation type and parameters. The required fields are determined by the response from /v2/farming/tx/prepare API.



## OpenAPI

````yaml /api-reference/openapi.json post /v2/farming/tx/payload
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/tx/payload:
    post:
      tags:
        - DEFI Actions
      summary: Get transaction payload for DEFI actions
      description: >-
        Generate transaction payload based on operation type and parameters. The
        required fields are determined by the response from
        /v2/farming/tx/prepare API.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - $ref: '#/components/schemas/StakingPayload'
                - $ref: '#/components/schemas/UnstakingPayload'
                - $ref: '#/components/schemas/LendingPayload'
                - $ref: '#/components/schemas/LendingWithdrawPayload'
                - $ref: '#/components/schemas/BorrowPayload'
                - $ref: '#/components/schemas/RepayPayload'
                - $ref: '#/components/schemas/AddLPPayload'
                - $ref: '#/components/schemas/RemoveLPPayload'
      responses:
        '200':
          description: Transaction payload generated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: string
                    description: The transaction payload string
        '400':
          description: Missing or invalid parameters
        '500':
          description: Server error
components:
  schemas:
    StakingPayload:
      type: object
      title: STAKING
      required:
        - type
        - protocol
        - chain
        - poolId
        - sender
        - amount
      properties:
        type:
          type: string
          enum:
            - STAKING
        chain:
          type: string
          enum:
            - SUI
        protocol:
          type: string
          enum:
            - alpha-fi
            - navi
            - native-staking
            - suilend
        poolId:
          type: string
        sender:
          type: string
        amount:
          type: string
        isStakeAndDeposit:
          type: boolean
        isSinglePool:
          type: boolean
        tokenAddress:
          type: string
    UnstakingPayload:
      type: object
      title: UNSTAKING
      required:
        - type
        - protocol
        - chain
        - poolId
        - sender
      properties:
        type:
          type: string
          enum:
            - UNSTAKING
        chain:
          type: string
          enum:
            - SUI
        protocol:
          type: string
          enum:
            - alpha-fi
            - navi
            - native-staking
            - suilend
        poolId:
          type: string
        sender:
          type: string
        positionId:
          type: string
    LendingPayload:
      type: object
      title: LENDING
      required:
        - type
        - protocol
        - chain
        - sender
        - amount
        - symbol
      properties:
        type:
          type: string
          enum:
            - LENDING
        chain:
          type: string
          enum:
            - SUI
        protocol:
          type: string
          enum:
            - scallop
            - alphalend
            - suilend
        sender:
          type: string
        amount:
          type: string
        symbol:
          type: string
        tokenAddress:
          type: string
    LendingWithdrawPayload:
      type: object
      title: LENDING_WITHDRAW
      required:
        - type
        - protocol
        - chain
        - sender
        - amount
        - symbol
      properties:
        type:
          type: string
          enum:
            - LENDING_WITHDRAW
        chain:
          type: string
          enum:
            - SUI
        protocol:
          type: string
          enum:
            - scallop
            - alphalend
            - suilend
        sender:
          type: string
        amount:
          type: string
        symbol:
          type: string
        tokenAddress:
          type: string
        listCoinTypeInPosition:
          type: array
          items:
            type: string
    BorrowPayload:
      type: object
      title: BORROW
      required:
        - type
        - protocol
        - chain
        - sender
        - amount
        - collateral
      properties:
        type:
          type: string
          enum:
            - BORROW
        chain:
          type: string
          enum:
            - SUI
        protocol:
          type: string
          enum:
            - navi
            - suilend
            - alphalend
        sender:
          type: string
        amount:
          type: string
        collateral:
          type: string
        listCoinTypeInPosition:
          type: array
          items:
            type: string
    RepayPayload:
      type: object
      title: REPAY
      required:
        - type
        - protocol
        - chain
        - sender
        - amount
        - collateral
      properties:
        type:
          type: string
          enum:
            - REPAY
        chain:
          type: string
          enum:
            - SUI
        protocol:
          type: string
          enum:
            - navi
            - suilend
            - alphalend
        sender:
          type: string
        amount:
          type: string
        collateral:
          type: string
        tokenAddress:
          type: string
        listCoinTypeInPosition:
          type: array
          items:
            type: string
    AddLPPayload:
      type: object
      title: ADD_LP
      required:
        - type
        - protocol
        - chain
        - poolId
        - sender
        - tokenA
        - tokenB
        - amountA
        - amountB
      properties:
        type:
          type: string
          enum:
            - ADD_LP
        chain:
          type: string
          enum:
            - SUI
        protocol:
          type: string
          enum:
            - ''
        poolId:
          type: string
        sender:
          type: string
        tokenA:
          type: string
        tokenB:
          type: string
        amountA:
          type: string
        amountB:
          type: string
        slippage:
          type: number
        singleSided:
          type: boolean
        lowerPrice:
          type: number
        upperPrice:
          type: number
    RemoveLPPayload:
      type: object
      title: REMOVE_LP
      required:
        - type
        - protocol
        - chain
        - poolId
        - sender
        - amount
      properties:
        type:
          type: string
          enum:
            - REMOVE_LP
        chain:
          type: string
          enum:
            - SUI
        protocol:
          type: string
          enum:
            - ''
        poolId:
          type: string
        sender:
          type: string
        amount:
          type: string

````