---
updatedAt: 2026-08-26T07:27:20.000Z
agentTools:
  projectIndex: https://docs.blockdaemon.com/llms.txt
---

# Add Liquidity

Constructs a transaction payload for adding liquidity to a specified market. The payload includes chain, address, gas, and function data, enabling users to deposit tokens and expand yield opportunities.

> 💡 
**Compute Unit Value:** `95` (Fixed)

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "contact": {
      "name": "Blockdaemon",
      "email": "info@blockdaemon.com"
    },
    "description": "The Blockdaemon DeFi API provides a single interface to a multitude of DeFi projects and blockchains",
    "title": "Blockdaemon DeFi API",
    "version": "1.0.0",
    "x-logo": {
      "altText": "Blockdaemon logo",
      "backgroundColor": "#fafafa",
      "url": "https://storage.googleapis.com/blockdaemon-app-static-images/marketing/PNG/dark-logo.png"
    }
  },
  "externalDocs": {
    "description": "Blockdaemon DeFi documentation",
    "url": "http://www.blockdaemon.com/api/defi"
  },
  "servers": [
    {
      "url": "https://svc.blockdaemon.com"
    }
  ],
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key",
        "description": "`X-API-Key: <Token>` header must be set to authenticate API requests.You can create tokens in the \"Configure\" tab of your API access area at https://app.blockdaemon.com."
      }
    },
    "schemas": {
      "_yieldaggregator_addliquidity_Request": {
        "type": "object",
        "properties": {
          "yieldAggregatorId": {
            "type": "string",
            "description": "A unique identifier to route the transaction to the appropriate yield aggregator instance. This parameter is optional if a default aggregator is used.",
            "enum": [
              "5200",
              "5201",
              "5202",
              "5203",
              "5204"
            ],
            "example": "5200"
          },
          "marketAddress": {
            "type": "string",
            "description": "The blockchain address of the liquidity pool or market where tokens will be deposited. This parameter directs the transaction to the correct pool within the yield aggregator.",
            "example": "0xcdd26eb5eb2ce0f203a84553853667ae69ca29ce"
          },
          "tokenIn": {
            "type": "string",
            "description": "The address or identifier of the token being deposited. This parameter specifies the underlying asset that will be added as liquidity.",
            "example": "0x4db99b79361f98865230f5702de024c69f629fec"
          },
          "amount": {
            "type": "string",
            "description": "Number of tokens, specified in the token's smallest denomination (base units). Do not send human-readable decimal values. Examples: 1 WETH (18 decimals) = \"1000000000000000000\"; 1 USDC (6 decimals) = \"1000000\".",
            "example": "1000000000000000000"
          },
          "from": {
            "type": "string",
            "description": "Blockchain address of the sender. For EVM chains, use a checksummed hex address (e.g., 0xABCDEF...). This address must hold sufficient balance and will sign the transaction.",
            "example": "0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402"
          },
          "amountPtIn": {
            "type": "string",
            "description": "Optional amount of principal tokens (PT) to deposit, specified in the token's smallest denomination (base units). Required by certain protocols that accept PT alongside the main asset. Example: 1 PT token (18 decimals) = \"1000000000000000000\".",
            "example": "10000"
          },
          "slippage": {
            "type": "string",
            "description": "Specifies the maximum allowable percentage deviation between the expected and executed price during the deposit. This tolerance helps protect against unfavorable price movements during the transaction. Valid range: 0 to 100 (e.g., 1 = up to 1% slippage).",
            "example": "10"
          },
          "zeroPriceImpact": {
            "type": "boolean",
            "description": "When set to true, the transaction is executed to avoid any change in the asset's price, resulting in the user receiving both LP and YT tokens, though the LP amount will be lower than in standard mode.",
            "example": false
          },
          "gas": {
            "type": "string",
            "description": "Maximum number of gas units to allocate for the transaction, as an integer string (e.g., '200000'). If omitted, gas is estimated automatically. Note: this is gas units, not wei or gwei.",
            "example": "100000"
          },
          "gasPriority": {
            "type": "string",
            "description": "Specifies the desired gas fee priority (e.g., 'low', 'medium', or 'high'), which influences the transaction speed and cost.",
            "example": "low"
          },
          "enableFee": {
            "type": "boolean",
            "description": "Flag to include a basis points fee transaction alongside the main transaction when set to true.",
            "example": false
          }
        },
        "required": [
          "marketAddress",
          "tokenIn",
          "amount",
          "from"
        ],
        "description": "The request body for a /defi/v1/yieldaggregator/addliquidity",
        "example": {
          "yieldAggregatorId": "5200",
          "marketAddress": "0xcdd26eb5eb2ce0f203a84553853667ae69ca29ce",
          "tokenIn": "0x4db99b79361f98865230f5702de024c69f629fec",
          "amount": "1000000000000000000",
          "from": "0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402",
          "amountPtIn": "10000",
          "slippage": "10",
          "zeroPriceImpact": false,
          "gas": "100000",
          "gasPriority": "low",
          "enableFee": false
        }
      }
    }
  },
  "security": [
    {
      "ApiKeyAuth": []
    }
  ],
  "paths": {
    "/defi/v1/yieldaggregator/addliquidity": {
      "post": {
        "tags": [
          "yieldaggregator"
        ],
        "summary": "Add Liquidity",
        "description": "Constructs a transaction payload for adding liquidity to a specified market. The payload includes chain, address, gas, and function data, enabling users to deposit tokens and expand yield opportunities.\n\n> 💡 \n**Compute Unit Value:** `95` (Fixed)",
        "operationId": "yieldaggregatorAddliquidity",
        "requestBody": {
          "required": true,
          "description": "The request body for a /defi/v1/yieldaggregator/addliquidity",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/_yieldaggregator_addliquidity_Request"
              },
              "example": {
                "yieldAggregatorId": "5200",
                "marketAddress": "0xcdd26eb5eb2ce0f203a84553853667ae69ca29ce",
                "tokenIn": "0x4db99b79361f98865230f5702de024c69f629fec",
                "amount": "1000000000000000000",
                "from": "0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402",
                "amountPtIn": "10000",
                "slippage": "10",
                "zeroPriceImpact": false,
                "gas": "100000",
                "gasPriority": "low",
                "enableFee": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "integer"
                    },
                    "msg": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  },
                  "example": {
                    "status": 200,
                    "msg": "success",
                    "data": {
                      "chainId": "1",
                      "from": "0xdae2f6eddda6fb4fb60cc02633de27e2b431b402",
                      "to": "0x888888888889758F76e7103c6CbF23ABbF58F946",
                      "value": "0",
                      "gas": "1000000",
                      "data": "0x97ee279e000000000000000000000000dae2f6eddda6fb4fb60cc02633de27e2b431b402000000000000000000000000b451a36c8b6b2eac77ad0737ba732818143a0e250000000000000000000000000000000000000000000000008ac7230489e8000000000000000000000000000000000000000000000000000000000000000186a0000000000000000000000000000000000000000000000000000000000000c741",
                      "estimationCheck": "Returned error: execution reverted: ERC20: insufficient allowance",
                      "referenceId": "410bcb32a855442caa186a8a7a599d1e"
                    }
                  }
                }
              }
            }
          }
        },
        "x-bd-cu": "95",
        "x-bd-cu-type": "fixed",
        "x-internal": false
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  }
}
```