Technical Integration Guide
Smart contract integration guide and examples
Overview
Kodiak Islands are concentrated liquidity management vaults built on top of Kodiak V3 pools. This guide covers the technical aspects of integrating with Kodiak Islands from a smart contract perspective.
1. Usage with existing/Deployed Islands
What can be achieved
Depositing into existing Islands
Withdrawing from existing Islands
Checking current island position
Checking current fee earned
Calling rebalance to invest any pending fees
Prerequisites
Before integrating with Kodiak Islands, you should understand:
Kodiak V3 concentrated liquidity concepts
ERC20 token standards and approvals
Basic understanding of what's slippage and slippage protection mechanisms
Deployed contract addresses
Understanding of token ratio that is needed to deposit tokens into the island.
Finding the correct deposit params for double sided token deposits.
Finding the correct deposit and swap params for single sided token deposits.
Refer the section on Understanding Token Deposit Ratio for in dept guide.
Core Contracts
The main contracts involved for integration with existing islands are:
Island Router Contract: Handles complex operations like zaps and slippage protection
Island Contract: The actual vault contract managing the Kodiak V3 position
Integration Examples
1. Basic Position Information
2. Depositing with Both Tokens
3. Single Token Deposits (Zaps)
For single token deposits, the swap calldata needs to be prepared off-chain using the Kodiak Quoter API. The process involves:
Getting the optimal swap amount using the formula:
Using the Kodiak Quoter API to get the swap calldata (refer to the Kodiak API Documentation)
Implementing the deposit:
4. Withdrawing Liquidity
5. Rebalancing and Fee Collection
2. Deploying new Islands
What can be achieved
Deploying new managed Islands
Deploying new Permissionless Islands
Enabling mint for everyone for deployed Islands
Managing deployed Island parameters and position
Collecting Fees
Giving up ownership of deployed Islands
Prerequisites
Before deploying new Islands, you should understand:
Kodiak V3 concentrated liquidity concepts
Openzeppelin Minimal Proxy Contracts
Island management parameters and fee structures
Core Contracts
The main contracts involved in deployment are:
Island Factory Contract: Creates new Island instances
Island Implementation Contract: The base contract that gets cloned
Deployment Examples
1. Deploying a Managed Island
2. Deploying a Permissionless Island
Important Notes
Tick Spacing: Ensure ticks align with pool's tick spacing otherwise an error will be thrown
Token Ordering: Factory handles token ordering internally
Fee Limits: Manager fees cannot exceed 10000 BPS (100%)
Permissionless vs Managed: Understand the differences in parameters to deploy managed vs permissionless islands
Enabling Minting: You need to enable minting for everyone for managed islands
Rebalance: You need to call rebalance on the island for compounding earned fee back into the position.
Permissionless Islands Frontend listing: You need to contact the Kodiak team to get your permissionless island listed on the kodiak frontend.
Security Considerations
Always use the router for deposits/withdrawals to ensure proper slippage protection
Validate all parameters before deployment
Test with small amounts first
Be cautious with manager permissions, use islands only from trusted managers.
Implement proper access control in integrating contracts
Monitor gas costs, especially for operations involving swaps
Last updated