Skip to content

Commit 4193b04

Browse files
committed
GUniPool to ArrakisVaultV1
1 parent 831a0b1 commit 4193b04

File tree

7 files changed

+1169
-1177
lines changed

7 files changed

+1169
-1177
lines changed

contracts/interfaces/external/IGUniPool.sol renamed to contracts/interfaces/external/IArrakisVaultV1.sol

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import {
2222
IUniswapV3Pool
2323
} from "@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol";
2424

25-
interface IGUniPool {
25+
interface IArrakisVaultV1 {
2626
function mint(uint256 mintAmount, address receiver)
2727
external
2828
returns (
@@ -52,6 +52,11 @@ interface IGUniPool {
5252
external
5353
view
5454
returns (uint256 amount0, uint256 amount1);
55+
56+
function getUnderlyingBalancesAtPrice(uint160 sqrtRatioX96)
57+
external
58+
view
59+
returns (uint256 amount0Current, uint256 amount1Current);
5560

5661
function getPositionID() external view returns (bytes32 positionID);
5762

@@ -68,4 +73,14 @@ interface IGUniPool {
6873
function totalSupply() external view returns (uint256);
6974

7075
function balanceOf(address account) external view returns (uint256);
76+
77+
function executiveRebalance(
78+
int24 newLowerTick,
79+
int24 newUpperTick,
80+
uint160 swapThresholdPrice,
81+
uint256 swapAmountBPS,
82+
bool zeroForOne
83+
) external;
84+
85+
function withdrawManagerBalance() external;
7186
}

contracts/protocol/integration/amm/ArrakisUniswapV3AmmAdapter.sol

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
pragma solidity 0.6.10;
2020

2121
import "../../../interfaces/IAmmAdapter.sol";
22-
import "../../../interfaces/external/IGUniPool.sol";
22+
import "../../../interfaces/external/IArrakisVaultV1.sol";
2323
import "@openzeppelin/contracts/math/SafeMath.sol";
2424
import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
2525
import "@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol";
@@ -90,7 +90,7 @@ contract ArrakisUniswapV3AmmAdapter is IAmmAdapter {
9090

9191
require(maxTokensIn[0] > 0 && maxTokensIn[1] > 0, "Component quantity must be nonzero");
9292

93-
IGUniPool arrakisVaultPool = IGUniPool(_pool);
93+
IArrakisVaultV1 arrakisVaultPool = IArrakisVaultV1(_pool);
9494

9595
(uint256 amountAMin, uint256 amountBMin, uint256 liquidityExpectedFromSuppliedTokens) = arrakisVaultPool.getMintAmounts(maxTokensIn[0], maxTokensIn[1]);
9696

@@ -153,7 +153,7 @@ contract ArrakisUniswapV3AmmAdapter is IAmmAdapter {
153153
address setToken = _setToken;
154154
uint256[] memory minTokensOut = _minTokensOut;
155155
uint256 liquidity = _liquidity;
156-
IGUniPool arrakisVaultPool = IGUniPool(_pool);
156+
IArrakisVaultV1 arrakisVaultPool = IArrakisVaultV1(_pool);
157157

158158
// Make sure that only up to the amount of liquidity tokens owned by the Set Token are redeemed
159159
uint256 setTokenLiquidityBalance = arrakisVaultPool.balanceOf(setToken);
@@ -218,12 +218,12 @@ contract ArrakisUniswapV3AmmAdapter is IAmmAdapter {
218218
// Attempt to get the tokens of the provided pool
219219
address token0;
220220
address token1;
221-
try IGUniPool(_pool).token0() returns (IERC20 _token0) {
221+
try IArrakisVaultV1(_pool).token0() returns (IERC20 _token0) {
222222
token0 = address(_token0);
223223
} catch {
224224
return false;
225225
}
226-
try IGUniPool(_pool).token1() returns (IERC20 _token1) {
226+
try IArrakisVaultV1(_pool).token1() returns (IERC20 _token1) {
227227
token1 = address(_token1);
228228
} catch {
229229
return false;
@@ -241,7 +241,7 @@ contract ArrakisUniswapV3AmmAdapter is IAmmAdapter {
241241

242242
// Attempt to get the UniswapV3 pool in the provided Arrakis pool
243243
IUniswapV3Pool uniV3PairPool;
244-
try IGUniPool(_pool).pool() returns (IUniswapV3Pool _uniV3PairPool) {
244+
try IArrakisVaultV1(_pool).pool() returns (IUniswapV3Pool _uniV3PairPool) {
245245
uniV3PairPool = _uniV3PairPool;
246246
} catch {
247247
return false;

0 commit comments

Comments
 (0)