### Dynamic Documentation Query Example Source: https://documentation.kodiak.finance/developers/panda/smart-contract-reference/panda-token Demonstrates how to query documentation dynamically by making an HTTP GET request with an 'ask' query parameter. The response will contain a direct answer and relevant excerpts. ```http GET https://documentation.kodiak.finance/developers/panda/smart-contract-reference/panda-token.md?ask= ``` -------------------------------- ### Example Price Range Setup and Validation Source: https://documentation.kodiak.finance/developers/panda/technical-integration-guide Sets up minimum and maximum prices, converts them to square root prices, and validates the range against protocol constants. Ensure the calculated multiple falls within the defined MIN_SQRTP_MULTIPLE and MAX_SQRTP_MULTIPLE. ```javascript // Example price range setup const minPrice = 1; // 1 BASE per TOKEN const maxPrice = 10; // 10 BASE per TOKEN const sqrtPa = displayToSqrtPrice(minPrice); const sqrtPb = displayToSqrtPrice(maxPrice); // Verify range is valid const multiple = (sqrtPb * 10000) / sqrtPa; if (multiple < MIN_SQRTP_MULTIPLE || multiple > MAX_SQRTP_MULTIPLE) { throw new Error('Invalid price range'); } ``` -------------------------------- ### Dynamic Documentation Query Example Source: https://documentation.kodiak.finance/developers/panda/subgraph To query this documentation dynamically, perform an HTTP GET request to the page URL with an 'ask' query parameter. The question should be specific and self-contained. ```http GET https://documentation.kodiak.finance/developers/panda/subgraph.md?ask= ``` -------------------------------- ### Token Pricing Response Example Source: https://documentation.kodiak.finance/developers/backend-api Example JSON response for the GET /tokens endpoint, showing an array of token objects with their pricing and metadata. ```json [ { "id": "0xc60ea9801b3f1b01da373c05381e6ce8ff94d76f", "symbol": "KODI SolvBTC.BNB-SolvBTC", "name": "Kodiak Island SolvBTC.BNB-SolvBTC-2%", "decimals": 18, "price": 92597.7754576649, "totalSupply": 594.801589203266, "priceStrategy": "vault", "lastIndexed": "2025-08-25T17:55:46.716Z" } ] ``` -------------------------------- ### User Balances Response Example Source: https://documentation.kodiak.finance/developers/backend-api Example JSON response structure for the GET /balances endpoint, detailing user account, total balance, breakdown by source, and the last synced block number. ```json { "results": [ { "account": "0xb83742330443f7413dbd2abdfc046db0474a944e", "total": 42175.929775565106, "sources": [ { "source": "balance", "value": 23378.656358324366 }, { "source": "island", "value": 1.1062169805412183, "extraData": { "islandId": "0xa0cabfc04fc420b3d31ba431d18eb5bd33b3f334" } }, { "source": "external_vaults", "value": 10485.409406599369 }, { "source": "v3-position", "value": 0.015593277755401007, "extraData": { "positionId": "1917" } }, { "source": "v3-position", "value": 8310.742200383076, "extraData": { "positionId": "1942" } } ], "expanded": "balance: 23378.656358324366, island: 1.1062169805412183, external_vaults: 10485.409406599369, v3-position: 0.015593277755401007, v3-position: 8310.742200383076" } ], "lastSyncedBlock": 4726990 } ``` -------------------------------- ### Farm Not Started Yet Error Source: https://documentation.kodiak.finance/developers/farms/smart-contract-reference Indicates that the farm has not been initialized yet. ```solidity "Farm: not started yet" ``` -------------------------------- ### Querying Documentation via HTTP GET Source: https://documentation.kodiak.finance/developers/panda/smart-contract-reference/panda-factory Demonstrates how to query this documentation dynamically by performing an HTTP GET request with an 'ask' query parameter. This is useful for retrieving specific information not explicitly present on the page. ```http GET https://documentation.kodiak.finance/developers/panda/smart-contract-reference/panda-factory.md?ask= ``` -------------------------------- ### Example Response for Listing Tokens Source: https://documentation.kodiak.finance/developers/dex/pricing-with-subgraph This is an example of the JSON response structure you can expect when querying for a list of tokens and the ETH price. ```json { "data": { "tokens": [ { "id": "0x...123", "symbol": "USDT", "name": "Tether", "derivedETH": "0.0005" }, { "id": "0x...456", "symbol": "USDC", "name": "USD Coin", "derivedETH": "0.0005" } ], "bundle": { "ethPrice": "2000" } } } ``` -------------------------------- ### Query Documentation via HTTP GET Source: https://documentation.kodiak.finance/tokens/distribution Perform an HTTP GET request to the current page URL with the 'ask' query parameter to dynamically query the documentation. Use this when information is not explicitly present or requires clarification. ```HTTP GET https://documentation.kodiak.finance/tokens/distribution.md?ask= ``` -------------------------------- ### Query Documentation via HTTP GET Source: https://documentation.kodiak.finance/overview To get additional information not directly present, perform an HTTP GET request with the 'ask' query parameter. The question should be specific and self-contained. Use this for clarifications or retrieving related documentation. ```http GET https://documentation.kodiak.finance/overview.md?ask= ``` -------------------------------- ### Example Points Calculation (Season 1) Source: https://documentation.kodiak.finance/protocol/perps/points An example demonstrating the calculation of points for a trader who also refers other users, based on Season 1 methodology. ```plaintext broker_fee = 5M * (0.013% - 0) + 5M * (0.04% - 0.01%) = 650 + 1500 = 2150 referred_broker_fee = 1M * (0.04% - 0.01%) = 300 points = 2150 * 10% * 300 = 2180 ``` -------------------------------- ### Query Documentation via HTTP GET Source: https://documentation.kodiak.finance/overview/contact-us To get additional information not directly available on a page, perform an HTTP GET request with the `ask` query parameter. The question should be specific and in natural language. The response includes the answer and relevant excerpts. ```http GET https://documentation.kodiak.finance/overview/contact-us.md?ask= ``` -------------------------------- ### Query Documentation via HTTP GET Source: https://documentation.kodiak.finance/tokens/kdk-foundation Perform an HTTP GET request to query documentation dynamically. Use this when the answer is not explicitly present on the page, requires clarification, or you want to retrieve related sections. ```http GET https://documentation.kodiak.finance/tokens/kdk-foundation.md?ask= ``` -------------------------------- ### Query Documentation via HTTP GET Source: https://documentation.kodiak.finance/protocol/perps/points To get additional information not present on the current page, perform an HTTP GET request to the page URL with an 'ask' query parameter containing your question. ```http GET https://documentation.kodiak.finance/protocol/perps/points.md?ask= ``` -------------------------------- ### Query Documentation via HTTP GET Source: https://documentation.kodiak.finance/informational/tradingview-advanced-license To get information not explicitly on the page, perform an HTTP GET request to the current page URL with the 'ask' query parameter. The question should be specific and in natural language. ```http GET https://documentation.kodiak.finance/informational/tradingview-advanced-license.md?ask= ``` -------------------------------- ### Querying Documentation via HTTP GET Source: https://documentation.kodiak.finance/protocol/islands/island-mechanics/strategies To get additional information not directly present on the page, perform an HTTP GET request with the 'ask' query parameter. The question should be specific and in natural language. ```http GET https://documentation.kodiak.finance/protocol/islands/island-mechanics/strategies.md?ask= ``` -------------------------------- ### Querying Documentation Dynamically Source: https://documentation.kodiak.finance/developers/backend-api To get information not explicitly present, make an HTTP GET request to the page URL with an 'ask' query parameter containing your question in natural language. The response will include a direct answer and relevant documentation excerpts. ```http GET https://documentation.kodiak.finance/developers/backend-api.md?ask= ``` -------------------------------- ### Kodiak Finance: TypeScript Implementation Example for Native Deposit Source: https://documentation.kodiak.finance/developers/kodiak-islands/smart-contract-reference/kodiak-island-router This TypeScript example demonstrates how to execute a single native token deposit using ethers.js. It includes calculating the BERA amount, preparing swap parameters, and calling the `addLiquiditySingleNative` function on the island router. Ensure appropriate slippage and addresses are set. ```typescript // 1. Calculate BERA amount to send const beraAmount = ethers.parseEther("1.0"); // 2. Prepare swap parameters const swapParams = { zeroForOne: true, amountIn: swapAmount, minAmountOut: minOutput, routeData: swapCalldata }; // 3. Execute native deposit const tx = await islandRouter.addLiquiditySingleNative( islandAddress, minimumShares, 100, // 1% max slippage swapParams, receiverAddress, { value: beraAmount } ); ``` -------------------------------- ### Building a Dashboard Source: https://documentation.kodiak.finance/developers/kodiak-islands/subgraph/query-guide Example query to fetch data suitable for a vault performance dashboard. ```APIDOC ## GET /graphql ### Description Aggregate protocol metrics, top vaults, and recent activity for a dashboard view. ### Method POST ### Endpoint /graphql ### Request Body ```json { "query": "query DashboardData {\n protocol: kodiakIslandProtocols(first: 1) {\n totalValueLockedUSD\n totalPoolCount\n }\n vaults: kodiakVaults(\n first: 10\n orderBy: totalValueLockedUSD\n orderDirection: desc\n ) {\n id\n name\n totalValueLockedUSD\n apr {\n averageApr\n }\n }\n recentActivity: kodiakDeposits(\n first: 5\n orderBy: timestamp\n orderDirection: desc\n ) {\n timestamp\n vault {\n name\n }\n amountUSD\n }\n}" } ``` ### Response #### Success Response (200) - **protocol** (Object) - Overall protocol statistics. - **totalValueLockedUSD** (String) - Total value locked across all protocols. - **totalPoolCount** (Int) - Total number of pools. - **vaults** (Array) - List of top vaults. - **id** (String) - Vault identifier. - **name** (String) - Vault name. - **totalValueLockedUSD** (String) - TVL for the vault. - **apr** (Object) - APR information. - **averageApr** (String) - Average APR. - **recentActivity** (Array) - List of recent deposit activities. - **timestamp** (String) - Timestamp of the activity. - **vault** (Object) - Vault where activity occurred. - **name** (String) - Vault name. - **amountUSD** (String) - Amount in USD. #### Response Example ```json { "data": { "protocol": { "totalValueLockedUSD": "50000000.00", "totalPoolCount": 150 }, "vaults": [ { "id": "0xvault1", "name": "Vault A", "totalValueLockedUSD": "5000000.00", "apr": { "averageApr": "6.0" } } // ... 9 more vaults ], "recentActivity": [ { "timestamp": "1679000000", "vault": { "name": "Vault B" }, "amountUSD": "1000.00" } // ... 4 more activities ] } } ``` ``` -------------------------------- ### Dynamic Documentation Querying Source: https://documentation.kodiak.finance/developers/panda/subgraph/entity-reference Explains how to dynamically query the documentation itself using an HTTP GET request with an `ask` parameter. ```APIDOC ## Agent Instructions: Querying This Documentation ### Description If you need additional information not directly present in the documentation, you can query it dynamically. Perform an HTTP GET request on the documentation URL with the `ask` query parameter. ### Request Example ``` GET https://documentation.kodiak.finance/developers/panda/subgraph/entity-reference.md?ask= ``` ### Instructions The `` should be specific, self-contained, and in natural language. The response will include a direct answer and relevant excerpts. ``` -------------------------------- ### Get Hourly Price Data Source: https://documentation.kodiak.finance/developers/panda/subgraph/query-guide Retrieve hourly price snapshots for a specific pool, starting from a given timestamp. Useful for historical price analysis. ```graphql # Get hourly price data { priceSnapshots( where: { pool: "0x123...", timeframe: HOUR, timestamp_gt: "1634567890" } orderBy: timestamp orderDirection: asc ) { timestamp open high low close } } ``` -------------------------------- ### Example Pagination Source: https://documentation.kodiak.finance/developers/kodiak-islands/api Demonstrates how to paginate through results using 'offset' and 'limit' parameters. Adjust 'offset' to retrieve subsequent pages. ```http offset=0&limit=20 ``` ```http offset=20&limit=20 ``` ```http offset=40&limit=20 ``` -------------------------------- ### initialize Source: https://documentation.kodiak.finance/developers/kodiak-islands/smart-contract-reference/kodiak-island Initializes the contract with core parameters. ```APIDOC ## POST /initialize ### Description Initializes the contract with essential parameters including name, symbol, pool address, fee settings, and tick range. ### Method POST ### Endpoint `/initialize` ### Parameters #### Request Body - **_name** (string) - Required - The name of the pair. - **_symbol** (string) - Required - The symbol of the pair. - **_pool** (address) - Required - The address of the underlying pool. - **_managerFeeBPS** (uint16) - Required - The manager fee in basis points. - **_lowerTick** (int24) - Required - The lower bound of the tick range. - **_upperTick** (int24) - Required - The upper bound of the tick range. - **_manager_** (address) - Required - The address of the manager. ``` -------------------------------- ### JavaScript Example: Adding Liquidity with Two Tokens Source: https://documentation.kodiak.finance/developers/kodiak-islands/smart-contract-reference/kodiak-island-router Demonstrates how to add liquidity using both tokens. It involves calculating optimal deposit amounts, setting slippage tolerance, approving the router, and executing the transaction. Use `callStatic` for simulation before the actual transaction. ```javascript // 1. Start with maximum amounts to deposit, for example 10 token0 and 10 token1 const amount0Max = ethers.parseUnits("10", token0Decimals); const amount1Max = ethers.parseUnits("10", token1Decimals); // 2. Find the appropriate ratio of tokens to deposit (amount0Used, amount1Used, ) = await island.getMintAmounts(amount0Max, amount1Max) amount0Max = amount0Used amount1Max = amount1Used // 3. Set slippage tolerance for the minimum amounts of token0 and token1 // (e.g. 1% slippage). This means that atleast 99% of these tokens should // be deposited in the pool. This gives you a protection from the pool price // deviating a lot before your transaction goes through // which affects the tokens and ratio they are deposited in const amount0Min = amount0Max.mul(99).div(100); const amount1Min = amount1Max.mul(99).div(100); const amountSharesMin = 0; // Set based on expected shares // 4. Approve router await token0.approve(routerAddress, amount0Max); await token1.approve(routerAddress, amount1Max); // 5. Callstatic deposit to get the amountShares minted const simulationResult = await router.callStatic.addLiquidity( islandAddress, amount0Max, amount1Max, amount0Min, amount1Min, amountSharesMin, receiverAddress ); // 6. Mint Island tokens, Use the mintAmount from above // add a comfortable slippage (ex 1%) to this and use this for amountSharesMin // Use BPS for higher precision. amountSharesMin = simulationResult[2] .mul(99).div(100).toString() const tx = await router.addLiquidity( islandAddress, amount0Max, amount1Max, amount0Min, amount1Min, amountSharesMin, receiverAddress ); ``` -------------------------------- ### Add and Commit Project Files Source: https://documentation.kodiak.finance/user-guide/add-your-project-to-the-ecosystem Stage your project logo and JSON details, then commit them with a descriptive message. Finally, push the changes to your remote branch. ```bash git add ecosystem/logo/yourproject.png git add ecosystem/projects.json git commit -m "Add [Your Project Name] to ecosystem" git push origin add-your-project-name ``` -------------------------------- ### Initialize KodiakFarm Instance Source: https://documentation.kodiak.finance/developers/farms/smart-contract-reference Use this function to set up a new KodiakFarm instance. Ensure all array parameters have matching lengths and that reward tokens are not duplicated. ```solidity function initialize( address _owner, address _stakingToken, address[] memory _rewardTokens, address[] memory _rewardManagers, uint256[] memory _rewardRates, bytes calldata _data ) external nonReentrant ``` -------------------------------- ### Prepare Deployment Parameters Source: https://documentation.kodiak.finance/developers/panda/technical-integration-guide Constructs the parameters object required for deploying a new Panda token. Includes base token address, price range limits (as square root prices), and vesting period. ```javascript const params = { baseToken: baseTokenAddress, sqrtPa: calculateSqrtPrice(minPrice), sqrtPb: calculateSqrtPrice(maxPrice), vestingPeriod: 0 // No vesting for standard deployment }; ``` -------------------------------- ### Dynamic Documentation Query Source: https://documentation.kodiak.finance/developers/panda/smart-contract-reference/panda-pool Perform an HTTP GET request on the current page URL with the `ask` query parameter to dynamically query documentation. The question should be specific and self-contained. ```http GET https://documentation.kodiak.finance/developers/panda/smart-contract-reference/panda-pool.md?ask= ``` -------------------------------- ### Perform HTTP GET Request with 'ask' Parameter Source: https://documentation.kodiak.finance/user-guide/create-a-v3-position Use this method to query documentation dynamically. The question should be specific and in natural language. The response includes a direct answer and relevant excerpts. ```HTTP GET https://documentation.kodiak.finance/user-guide/create-a-v3-position.md?ask= ``` -------------------------------- ### Perform Dynamic Documentation Query Source: https://documentation.kodiak.finance/developers/kodiak-islands/smart-contract-reference/kodiak-island-factory Use this method to query documentation dynamically by asking a question. Perform an HTTP GET request on the current page URL with the `ask` query parameter. The question should be specific, self-contained, and written in natural language. ```http GET https://documentation.kodiak.finance/developers/kodiak-islands/smart-contract-reference/kodiak-island-factory.md?ask= ``` -------------------------------- ### GET Request for Token Swap Quote Source: https://documentation.kodiak.finance/developers/dex/swap-api-kx Use this GET request to fetch a token swap quote. Include parameters like token addresses, chain IDs, amount, swap type, and optionally recipient and slippage tolerance for transaction data. ```http GET https://backend.kodiak.finance/quote?tokenInAddress=BERA&tokenInChainId=80094&tokenOutAddress=0xFCBD14DC51f0A4d49d5E53C2E0950e0bC26d0Dce&tokenOutChainId=80094&amount=100000000000000000000&type=exactIn&recipient=0x5a1e747482F8773fe52Cca9951E956F456EFd0Bf&slippageTolerance=1 ``` -------------------------------- ### Query Documentation Dynamically Source: https://documentation.kodiak.finance/user-guide Perform an HTTP GET request to query documentation dynamically using the `ask` query parameter. The question should be specific and in natural language. Use this for clarification or retrieving related documentation. ```HTTP GET https://documentation.kodiak.finance/user-guide.md?ask= ``` -------------------------------- ### Token Information Source: https://documentation.kodiak.finance/developers/kodiak-islands/smart-contract-reference/kodiak-island APIs to get the addresses of token0 and token1. ```APIDOC ## Get Token0 ### Description Returns the address of token0. ### Method VIEW ### Endpoint N/A (Smart Contract Function) ### Parameters None ### Response #### Success Response (200) - **token0** (IERC20) - The address of token0. ### Response Example ```json { "token0": "0x1f9840a85d5401d1ae21558f9b66c4207f3519d9" } ``` ## Get Token1 ### Description Returns the address of token1. ### Method VIEW ### Endpoint N/A (Smart Contract Function) ### Parameters None ### Response #### Success Response (200) - **token1** (IERC20) - The address of token1. ### Response Example ```json { "token1": "0x7ceb23fb69c032377bd6b140aa8e61e392197cef" } ``` ``` -------------------------------- ### Get Manager Source: https://documentation.kodiak.finance/developers/kodiak-islands/smart-contract-reference/kodiak-island Returns the current manager address for managed islands. ```APIDOC ## Get Manager ### Description Returns the current manager address. Should be address(0) for unmanaged islands. ### Method VIEW ### Endpoint N/A (Smart Contract Function) ### Parameters None ### Response #### Success Response (200) - **manager** (address) - The current manager address. ### Response Example ```json { "manager": "0xabcdef1234567890abcdef1234567890abcdef12" } ``` ``` -------------------------------- ### Perform HTTP GET Request with 'ask' Parameter Source: https://documentation.kodiak.finance/protocol/perps Use this method to query documentation dynamically when information is not directly available. The question should be specific and self-contained. The response will include a direct answer and relevant excerpts. ```http GET https://documentation.kodiak.finance/protocol/perps.md?ask= ``` -------------------------------- ### Perform HTTP GET Request to Query Documentation Source: https://documentation.kodiak.finance/developers/baults Use this method to query documentation dynamically. Include your question as the value for the 'ask' query parameter. The response will contain a direct answer and relevant excerpts. ```http GET https://documentation.kodiak.finance/developers/baults.md?ask= ``` -------------------------------- ### Get Kodiak Router Address Source: https://documentation.kodiak.finance/developers/kodiak-islands/smart-contract-reference/kodiak-island-router Retrieves the address of the Kodiak Router contract. ```APIDOC ## GET /api/router/address ### Description Fetches the address of the Kodiak Router contract. ### Method GET ### Endpoint /api/router/address ### Response #### Success Response (200) - **address** (address) - The address of the Kodiak Router contract. #### Response Example ```json { "address": "0x..." } ``` ``` -------------------------------- ### Query Documentation Dynamically Source: https://documentation.kodiak.finance/developers/farms Perform an HTTP GET request with the 'ask' query parameter to retrieve specific information not explicitly present on the page. The question should be specific and self-contained. ```HTTP GET https://documentation.kodiak.finance/developers/farms.md?ask= ``` -------------------------------- ### Get All Deployers Source: https://documentation.kodiak.finance/developers/kodiak-islands/smart-contract-reference/kodiak-island-factory Retrieves an array of all addresses that have deployed at least one island. ```solidity function getDeployers() public view returns (address[] memory) ``` -------------------------------- ### Manager Balance Information Source: https://documentation.kodiak.finance/developers/kodiak-islands/smart-contract-reference/kodiak-island APIs to get the manager's balance of token0 and token1. ```APIDOC ## Get Manager Balance 0 ### Description Returns the manager balance of token0. ### Method VIEW ### Endpoint N/A (Smart Contract Function) ### Parameters None ### Response #### Success Response (200) - **managerBalance0** (uint256) - The manager balance of token0. ### Response Example ```json { "managerBalance0": "100000000000000000" } ``` ## Get Manager Balance 1 ### Description Returns the manager balance of token1. ### Method VIEW ### Endpoint N/A (Smart Contract Function) ### Parameters None ### Response #### Success Response (200) - **managerBalance1** (uint256) - The manager balance of token1. ### Response Example ```json { "managerBalance1": "200000000000000000" } ``` ``` -------------------------------- ### Query Documentation with 'ask' parameter Source: https://documentation.kodiak.finance/developers/panda/technical-integration-guide Perform an HTTP GET request on a documentation URL with the 'ask' query parameter to dynamically query for additional information not directly present on the page. The question should be specific and self-contained. ```http GET https://documentation.kodiak.finance/developers/panda/technical-integration-guide.md?ask= ``` -------------------------------- ### Manager Fee Information Source: https://documentation.kodiak.finance/developers/kodiak-islands/smart-contract-reference/kodiak-island APIs to get manager fee details and treasury address. ```APIDOC ## Get Manager Fee BPS ### Description Returns the manager fee in basis points. ### Method VIEW ### Endpoint N/A (Smart Contract Contract) ### Parameters None ### Response #### Success Response (200) - **managerFeeBPS** (uint16) - The manager fee in basis points. ### Response Example ```json { "managerFeeBPS": 500 } ``` ## Get Manager Treasury ### Description Returns the manager treasury address. ### Method VIEW ### Endpoint N/A (Smart Contract Function) ### Parameters None ### Response #### Success Response (200) - **managerTreasury** (address) - The manager treasury address. ### Response Example ```json { "managerTreasury": "0xabcdef1234567890abcdef1234567890abcdef12" } ``` ``` -------------------------------- ### Perform HTTP GET Request with 'ask' Parameter Source: https://documentation.kodiak.finance/developers/kodiak-islands/subgraph/advanced-usage-guide Use this method to query documentation dynamically when information is not directly available. The question should be specific and self-contained. ```http GET https://documentation.kodiak.finance/developers/kodiak-islands/subgraph/advanced-usage-guide.md?ask= ``` -------------------------------- ### Tick Information Source: https://documentation.kodiak.finance/developers/kodiak-islands/smart-contract-reference/kodiak-island APIs to get the upper and lower ticks of the island's position. ```APIDOC ## Get Upper Tick ### Description Returns the upper tick of the island's position. ### Method VIEW ### Endpoint N/A (Smart Contract Function) ### Parameters None ### Response #### Success Response (200) - **upperTick** (int24) - The upper tick of the island's position. ### Response Example ```json { "upperTick": 87040 } ``` ## Get Lower Tick ### Description Returns the lower tick of the island's position. ### Method VIEW ### Endpoint N/A (Smart Contract Function) ### Parameters None ### Response #### Success Response (200) - **lowerTick** (int24) - The lower tick of the island's position. ### Response Example ```json { "lowerTick": -87040 } ``` ``` -------------------------------- ### Get Position ID Source: https://documentation.kodiak.finance/developers/kodiak-islands/smart-contract-reference/kodiak-island Retrieves the unique identifier for the current Kodiak V3 position. ```APIDOC ## Get Position ID ### Description Returns the unique identifier for the current Kodiak V3 position. ### Method VIEW ### Endpoint N/A (Smart Contract Function) ### Parameters None ### Response #### Success Response (200) - **positionID** (bytes32) - Keccak256 hash of packed (island address, lowerTick, upperTick). ### Response Example ```json { "positionID": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef" } ``` ``` -------------------------------- ### Add Liquidity Single Token Deposit (JavaScript) Source: https://documentation.kodiak.finance/developers/kodiak-islands/smart-contract-reference/kodiak-island-router Example of executing a single token deposit. This involves preparing swap parameters, approving the router, and then calling the addLiquiditySingle function. Ensure minimum shares and slippage are correctly determined. ```javascript // 1. Prepare swap parameters. refer the section on finding the swap amounts const swapParams = { zeroForOne: true, // true if swapping token0 for token1 amountIn: swapAmount, minAmountOut: minimumSwapOutput, routeData: swapCalldata }; // 2. Set slippage parameters const maxStakingSlippageBPS = 100; // 1% slippage const minShares = minShares; // find the min shares by making a static call // and adding a 1% slippage to it as demonstrated in previous examples // 3. Approve island router to spend your inputToken await token0.approve(islandRouterAddress, totalAmount); // 3. Execute single token deposit const tx = await islandRouter.addLiquiditySingle( islandAddress, totalAmount, minShares, maxStakingSlippageBPS, swapParams, receiverAddress ); ``` -------------------------------- ### Get Total Supply Source: https://documentation.kodiak.finance/developers/kodiak-islands/smart-contract-reference/kodiak-island Returns the total number of island tokens currently in circulation. ```solidity function totalSupply() external view returns (uint256) ``` -------------------------------- ### Get Pool Address Source: https://documentation.kodiak.finance/developers/kodiak-islands/smart-contract-reference/kodiak-island Returns the contract address of the associated Uniswap V3 pool. ```solidity function pool() external view returns (IUniswapV3Pool) ``` -------------------------------- ### Perform HTTP GET Request to Query Documentation Source: https://documentation.kodiak.finance/overview/kodiak-contracts Use this method to query documentation dynamically. Include a specific, self-contained question in natural language as the 'ask' query parameter. The response will contain the answer and relevant excerpts. ```HTTP GET https://documentation.kodiak.finance/overview/kodiak-contracts.md?ask= ``` -------------------------------- ### Get Token1 Address Source: https://documentation.kodiak.finance/developers/kodiak-islands/smart-contract-reference/kodiak-island Returns the contract address for the second token (token1) in the pair. ```solidity function token1() external view returns (IERC20) ``` -------------------------------- ### Get Token0 Address Source: https://documentation.kodiak.finance/developers/kodiak-islands/smart-contract-reference/kodiak-island Returns the contract address for the first token (token0) in the pair. ```solidity function token0() external view returns (IERC20) ``` -------------------------------- ### Get Token Symbol Source: https://documentation.kodiak.finance/developers/panda/smart-contract-reference/panda-token Returns the symbol of the token. This is a view function and does not cost gas. ```solidity function symbol() public view returns (string memory) ``` -------------------------------- ### Calculate and Execute Buy Tokens Source: https://documentation.kodiak.finance/developers/panda/technical-integration-guide Use this to calculate the expected output for a buy order, apply slippage tolerance, and execute the trade. Always use getAmountOut functions to estimate outputs and include reasonable slippage tolerance. ```javascript // Calculate expected output const [amountOut, fee, sqrtP] = await pandaToken.getAmountOutBuy(amountIn); // Apply slippage tolerance const minOut = amountOut * (1 - slippageTolerance); // Execute trade const tx = await pandaToken.buyTokens(amountIn, minOut, recipient); ``` -------------------------------- ### Get Token Name Source: https://documentation.kodiak.finance/developers/panda/smart-contract-reference/panda-token Returns the name of the token. This is a view function and does not cost gas. ```solidity function name() public view returns (string memory) ```