# Create Swap Liquidity (Enso) URL: /docs/api-reference/liquidity-pools/CreateSwapLpEnsoController_handle_v1 This endpoint creates liquidity for a swap liquidity pool through an Enso bundle: the swaps and the deposit are chained on-chain, so the deposit consumes the exact runtime swap outputs instead of worst-case estimates. Platform fees and gas fees are always charged in `tokenIn`. ## POST /api/v1/liquidity/enso Request: `POST https://api.notus.team/api/v1/liquidity/enso` Authentication: send your project's API key in the `x-api-key` header. ```json { "description": "This endpoint creates liquidity for a swap liquidity pool through an Enso bundle: the swaps and the deposit are chained on-chain, so the deposit consumes the exact runtime swap outputs instead of worst-case estimates. Platform fees and gas fees are always charged in `tokenIn`.", "operationId": "CreateSwapLpEnsoController_handle_v1", "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateLiquidityEnsoDTO" } } } }, "responses": { "200": { "description": "Data about the creation of the liquidity", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SwapLiquidityOperationResponseDTO" } } } }, "400": { "description": "BAD_REQUEST", "content": { "application/json": { "schema": { "oneOf": [ { "type": "object", "description": "NOT_AUTHORIZED_TOKENS", "required": [ "statusCode", "id", "message" ], "properties": { "statusCode": { "type": "number", "description": "HTTP status code", "examples": [ 400 ] }, "id": { "type": "string", "description": "Our ID of the problem", "examples": [ "NOT_AUTHORIZED_TOKENS" ] }, "message": { "type": "string", "description": "A human readable message that explains the problem", "examples": [ "" ] } } }, { "type": "object", "description": "NOT_SUPPORTED_CHAIN", "required": [ "statusCode", "id", "message" ], "properties": { "statusCode": { "type": "number", "description": "HTTP status code", "examples": [ 400 ] }, "id": { "type": "string", "description": "Our ID of the problem", "examples": [ "NOT_SUPPORTED_CHAIN" ] }, "message": { "type": "string", "description": "A human readable message that explains the problem", "examples": [ "UNISWAP_V3 does not support this chain ([object Object])." ] } } }, { "type": "object", "description": "TICK_OUT_OF_RANGE", "required": [ "statusCode", "id", "message" ], "properties": { "statusCode": { "type": "number", "description": "HTTP status code", "examples": [ 400 ] }, "id": { "type": "string", "description": "Our ID of the problem", "examples": [ "TICK_OUT_OF_RANGE" ] }, "message": { "type": "string", "description": "A human readable message that explains the problem", "examples": [ "The provided value in `minPrice` is too high." ] } } }, { "type": "object", "description": "PRICE_RANGE_TOO_NARROW", "required": [ "statusCode", "id", "message" ], "properties": { "statusCode": { "type": "number", "description": "HTTP status code", "examples": [ 400 ] }, "id": { "type": "string", "description": "Our ID of the problem", "examples": [ "PRICE_RANGE_TOO_NARROW" ] }, "message": { "type": "string", "description": "A human readable message that explains the problem", "examples": [ "The price range between `minPrice` and `maxPrice` does not cover a full tick-spacing step of this pool (10 ticks, about 0.1%); widen it." ] } } }, { "type": "object", "description": "UNSUPPORTED_CROSS_CHAIN_ROUTE", "required": [ "statusCode", "id", "message" ], "properties": { "statusCode": { "type": "number", "description": "HTTP status code", "examples": [ 400 ] }, "id": { "type": "string", "description": "Our ID of the problem", "examples": [ "UNSUPPORTED_CROSS_CHAIN_ROUTE" ] }, "message": { "type": "string", "description": "A human readable message that explains the problem", "examples": [ "There is no cross-chain liquidity route from chain 137 to chain 56." ] } } }, { "type": "object", "description": "LIQUIDITY_AMOUNT_TOO_SMALL_FOR_FEES", "required": [ "statusCode", "id", "message" ], "properties": { "statusCode": { "type": "number", "description": "HTTP status code", "examples": [ 400 ] }, "id": { "type": "string", "description": "Our ID of the problem", "examples": [ "LIQUIDITY_AMOUNT_TOO_SMALL_FOR_FEES" ] }, "message": { "type": "string", "description": "A human readable message that explains the problem", "examples": [ "The amount does not cover the fees and the network gas. Increase the amount and try again." ] } } }, { "type": "object", "description": "POOL_ID_MISMATCH", "required": [ "statusCode", "id", "message" ], "properties": { "statusCode": { "type": "number", "description": "HTTP status code", "examples": [ 400 ] }, "id": { "type": "string", "description": "Our ID of the problem", "examples": [ "POOL_ID_MISMATCH" ] }, "message": { "type": "string", "description": "A human readable message that explains the problem", "examples": [ "The poolId does not match the pool the request resolves to" ] } } }, { "type": "object", "description": "UNSUPPORTED_LIQUIDITY_OPERATION", "required": [ "statusCode", "id", "message" ], "properties": { "statusCode": { "type": "number", "description": "HTTP status code", "examples": [ 400 ] }, "id": { "type": "string", "description": "Our ID of the problem", "examples": [ "UNSUPPORTED_LIQUIDITY_OPERATION" ] }, "message": { "type": "string", "description": "A human readable message that explains the problem", "examples": [ "This liquidity provider does not support the requested operation" ] } } }, { "type": "object", "description": "DESTINATION_TOKEN_REQUIRED", "required": [ "statusCode", "id", "message" ], "properties": { "statusCode": { "type": "number", "description": "HTTP status code", "examples": [ 400 ] }, "id": { "type": "string", "description": "Our ID of the problem", "examples": [ "DESTINATION_TOKEN_REQUIRED" ] }, "message": { "type": "string", "description": "A human readable message that explains the problem", "examples": [ "A cross-chain entry into this liquidity provider needs destinationToken: it has no route without it" ] } } }, { "type": "object", "description": "INVALID_ADDRESS", "required": [ "statusCode", "id", "message" ], "properties": { "statusCode": { "type": "number", "description": "HTTP status code", "examples": [ 400 ] }, "id": { "type": "string", "description": "Our ID of the problem", "examples": [ "INVALID_ADDRESS" ] }, "message": { "type": "string", "description": "A human readable message that explains the problem", "examples": [ "The address '0x556B9306565093C855AEA9AE92A594704c2Cd59e' is not valid for chain '56'" ] } } }, { "type": "object", "description": "SENDING_TO_TOKEN_CONTRACT", "required": [ "statusCode", "id", "message" ], "properties": { "statusCode": { "type": "number", "description": "HTTP status code", "examples": [ 400 ] }, "id": { "type": "string", "description": "Our ID of the problem", "examples": [ "SENDING_TO_TOKEN_CONTRACT" ] }, "message": { "type": "string", "description": "A human readable message that explains the problem", "examples": [ "You are sending tokens to a token contract" ] } } }, { "type": "object", "description": "CROSS_CHAIN_LP_AMOUNT_TOO_LARGE_FOR_POOL", "required": [ "statusCode", "id", "message" ], "properties": { "statusCode": { "type": "number", "description": "HTTP status code", "examples": [ 400 ] }, "id": { "type": "string", "description": "Our ID of the problem", "examples": [ "CROSS_CHAIN_LP_AMOUNT_TOO_LARGE_FOR_POOL" ] }, "message": { "type": "string", "description": "A human readable message that explains the problem", "examples": [ "This amount is too large for this pool's liquidity right now. Try a smaller amount." ] } } } ] } } } }, "403": { "description": "FORBIDDEN", "content": { "application/json": { "schema": { "type": "object", "description": "UNAVAILABLE_COMPUTE_UNITS", "required": [ "statusCode", "id", "message" ], "properties": { "statusCode": { "type": "number", "description": "HTTP status code", "examples": [ 403 ] }, "id": { "type": "string", "description": "Our ID of the problem", "examples": [ "UNAVAILABLE_COMPUTE_UNITS" ] }, "message": { "type": "string", "description": "A human readable message that explains the problem", "examples": [ "The project doesn't have enough compute units to perform this action. Please upgrade your plan." ] } } } } } }, "404": { "description": "NOT_FOUND", "content": { "application/json": { "schema": { "oneOf": [ { "type": "object", "description": "ACCOUNT_ABSTRACTION_ADDRESS_NOT_REGISTERED_WITH_PROJECT", "required": [ "statusCode", "id", "message" ], "properties": { "statusCode": { "type": "number", "description": "HTTP status code", "examples": [ 404 ] }, "id": { "type": "string", "description": "Our ID of the problem", "examples": [ "ACCOUNT_ABSTRACTION_ADDRESS_NOT_REGISTERED_WITH_PROJECT" ] }, "message": { "type": "string", "description": "A human readable message that explains the problem", "examples": [ "The requested wallet \"0x6e397ddf51d9f15dbe0414538e7529f51f2e5464\" is not registered with the project" ] } } }, { "type": "object", "description": "POOL_NOT_FOUND", "required": [ "statusCode", "id", "message" ], "properties": { "statusCode": { "type": "number", "description": "HTTP status code", "examples": [ 404 ] }, "id": { "type": "string", "description": "Our ID of the problem", "examples": [ "POOL_NOT_FOUND" ] }, "message": { "type": "string", "description": "A human readable message that explains the problem", "examples": [ "This pool was not found in our systems (pool: 42161-0x864abca0a6202dba5b8868772308da953ff125b0f95015adbf89aaf579e903a8). Make sure you are passing the right 'poolId'." ] } } } ] } } } } }, "summary": "Create Swap Liquidity (Enso)", "tags": [ "Liquidity Pools" ] } ``` ### Schema CreateLiquidityEnsoDTO ```json { "type": "object", "properties": { "liquidityProvider": { "description": "Optional provider for entering a liquidity pool. If not provided, Uniswap v3 will be used.", "type": "string", "enum": [ "UNISWAP_V3", "PANCAKESWAP_V3", "UNISWAP_V4" ], "examples": [ "UNISWAP_V3" ] }, "walletAddress": { "description": "The wallet address (in hexadecimal format) that will provide the liquidity.", "type": "string", "examples": [ "0x6e397ddf51d9f15dbe0414538e7529f51f2e5464" ] }, "toAddress": { "description": "The address (in hexadecimal format) receiving the token that represents the provided liquidity.", "type": "string", "examples": [ "0x1337133713371337133713371337133713371337" ] }, "chainId": { "description": "The blockchain network where the liquidity will be provided. \n Supported EVM chains:\n- Arbitrum One: 42161\n- Avalanche: 43114\n- Base: 8453\n- BNB Smart Chain: 56\n- Ethereum: 1\n- Gnosis: 100\n- OP Mainnet: 10\n- Polygon: 137\n- X Layer Mainnet: 196\n- Robinhood Chain: 4663", "type": "number", "examples": [ 42161 ] }, "transactionFeePercent": { "default": 0, "description": "Percentage fee applied to the transaction (e.g., 5 for 5%).", "type": "number", "minimum": 0, "maximum": 99.99, "examples": [ 2.5 ] }, "gasFeePaymentMethod": { "type": "string", "enum": [ "ADD_TO_AMOUNT", "DEDUCT_FROM_AMOUNT" ], "description": "Defines how the gas fee will be paid: \"ADD_TO_AMOUNT\" charges it on top of `amountIn` (the wallet must hold `amountIn` + fees + gas), while \"DEDUCT_FROM_AMOUNT\" subtracts it from `amountIn` before providing liquidity. On this route, platform fees and gas fees are always charged in `tokenIn`.", "examples": [ "ADD_TO_AMOUNT" ] }, "tokenIn": { "description": "The address (in hexadecimal format) of the token being swapped from.", "type": "string", "examples": [ "0x2791bca1f2de4661ed88a30c99a7a9449aa84174" ] }, "amountIn": { "type": "string", "description": "The amount of token being swapped from, expressed as a decimal string.", "examples": [ "1.2" ] }, "token0": { "description": "The address (in hexadecimal format) of one of the tokens of the pool.", "type": "string", "examples": [ "0x2f2a2543b76a4166549f7aab2e75bef0aefc5b0f" ] }, "token1": { "description": "The address (in hexadecimal format) of the other token of the pool.", "type": "string", "examples": [ "0xaf88d065e77c8cc2239327c5edb3a432268e5831" ] }, "poolFeePercent": { "type": "number", "exclusiveMinimum": 0, "maximum": 100, "description": "Defines the fee earned by providing liquidity. Lower values are recommended for more stable tokens, while higher values are better suited for volatile assets. The values allowed depend on the provider, so check the provider docs too to know which fee tiers are allowed.", "examples": [ 1 ] }, "tickSpacing": { "type": [ "integer", "null" ], "exclusiveMinimum": 0, "maximum": 9007199254740991, "description": "Tick spacing of the pool (`tickSpacing` from the pool list). Part of the pool's identity where the fee alone does not fix it: required for UNISWAP_V4, ignored by the providers that read it from the pool.", "examples": [ 60 ] }, "poolId": { "type": [ "string", "null" ], "pattern": "^[0-9]+-0x([0-9a-fA-F]{40}|[0-9a-fA-F]{64})$", "description": "Optional `id` of the pool from the pool list. When sent, the request fails with POOL_ID_MISMATCH unless the pool it resolves to is this one.", "examples": [ "137-0x5b5bf85e5dc1e76ff90025ac5d8e8595fb575443" ] }, "stake": { "description": "PANCAKESWAP_V3 only: also stake the new position in the pool's MasterChefV3 farm, in the same operation, so it earns CAKE from the start. The wallet approves the staker contract on the position manager once: on the pool's network that approval is part of this operation; coming from another network it is a second, sponsored operation returned as `stakeApprovalUserOperation`. Ignored when the pool has no live farm or `toAddress` is not `walletAddress`. The response's `staked` tells whether the position will be staked.", "type": [ "boolean", "null" ], "examples": [ false ] }, "minPrice": { "type": "number", "minimum": 0, "description": "Minimum price the liquidity will be active. If the price goes below this, the liquidity won't be active and will generate no revenues. This will allow to concentrate the liquidity to a price range, thus enhancing the gains. Price is always `p = token1 / token0`", "examples": [ 83475.12 ] }, "maxPrice": { "type": "number", "minimum": 0, "description": "Maximum price the liquidity will be active. If the price goes above this, the liquidity won't be active and will generate no revenues. This will allow to concentrate the liquidity to a price range, thus enhancing the gains. Price is always `p = token1 / token0`", "examples": [ 102300.5 ] }, "slippage": { "default": 0.5, "description": "Optional parameter controlling the maximum deviation allowed of the expected price of a trade and the actual price at which the trade is executed, with a minimum value of 0.5 and a maximum value of 99, default is 0.5, where 1 unit equals 1%.", "type": "number", "minimum": 0, "maximum": 99, "examples": [ 1.2 ] }, "extraFee": { "description": "Optional extra fee that can be charged in addition to the transaction fee (configured in the dashboard or via `transactionFeePercent`). This extra fee is deducted from the input token and sent to the specified `toAddress`, allowing you to define a custom recipient for this additional charge.", "type": "object", "properties": { "percentage": { "type": "number", "minimum": 0, "maximum": 99.99, "description": "The percentage of the extra fee to be charged", "examples": [ 1.5 ] }, "toAddress": { "description": "The address (in hexadecimal format) receiving the extra fee.", "type": "string", "examples": [ "0x6e397ddf51d9f15dbe0414538e7529f51f2e5464" ] } }, "required": [ "percentage", "toAddress" ] }, "metadata": { "type": "object", "additionalProperties": { "type": "string" }, "description": "Custom metadata. Key-value pairs with string values. Max 1KB size.", "examples": [ { "key": "value" } ] }, "destinationToken": { "description": "Cross-chain only. Which of the pool pair the bridge should deliver, on `chainIdOut`. For `UNISWAP_V3` it is optional: supplying it enables a second route for the entry — the destination side runs as one atomic batch instead of a bundle — used automatically when the primary route cannot be quoted; without it, only the primary route is attempted. For `PANCAKESWAP_V3` and `UNISWAP_V4` the atomic batch is the only route, so it is required, and it must be an ERC-20 (a native pool currency is bought by the batch).", "type": "string", "examples": [ "0x55d398326f99059ff775485246999027b3197955" ] }, "chainIdOut": { "description": "The blockchain network of the pool, when different from `chainId`. The entry is then bridged inside the same bundle and the position is minted on this chain — still one signature, with `tokenIn`, platform fees and gas all staying on `chainId`. Only routes with a configured bridge lane are accepted; `token0`/`token1` must be addresses on this chain.", "type": "number", "examples": [ 42161 ] } }, "required": [ "walletAddress", "toAddress", "chainId", "gasFeePaymentMethod", "tokenIn", "amountIn", "token0", "token1", "poolFeePercent", "minPrice", "maxPrice" ] } ``` ### Schema SwapLiquidityOperationResponseDTO ```json { "type": "object", "properties": { "operation": { "$ref": "#/components/schemas/CreateSwapLiquidityDTO" } }, "required": [ "operation" ] } ``` ### Schema CreateSwapLiquidityDTO ```json { "type": "object", "properties": { "metadata": { "type": [ "object", "null" ], "description": "Metadata object you set for this transaction, null if none", "examples": [ { "key": "value" } ] }, "poolId": { "type": [ "string", "null" ], "description": "Pool the operation acts on (for a position operation, the pool of the position), with the same value as the `id` of GET /liquidity/pools: `{chainId}-{protocolPoolId}`. Null only when the provider could not read it.", "examples": [ "56-0x36696169c63e42cd08ce11f5deebbcebae652050" ] }, "tickSpacing": { "type": [ "number", "null" ], "description": "Tick spacing of the pool.", "examples": [ 10 ] }, "staked": { "type": [ "boolean", "null" ], "description": "PANCAKESWAP_V3 position operations: whether the position was staked in MasterChefV3 when the quote was built (the transactions depend on it). On an entry, true when the operation also stakes the position it mints (`stake`). Null for other entries and for providers without staking.", "examples": [ true ] }, "rewards": { "description": "Reward tokens the operation pays to the wallet, estimated at quote time: the CAKE a staked PancakeSwap position harvests on collect, withdraw, removal, rebalance, reinvest and unstake. Empty otherwise. Rewards are never reinvested.", "type": "array", "items": { "$ref": "#/components/schemas/LiquidityRewardDTO" } }, "userOperationHash": { "type": [ "string", "null" ], "description": "Unique identifier for the liquidity user operation, required to execute the transaction.", "pattern": "^0x[a-fA-F0-9]{64}$", "examples": [ "0x2aac7a66d5331454eafc9b981be3596ad08a40dad24883e3b9c4a5362cd7f7e1" ] }, "revertReason": { "description": "Reason why the user operation hash is `null`. This is decoded from the blockchain contract, you can try to check the contracts you're interacting with and find this in the contract source code.", "type": [ "object", "null" ], "allOf": [ { "$ref": "#/components/schemas/RevertReasonDTO" } ] }, "authorization": { "description": "EIP-7702 Authorization. If the wallet is supposed to be an EIP-7702 wallet, then this field will be available for the first user operation. Signing this is mandatory for EIP-7702, and is not part of the signing of the user operation hash.\n\n**ATTENTION**: This signature is not the same as the user operation signature, you don't use viem's `signMessage` but `signAuthorization`, or plain `sign` with the `hash` field.", "type": [ "object", "null" ], "allOf": [ { "$ref": "#/components/schemas/AuthorizationDTO" } ] }, "stakeApprovalUserOperation": { "description": "Cross-chain entries that stake the new position (`stake`): a second, sponsored user operation on the pool's network, the wallet's approval of the staker contract. Sign its `userOperationHash` (and `authorization`, when present) along with this operation and send them on execute-user-op as `stakeApprovalUserOperationHash`, `stakeApprovalSignature` and `stakeApprovalAuthorization`. Without them the entry still executes and the position is left unstaked. Null when nothing is staked or the wallet already approved the staker.", "type": [ "object", "null" ], "allOf": [ { "$ref": "#/components/schemas/StakeApprovalUserOperationDTO" } ] }, "tokenIn": { "description": "Details about the cryptocurrency used in the swap", "allOf": [ { "$ref": "#/components/schemas/CryptoCurrency" } ] }, "amountIn": { "type": "string", "description": "The amount of tokens being swapped.", "examples": [ "7239.2" ] }, "tokenInAmountForToken0": { "type": "string", "description": "The amount of tokenIn that will be used to swap for token0 (first token in the pool).", "examples": [ "3619.6" ] }, "tokenInAmountForToken1": { "type": "string", "description": "The amount of tokenIn that will be used to swap for token1 (second token in the pool).", "examples": [ "3619.6" ] }, "walletAddress": { "type": "string", "description": "The wallet address (in hexadecimal format) that interacted with the liquidity protocol.", "pattern": "^0x[a-fA-F0-9]{40}$", "examples": [ "0x6e397ddf51d9f15dbe0414538e7529f51f2e5464" ] }, "expiresAt": { "format": "date-time", "type": "string", "description": "The expiration date of the operation.", "examples": [ "2025-10-26T13:27:49.542Z" ] }, "amounts": { "description": "The amount of tokens being added to the pool.", "type": "array", "items": { "$ref": "#/components/schemas/SwapLiquidityAmountDTO" }, "examples": [ "7239.2" ] }, "fees": { "description": "The fees collected for the swap.", "type": "array", "items": { "$ref": "#/components/schemas/FeeDTO" } }, "collectedPoolFees": { "description": "Pool fees the operation pays out to the wallet, token0 then token1. Uniswap V4 pays the accrued fees of a position out on every change, so a V4 top-up reports them here; zero on entries and on the adds of the other providers.", "type": "array", "items": { "$ref": "#/components/schemas/QuoteAmount" } }, "estimatedGasFees": { "description": "Details of the estimated fees for the swap, including gas and provider fees.", "allOf": [ { "$ref": "#/components/schemas/EstimatedGasFees" } ] }, "bridgeFee": { "type": [ "string", "null" ], "description": "What the bridge charges a cross-chain entry or top-up to deliver the funds and run the deposit on the pool's network, in `tokenIn` units like `fees[].amount`. It is part of `amountIn`, not charged on top of it. Null on same-network operations, and when the route cannot price it.", "examples": [ "0.935" ] }, "chain": { "description": "The blockchain network where liquidity was provided.", "allOf": [ { "$ref": "#/components/schemas/ChainDTO" } ], "examples": [ 42161 ] }, "liquidityProvider": { "type": "string", "description": "The provider used for the liquidity.", "enum": [ "UNISWAP_V3", "PANCAKESWAP_V3", "UNISWAP_V4" ], "examples": [ "UNISWAP_V3" ] }, "nftAddress": { "type": "string", "description": "Address of the NFT that will be created to represent the liquidity.", "pattern": "^0x[a-fA-F0-9]{40}$", "examples": [ "0xc36442b4a4522e871399cd717abdd847ab11fe88" ] }, "estimatedApr": { "type": "string", "description": "Estimated annualized APR (in percentage) for the simulated position.", "examples": [ "18.42" ] } }, "required": [ "metadata", "poolId", "tickSpacing", "staked", "rewards", "userOperationHash", "revertReason", "authorization", "stakeApprovalUserOperation", "tokenIn", "amountIn", "tokenInAmountForToken0", "tokenInAmountForToken1", "walletAddress", "expiresAt", "amounts", "fees", "collectedPoolFees", "estimatedGasFees", "bridgeFee", "chain", "liquidityProvider", "nftAddress", "estimatedApr" ] } ``` ### Schema LiquidityRewardDTO ```json { "type": "object", "properties": { "token": { "description": "Reward token the operation pays out.", "allOf": [ { "$ref": "#/components/schemas/CryptoCurrency" } ] }, "amount": { "type": "string", "description": "Estimated amount of the reward token paid to the wallet, at the time of the quote.", "examples": [ "0.35" ] } }, "required": [ "token", "amount" ] } ``` ### Schema CryptoCurrency ```json { "type": "object", "properties": { "name": { "type": "string", "description": "Full name of the token", "examples": [ "Wrapped Bitcoin" ] }, "symbol": { "type": "string", "description": "Ticker symbol of the token", "examples": [ "WBTC" ] }, "decimals": { "type": "number", "description": "Maximum amount of decimals this token supports", "examples": [ 18 ] }, "address": { "type": "string", "description": "Address of the token as its blockchain writes it: a checksummed `0x` address on EVM chains, a `C…` contract on Stellar, and `0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE` for the native coin of any chain", "examples": [ "0x2f2a2543b76a4166549f7aab2e75bef0aefc5b0f" ] }, "logoURL": { "type": [ "string", "null" ], "description": "URL to an image of the logo of the token", "examples": [ "https://assets.notus.team/wbtc.png" ] } }, "required": [ "name", "symbol", "decimals", "address", "logoURL" ] } ``` ### Schema RevertReasonDTO ```json { "type": "object", "properties": { "decoded": { "type": [ "string", "null" ], "description": "The decoded, human-readable, error message. We try to support as many error messages as possible, but if we can't decode the message, then this will be `null`.", "examples": [ "ERC-20 insufficient balance. Address 0xf12534a4939c7fbda50f893774a9525265fe1a9a has 120. The operation requested 200." ] }, "raw": { "type": "string", "description": "The raw bytes value of the error we received from the blockchain, including the error function signature. You can use https://www.4byte.directory/ to find the function to further decode it.", "pattern": "^0x([a-fA-F0-9]{2})*$", "examples": [ "0xe450d38c000000000000000000000000f12534a4939c7fbda50f893774a9525265fe1a9a0000000000000000000000000000000000000000000000068155a43676e0000000000000000000000000000000000000000000000000000ad78ebc5ac6200000" ] }, "utf8": { "type": "string", "description": "The error message converted to UTF-8. This is a direct transformation, we do not check if it even makes sense, if the error message does not contain strings this will return garbage on those parts. This already excludes the function signature.", "examples": [ "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000�%4�����\u000f�7t�RRe�\u001a�\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0006�U�6v�\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\n׎�Z� \u0000\u0000" ] } }, "required": [ "decoded", "raw", "utf8" ] } ``` ### Schema AuthorizationDTO ```json { "type": "object", "properties": { "chainId": { "type": "number", "description": "The Chain ID where the authorization is being made. Meaning this authorization will only work on this blockchain.", "examples": [ 42161 ] }, "address": { "type": "string", "description": "The contract that the EOA will delegate to. Once allowed the EOA \"becomes\" this contract.", "pattern": "^0x[a-fA-F0-9]{40}$", "examples": [ "0xd6cedde84be40893d153be9d467cd6ad37875b28" ] }, "nonce": { "type": "number", "description": "The nonce value of the EOA, the authorization will only work if the next nonce of the EOA is this one. If the EOA executes another transaction before this authorization the user operation will revert.", "examples": [ 10 ] }, "hash": { "type": "string", "description": "The hash that must be signed that includes the information of the other fields as defined by EIP-7702. This is useful if using a language without a web3 library and you need to use the signing primitives. Or you can also call viem's sign with this as `signAuthorization` will simply re-generate this hash.", "pattern": "^0x[a-fA-F0-9]{64}$", "examples": [ "0x777811ae5d51875409b9978ddc1b40a9da1bbe9570040bdd7c5f186d70ceceba" ] } }, "required": [ "chainId", "address", "nonce", "hash" ] } ``` ### Schema StakeApprovalUserOperationDTO ```json { "type": "object", "properties": { "userOperationHash": { "type": "string", "description": "Hash of the sponsored approval operation to sign.", "pattern": "^0x[a-fA-F0-9]{64}$", "examples": [ "0x2aac7a66d5331454eafc9b981be3596ad08a40dad24883e3b9c4a5362cd7f7e1" ] }, "authorization": { "description": "EIP-7702 Authorization. If the wallet is supposed to be an EIP-7702 wallet, then this field will be available for the first user operation. Signing this is mandatory for EIP-7702, and is not part of the signing of the user operation hash.\n\n**ATTENTION**: This signature is not the same as the user operation signature, you don't use viem's `signMessage` but `signAuthorization`, or plain `sign` with the `hash` field.", "type": [ "object", "null" ], "allOf": [ { "$ref": "#/components/schemas/AuthorizationDTO" } ] } }, "required": [ "userOperationHash", "authorization" ] } ``` ### Schema SwapLiquidityAmountDTO ```json { "type": "object", "properties": { "token": { "description": "Details about the cryptocurrency used", "allOf": [ { "$ref": "#/components/schemas/CryptoCurrency" } ] }, "amount": { "type": "string", "description": "Amount in the crypto currency itself as a decimal number in a string. So if it's WBTC this is the value in WBTC, if it's USDC it's the amount in USDC. \n**Attention**: This value can be larger than what JavaScript can handle \n**Attention**: Remember that floats can have rounding issues, but the blockchain does not operate with floats", "examples": [ "3342.7389263" ] }, "amountIn": { "description": "Amount converted to different currencies at the price of the execution of the operation", "type": [ "object", "null" ], "allOf": [ { "$ref": "#/components/schemas/QuoteAmountCurrencies" } ] }, "cryptoCurrency": { "deprecated": true, "description": "**DEPRECATED**: Use `token` instead", "allOf": [ { "$ref": "#/components/schemas/CryptoCurrency" } ] }, "protocolMinAmount": { "type": [ "object", "null" ], "description": "Minimum amount accepted by the liquidity protocol after applying its position and slippage calculations.", "examples": [ "3342.7389263" ] } }, "required": [ "token", "amount", "cryptoCurrency", "protocolMinAmount" ] } ``` ### Schema QuoteAmountCurrencies ```json { "type": "object", "properties": { "btc": { "type": "string", "description": "[Cryptocurrency] Bitcoin", "examples": [ "1234.98765" ] }, "eth": { "type": "string", "description": "[Cryptocurrency] Ether", "examples": [ "1234.98765" ] }, "ltc": { "type": "string", "description": "[Cryptocurrency] Litecoin", "examples": [ "1234.98765" ] }, "bch": { "type": "string", "description": "[Cryptocurrency] Bitcoin Cash", "examples": [ "1234.98765" ] }, "bnb": { "type": "string", "description": "[Cryptocurrency] Binance Coin", "examples": [ "1234.98765" ] }, "eos": { "type": "string", "description": "[Cryptocurrency] EOS", "examples": [ "1234.98765" ] }, "xrp": { "type": "string", "description": "[Cryptocurrency] XRP", "examples": [ "1234.98765" ] }, "xlm": { "type": "string", "description": "[Cryptocurrency] Lumens", "examples": [ "1234.98765" ] }, "link": { "type": "string", "description": "[Cryptocurrency] Chainlink", "examples": [ "1234.98765" ] }, "dot": { "type": "string", "description": "[Cryptocurrency] Polkadot", "examples": [ "1234.98765" ] }, "yfi": { "type": "string", "description": "[Cryptocurrency] Yearn.finance", "examples": [ "1234.98765" ] }, "usd": { "type": "string", "description": "[Fiat currency] US Dollar", "examples": [ "1234.98765" ] }, "aed": { "type": "string", "description": "[Fiat currency] United Arab Emirates Dirham", "examples": [ "1234.98765" ] }, "ars": { "type": "string", "description": "[Fiat currency] Argentine Peso", "examples": [ "1234.98765" ] }, "aud": { "type": "string", "description": "[Fiat currency] Australian Dollar", "examples": [ "1234.98765" ] }, "bdt": { "type": "string", "description": "[Fiat currency] Bangladeshi Taka", "examples": [ "1234.98765" ] }, "bhd": { "type": "string", "description": "[Fiat currency] Bahraini Dinar", "examples": [ "1234.98765" ] }, "bmd": { "type": "string", "description": "[Fiat currency] Bermudian Dollar", "examples": [ "1234.98765" ] }, "brl": { "type": "string", "description": "[Fiat currency] Brazil Real", "examples": [ "1234.98765" ] }, "cad": { "type": "string", "description": "[Fiat currency] Canadian Dollar", "examples": [ "1234.98765" ] }, "chf": { "type": "string", "description": "[Fiat currency] Swiss Franc", "examples": [ "1234.98765" ] }, "clp": { "type": "string", "description": "[Fiat currency] Chilean Peso", "examples": [ "1234.98765" ] }, "cny": { "type": "string", "description": "[Fiat currency] Chinese Yuan", "examples": [ "1234.98765" ] }, "czk": { "type": "string", "description": "[Fiat currency] Czech Koruna", "examples": [ "1234.98765" ] }, "dkk": { "type": "string", "description": "[Fiat currency] Danish Krone", "examples": [ "1234.98765" ] }, "eur": { "type": "string", "description": "[Fiat currency] Euro", "examples": [ "1234.98765" ] }, "gbp": { "type": "string", "description": "[Fiat currency] British Pound Sterling", "examples": [ "1234.98765" ] }, "gel": { "type": "string", "description": "[Fiat currency] Georgian Lari", "examples": [ "1234.98765" ] }, "hkd": { "type": "string", "description": "[Fiat currency] Hong Kong Dollar", "examples": [ "1234.98765" ] }, "huf": { "type": "string", "description": "[Fiat currency] Hungarian Forint", "examples": [ "1234.98765" ] }, "idr": { "type": "string", "description": "[Fiat currency] Indonesian Rupiah", "examples": [ "1234.98765" ] }, "ils": { "type": "string", "description": "[Fiat currency] Israeli New Shekel", "examples": [ "1234.98765" ] }, "inr": { "type": "string", "description": "[Fiat currency] Indian Rupee", "examples": [ "1234.98765" ] }, "jpy": { "type": "string", "description": "[Fiat currency] Japanese Yen", "examples": [ "1234.98765" ] }, "krw": { "type": "string", "description": "[Fiat currency] South Korean Won", "examples": [ "1234.98765" ] }, "kwd": { "type": "string", "description": "[Fiat currency] Kuwaiti Dinar", "examples": [ "1234.98765" ] }, "lkr": { "type": "string", "description": "[Fiat currency] Sri Lankan Rupee", "examples": [ "1234.98765" ] }, "mmk": { "type": "string", "description": "[Fiat currency] Burmese Kyat", "examples": [ "1234.98765" ] }, "mxn": { "type": "string", "description": "[Fiat currency] Mexican Peso", "examples": [ "1234.98765" ] }, "myr": { "type": "string", "description": "[Fiat currency] Malaysian Ringgit", "examples": [ "1234.98765" ] }, "ngn": { "type": "string", "description": "[Fiat currency] Nigerian Naira", "examples": [ "1234.98765" ] }, "nok": { "type": "string", "description": "[Fiat currency] Norwegian Krone", "examples": [ "1234.98765" ] }, "nzd": { "type": "string", "description": "[Fiat currency] New Zealand Dollar", "examples": [ "1234.98765" ] }, "php": { "type": "string", "description": "[Fiat currency] Philippine Peso", "examples": [ "1234.98765" ] }, "pkr": { "type": "string", "description": "[Fiat currency] Pakistani Rupee", "examples": [ "1234.98765" ] }, "pln": { "type": "string", "description": "[Fiat currency] Polish Zloty", "examples": [ "1234.98765" ] }, "rub": { "type": "string", "description": "[Fiat currency] Russian Ruble", "examples": [ "1234.98765" ] }, "sar": { "type": "string", "description": "[Fiat currency] Saudi Riyal", "examples": [ "1234.98765" ] }, "sek": { "type": "string", "description": "[Fiat currency] Swedish Krona", "examples": [ "1234.98765" ] }, "sgd": { "type": "string", "description": "[Fiat currency] Singapore Dollar", "examples": [ "1234.98765" ] }, "thb": { "type": "string", "description": "[Fiat currency] Thai Baht", "examples": [ "1234.98765" ] }, "try": { "type": "string", "description": "[Fiat currency] Turkish Lira", "examples": [ "1234.98765" ] }, "twd": { "type": "string", "description": "[Fiat currency] New Taiwan Dollar", "examples": [ "1234.98765" ] }, "uah": { "type": "string", "description": "[Fiat currency] Ukrainian hryvnia", "examples": [ "1234.98765" ] }, "vef": { "type": "string", "description": "[Fiat currency] Venezuelan bolívar fuerte", "examples": [ "1234.98765" ] }, "vnd": { "type": "string", "description": "[Fiat currency] Vietnamese đồng", "examples": [ "1234.98765" ] }, "zar": { "type": "string", "description": "[Fiat currency] South African Rand", "examples": [ "1234.98765" ] }, "xdr": { "type": "string", "description": "[Fiat currency] IMF Special Drawing Rights", "examples": [ "1234.98765" ] }, "xag": { "type": "string", "description": "[Commodities] Silver - Troy Ounce", "examples": [ "1234.98765" ] }, "xau": { "type": "string", "description": "[Commodities] Gold - Troy Ounce", "examples": [ "1234.98765" ] }, "bits": { "type": "string", "description": "[Cryptocurrency] Bitcoin Bits", "examples": [ "1234.98765" ] }, "sats": { "type": "string", "description": "[Cryptocurrency] Bitcoin Satoshi", "examples": [ "1234.98765" ] } }, "required": [ "btc", "eth", "ltc", "bch", "bnb", "eos", "xrp", "xlm", "link", "dot", "yfi", "usd", "aed", "ars", "aud", "bdt", "bhd", "bmd", "brl", "cad", "chf", "clp", "cny", "czk", "dkk", "eur", "gbp", "gel", "hkd", "huf", "idr", "ils", "inr", "jpy", "krw", "kwd", "lkr", "mmk", "mxn", "myr", "ngn", "nok", "nzd", "php", "pkr", "pln", "rub", "sar", "sek", "sgd", "thb", "try", "twd", "uah", "vef", "vnd", "zar", "xdr", "xag", "xau", "bits", "sats" ] } ``` ### Schema FeeDTO ```json { "type": "object", "properties": { "amount": { "type": "string", "description": "The calculated amount of the fee deducted from the input token, expressed as a decimal string.", "examples": [ "100.5" ] }, "token": { "type": "string", "description": "The token address from which the fee is deducted: hexadecimal on EVM chains, the USDC contract (`C…`) on Stellar, the base58 mint on Solana. This is always the input token of the swap.", "pattern": "^0x[a-fA-F0-9]{40}$|^C[A-Z2-7]{55}$|^[1-9A-HJ-NP-Za-km-z]{32,44}$", "examples": [ "0x1234567890123456789012345678901234567890" ] }, "toAddress": { "type": "string", "description": "The address receiving the fee. For NOTUS fees, this is an internal API address. For CLIENT fees, this can be either the treasury address configured in the dashboard (for transaction fees) or the custom address specified in the extraFee parameter (for extra fees). On a swap from Solana, the Solana treasury.", "pattern": "^0x[a-fA-F0-9]{40}$|^(?:[13][a-km-zA-HJ-NP-Z1-9]{25,35}|bc1q[02-9ac-hj-np-z]{38}|bc1q[02-9ac-hj-np-z]{58}|bc1p[02-9ac-hj-np-z]{10,70})$|^[1-9A-HJ-NP-Za-km-z]{32,44}$", "examples": [ "0x1234567890123456789012345678901234567890" ] }, "type": { "type": "string", "description": "The type of the fee. NOTUS: internal API fee that is automatically charged and cannot be modified. CLIENT: includes both the transaction fee (configured in the dashboard or via transactionFeePercent parameter) and the optional extra fee (specified via the extraFee parameter).", "enum": [ "NOTUS", "CLIENT" ], "examples": [ "NOTUS" ] }, "percentage": { "type": "string", "description": "The percentage rate of the fee applied to the input amount, expressed as a decimal string (e.g., \"2\" represents 2%).", "examples": [ "2" ] } }, "required": [ "amount", "token", "toAddress", "type", "percentage" ] } ``` ### Schema QuoteAmount ```json { "type": "object", "properties": { "token": { "description": "Details about the cryptocurrency used", "allOf": [ { "$ref": "#/components/schemas/CryptoCurrency" } ] }, "amount": { "type": "string", "description": "Amount in the crypto currency itself as a decimal number in a string. So if it's WBTC this is the value in WBTC, if it's USDC it's the amount in USDC. \n**Attention**: This value can be larger than what JavaScript can handle \n**Attention**: Remember that floats can have rounding issues, but the blockchain does not operate with floats", "examples": [ "3342.7389263" ] }, "amountIn": { "description": "Amount converted to different currencies at the price of the execution of the operation", "type": [ "object", "null" ], "allOf": [ { "$ref": "#/components/schemas/QuoteAmountCurrencies" } ] }, "cryptoCurrency": { "deprecated": true, "description": "**DEPRECATED**: Use `token` instead", "allOf": [ { "$ref": "#/components/schemas/CryptoCurrency" } ] } }, "required": [ "token", "amount", "cryptoCurrency" ] } ``` ### Schema EstimatedGasFees ```json { "type": "object", "properties": { "payGasFeeToken": { "type": "string", "description": "Address of the token used to pay the fee. On a Stellar CCTP redeem, the USDC contract (`C…`) on Stellar.", "pattern": "^0x[a-fA-F0-9]{40}$|^C[A-Z2-7]{55}$", "examples": [ "0xc2132d05d31c914a87c6611c10748aeb04b58e8f" ] }, "maxGasFeeToken": { "type": "string", "deprecated": true, "description": "**DEPRECATED**: Use `gasFeeTokenAmount` instead.", "examples": [ "12.345" ] }, "gasFeeTokenAmount": { "type": "string", "description": "Amount paid to cover gas fees in the token itself, this is how much really left the user wallet.", "examples": [ "12.345" ] }, "gasFeeTokenAmountUSD": { "type": "string", "description": "Amount paid to cover gas fees in USD, this is a conversion done at the time the quote was created..", "examples": [ "0.321" ] }, "maxGasFeeNative": { "type": "string", "description": "Maximum cost, in the native chain currency, of each unit of gas that this transaction will accept. This value is constantly updated based on the state of the blockchain. This value is multiplied by the amount of gas the transaction uses to set a cost of the transaction." }, "recipientAccountOpening": { "description": "Kept for the clients that still read it: null or absent.", "type": [ "object", "null" ], "allOf": [ { "$ref": "#/components/schemas/RecipientAccountOpeningDTO" } ] } }, "required": [ "payGasFeeToken", "maxGasFeeToken", "gasFeeTokenAmount", "gasFeeTokenAmountUSD", "maxGasFeeNative" ] } ``` ### Schema RecipientAccountOpeningDTO ```json { "type": "object", "properties": { "tokenAmount": { "type": "string", "description": "The account's rent in the token sent, converted as the network fee is.", "examples": [ "0.157" ] }, "tokenAmountUSD": { "type": "string", "description": "`tokenAmount` in USD, a conversion done at the time the quote was created.", "examples": [ "0.157" ] }, "nativeAmount": { "type": "string", "description": "The account's rent in SOL.", "examples": [ "0.00203928" ] } }, "required": [ "tokenAmount", "tokenAmountUSD", "nativeAmount" ] } ``` ### Schema ChainDTO ```json { "type": "object", "properties": { "id": { "type": "number", "description": "EVM ID of the blockchain", "examples": [ 137 ] }, "name": { "type": "string", "description": "Name of the blockchain", "examples": [ "POLYGON" ] }, "logo": { "type": "string", "description": "URL for a logo of the blockchain", "examples": [ "https://logopolygon.com" ] } }, "description": "Basic information about a blockchain", "required": [ "id", "name", "logo" ] } ```