From bcf0403fc2a0cc1254bd65bae776513c603f008a Mon Sep 17 00:00:00 2001 From: Ewan Sheldon Date: Thu, 28 Nov 2024 12:44:31 +0100 Subject: [PATCH] quick gamma yield deposit + withdrawal for redemptions --- contracts/SmartVaultYieldManager.sol | 10 ++++++++++ contracts/interfaces/ISmartVaultYieldManager.sol | 4 +++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/contracts/SmartVaultYieldManager.sol b/contracts/SmartVaultYieldManager.sol index 8ab4ca3..5d17696 100644 --- a/contracts/SmartVaultYieldManager.sol +++ b/contracts/SmartVaultYieldManager.sol @@ -318,6 +318,16 @@ contract SmartVaultYieldManager is ISmartVaultYieldManager, Ownable { emit Withdraw(msg.sender, _token, _hypervisor, _withdrawn); } + function quickDeposit(address _hypervisor, address _collateralToken, uint256 _deposit) external { + IERC20(_collateralToken).safeTransferFrom(msg.sender, address(this), _deposit); + HypervisorData memory _hypervisorData = hypervisorData[_collateralToken]; + _otherDeposit(_collateralToken, _hypervisorData); + } + + function quickWithdraw(address _hypervisor, address _token) external returns (uint256 _withdrawn) { + + } + function addHypervisorData( address _collateralToken, address _hypervisor, diff --git a/contracts/interfaces/ISmartVaultYieldManager.sol b/contracts/interfaces/ISmartVaultYieldManager.sol index e37e244..aace5e9 100644 --- a/contracts/interfaces/ISmartVaultYieldManager.sol +++ b/contracts/interfaces/ISmartVaultYieldManager.sol @@ -5,5 +5,7 @@ interface ISmartVaultYieldManager { function deposit(address _collateralToken, uint256 _usdPercentage) external returns (address vault0, address vault1); - function withdraw(address _vault, address _token) external; + function withdraw(address _hypervisor, address _token) external; + function quickDeposit(address _hypervisor, address _token, uint256 _deposit) external; + function quickWithdraw(address _hypervisor, address _token) external returns (uint256 _withdrawn); }