Integration with Arrakis Finance (Liquidity Management)
Uniswap v3 with concentrated liquidity requires active position management. An LP who set liquidity in the range $1800-$2200 for ETH/USDC only earns fees while price stays in that range. When ETH moves to $2500 — the position converts entirely to USDC, no fees. Rebalancing manually on mainnet each move is expensive and unrealistic.
Arrakis Finance (formerly G-UNI) solves this: a vault contract holds Uniswap v3 position and rebalances automatically by strategy. LPs deposit tokens into Arrakis vault, receive ERC-20 representation of the position, and the vault manages ticks. Integrating Arrakis into your DeFi product is a way to offer passive LP without user operational costs.
Arrakis v2 Architecture
Arrakis v2 is built on three components:
ArrakisV2 vault — ERC-20 token representing a share in the position. Each vault is tied to a specific token pair. Vault can hold multiple Uniswap v3 positions simultaneously (multi-range), not just one.
Manager — an address (or contract) allowed to call rebalance. Can be multisig, Gelato automated executor, or custom strategy contract. Manager determines when and how to rebalance.
ArrakisV2Resolver — helper contract for calculations: how many tokens to deposit for desired shares, what range is optimal for current volatility.
Key Methods for Integration
mint(uint256 mintAmount, address receiver) — deposit liquidity. Before calling, approve both pair tokens to vault address. Amount of tokens for given mintAmount calculated via getMintAmounts in Resolver.
burn(uint256 burnAmount, address receiver) — withdraw liquidity. Vault burns shares, returns proportional share of both tokens.
rebalance(...) — available only to manager. Takes new ranges and liquidity weight distribution between them. Typical strategy: wide range (base position, 80% liquidity) + narrow range around current price (active position, 20%).
Common Mistake: Approving One Token
getMintAmounts(uint256 amount0Max, uint256 amount1Max) returns (amount0, amount1, mintAmount) — exactly how much of each token will be used. Integrators sometimes approve only one token or wrong amount, causing revert in mint. Must approve both tokens for amount0 and amount1 respectively, not amount0Max.
Second nuance: vault may contain "idle" tokens (not deployed in Uniswap position). getMintAmounts calculation accounts for this — proportions can be nonlinear.
Usage Scenarios in Your Product
Protocol with treasury liquidity. DAO or protocol deposits treasury tokens in Arrakis vault instead of direct Uniswap v3. Automatic rebalancing keeps liquidity in working range without manual management.
User LP via simplified interface. Your frontend shows one button "Add Liquidity" — under the hood it deposits to Arrakis vault. User doesn't pick ticks, doesn't think about rebalancing.
Protocol token pairs. If you have your own token, Arrakis vault for Token/USDC pair ensures stable liquidity even with volatility.
Integration via SDK
Arrakis provides TypeScript SDK for calculations and transaction formation. For direct integration, ABI vault and Resolver are sufficient. Example flow on viem:
// 1. Get required token amounts
const { amount0, amount1, mintAmount } = await resolver.read.getMintAmounts([
vaultAddress, amount0Max, amount1Max
])
// 2. Approve both tokens
await token0.write.approve([vaultAddress, amount0])
await token1.write.approve([vaultAddress, amount1])
// 3. Mint shares
await vault.write.mint([mintAmount, userAddress])
Development Process
Vault analysis (1 day). Study specific Arrakis vault: manager strategy, rebalancing history, current ranges, APR from fees.
Contract integration (1-2 days). If on-chain integration needed (e.g., your contract deposits to Arrakis) — write adapter.
Frontend and UX (1-2 days). Deposit/withdrawal form, display current position, accumulated fees.
Timeline Estimates
Basic integration of existing Arrakis vault into frontend — 2-4 days. Developing custom vault with own rebalancing strategy — 1-2 weeks.







