Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mUSD rebalance using DyDx flash loan
- Loading branch information
1 parent
dfb1e82
commit d53bf9f
Showing
9 changed files
with
1,159 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
// SPDX-License-Identifier: AGPL-3.0-or-later | ||
pragma solidity 0.8.0; | ||
|
||
interface ICurve { | ||
function get_virtual_price() external returns (uint256 out); | ||
|
||
function add_liquidity(uint256[2] calldata amounts, uint256 deadline) external; | ||
|
||
function get_dy(int128 i, int128 j, uint256 dx) | ||
external | ||
returns (uint256 out); | ||
|
||
function get_dy_underlying(int128 i, int128 j, uint256 dx) | ||
external | ||
returns (uint256 out); | ||
|
||
function exchange( | ||
int128 i, | ||
int128 j, | ||
uint256 dx, | ||
uint256 min_dy | ||
) external; | ||
|
||
function exchange( | ||
int128 i, | ||
int128 j, | ||
uint256 dx, | ||
uint256 min_dy, | ||
uint256 deadline | ||
) external; | ||
|
||
function exchange_underlying( | ||
int128 i, | ||
int128 j, | ||
uint256 dx, | ||
uint256 min_dy | ||
) external; | ||
|
||
function exchange_underlying( | ||
int128 i, | ||
int128 j, | ||
uint256 dx, | ||
uint256 min_dy, | ||
uint256 deadline | ||
) external; | ||
|
||
function remove_liquidity( | ||
uint256 _amount, | ||
uint256 deadline, | ||
uint256[2] calldata min_amounts | ||
) external; | ||
|
||
function remove_liquidity_imbalance(uint256[2] calldata amounts, uint256 deadline) | ||
external; | ||
|
||
function commit_new_parameters( | ||
int128 amplification, | ||
int128 new_fee, | ||
int128 new_admin_fee | ||
) external; | ||
|
||
function apply_new_parameters() external; | ||
|
||
function revert_new_parameters() external; | ||
|
||
function commit_transfer_ownership(address _owner) external; | ||
|
||
function apply_transfer_ownership() external; | ||
|
||
function revert_transfer_ownership() external; | ||
|
||
function withdraw_admin_fees() external; | ||
|
||
function coins(int128 arg0) external returns (address out); | ||
|
||
function underlying_coins(int128 arg0) external returns (address out); | ||
|
||
function balances(int128 arg0) external returns (uint256 out); | ||
|
||
function A() external returns (int128 out); | ||
|
||
function fee() external returns (int128 out); | ||
|
||
function admin_fee() external returns (int128 out); | ||
|
||
function owner() external returns (address out); | ||
|
||
function admin_actions_deadline() external returns (uint256 out); | ||
|
||
function transfer_ownership_deadline() external returns (uint256 out); | ||
|
||
function future_A() external returns (int128 out); | ||
|
||
function future_fee() external returns (int128 out); | ||
|
||
function future_admin_fee() external returns (int128 out); | ||
|
||
function future_owner() external returns (address out); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// SPDX-License-Identifier: AGPL-3.0-or-later | ||
pragma solidity 0.8.0; | ||
|
||
/** | ||
* @title mUSD interface before upgrade to V3 | ||
*/ | ||
interface IMassetV2 { | ||
|
||
/** @dev Calc interest */ | ||
function collectInterest() external returns (uint256 swapFeesGained, uint256 newTotalSupply); | ||
function collectPlatformInterest() external returns (uint256 interestGained, uint256 newTotalSupply); | ||
|
||
/** @dev Minting */ | ||
function mint(address _basset, uint256 _bassetQuantity) | ||
external returns (uint256 massetMinted); | ||
function mintTo(address _basset, uint256 _bassetQuantity, address _recipient) | ||
external returns (uint256 massetMinted); | ||
function mintMulti(address[] calldata _bAssets, uint256[] calldata _bassetQuantity, address _recipient) | ||
external returns (uint256 massetMinted); | ||
|
||
/** @dev Swapping */ | ||
function swap( address _input, address _output, uint256 _quantity, address _recipient) | ||
external returns (uint256 output); | ||
function getSwapOutput( address _input, address _output, uint256 _quantity) | ||
external view returns (bool, string memory, uint256 output); | ||
|
||
/** @dev Redeeming */ | ||
function redeem(address _basset, uint256 _bassetQuantity) | ||
external returns (uint256 massetRedeemed); | ||
function redeemTo(address _basset, uint256 _bassetQuantity, address _recipient) | ||
external returns (uint256 massetRedeemed); | ||
function redeemMulti(address[] calldata _bAssets, uint256[] calldata _bassetQuantities, address _recipient) | ||
external returns (uint256 massetRedeemed); | ||
function redeemMasset(uint256 _mAssetQuantity, address _recipient) external; | ||
|
||
/** @dev Setters for the Manager or Gov to update module info */ | ||
function upgradeForgeValidator(address _newForgeValidator) external; | ||
|
||
/** @dev Setters for Gov to set system params */ | ||
function setSwapFee(uint256 _swapFee) external; | ||
|
||
/** @dev Getters */ | ||
function getBasketManager() external view returns(address); | ||
function forgeValidator() external view returns (address); | ||
function totalSupply() external view returns (uint256); | ||
function swapFee() external view returns (uint256); | ||
} |
Oops, something went wrong.