Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CurveAmmAdapter #259

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions contracts/interfaces/external/curve/ICurveMinter.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// SPDX-License-Identifier: Apache License, Version 2.0
pragma solidity 0.6.10;

interface ICurveMinter {
function coins(uint256) external view returns (address);

function balances(uint256) external view returns (uint256);

function add_liquidity(uint256[2] calldata amounts, uint256 min_mint_amount)
external;

function add_liquidity(uint256[3] calldata amounts, uint256 min_mint_amount)
external;

function add_liquidity(uint256[4] calldata amounts, uint256 min_mint_amount)
external;

function remove_liquidity(uint256 amount, uint256[2] calldata min_amounts)
external;

function remove_liquidity(uint256 amount, uint256[3] calldata min_amounts)
external;

function remove_liquidity(uint256 amount, uint256[4] calldata min_amounts)
external;

function calc_token_amount(uint256[2] calldata amounts, bool is_deposit)
external view returns(uint256);

function calc_token_amount(uint256[3] calldata amounts, bool is_deposit)
external view returns(uint256);

function calc_token_amount(uint256[4] calldata amounts, bool is_deposit)
external view returns(uint256);

function calc_token_amount(uint256[2] calldata amounts, bool is_deposit, bool previous)
external view returns(uint256);

function calc_token_amount(uint256[3] calldata amounts, bool is_deposit, bool previous)
external view returns(uint256);

function calc_token_amount(uint256[4] calldata amounts, bool is_deposit, bool previous)
external view returns(uint256);
}
24 changes: 24 additions & 0 deletions contracts/interfaces/external/curve/ICurveV1.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// SPDX-License-Identifier: Apache License, Version 2.0
pragma solidity 0.6.10;

import "./ICurveMinter.sol";

interface ICurveV1 is ICurveMinter {
function remove_liquidity_one_coin(
uint256 burn_amount,
int128 i,
uint256 mim_received
) external;

function calc_withdraw_one_coin(uint256, int128)
external
view
returns (uint256);

function exchange(
int128 i,
int128 j,
uint256 dx,
uint256 min_dy
) external returns (uint256);
}
24 changes: 24 additions & 0 deletions contracts/interfaces/external/curve/ICurveV2.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// SPDX-License-Identifier: Apache License, Version 2.0
pragma solidity 0.6.10;

import "./ICurveMinter.sol";

interface ICurveV2 is ICurveMinter {
function remove_liquidity_one_coin(
uint256 burn_amount,
uint256 i,
uint256 mim_received
) external;

function calc_withdraw_one_coin(uint256, uint256)
external
view
returns (uint256);

function exchange(
uint256 i,
uint256 j,
uint256 dx,
uint256 min_dy
) external returns (uint256);
}
Loading