From e93f4c6daeccdaee6d2422cad2cd547672b26121 Mon Sep 17 00:00:00 2001 From: clemlak Date: Fri, 12 Apr 2024 03:10:47 +0300 Subject: [PATCH] feat: add wip ISolver --- src/interfaces/ISolver.sol | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 src/interfaces/ISolver.sol diff --git a/src/interfaces/ISolver.sol b/src/interfaces/ISolver.sol new file mode 100644 index 00000000..594d4e77 --- /dev/null +++ b/src/interfaces/ISolver.sol @@ -0,0 +1,35 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +pragma solidity ^0.8.13; + +interface ISolver { + function prepareInit( + uint256[] memory reserves, + bytes calldata poolParams + ) external view returns (bytes memory); + + function prepareAllocation( + uint256 poolId, + uint256 tokenIndex, + uint256 amount + ) external view returns (bytes memory); + + function prepareDeallocation( + uint256 poolId, + uint256 tokenIndex, + uint256 amount + ) external view returns (bytes memory); + + function prepareSwap( + uint256 poolId, + uint256 tokenInIndex, + uint256 tokenOutIndex, + uint256 amountIn + ) external view returns (bool, uint256, bytes memory); + + function getPrice(uint256 poolId) external view returns (uint256); + + function getReservesAndLiquidity(uint256 poolId) + external + view + returns (uint256[] memory reserves, uint256 totalLiquidity); +}