Skip to main content

IMidnightSupplyVaultSharesCallback

Git Source - Generated with forge doc

Inherits: ISellCallback

Title: IMidnightSupplyVaultSharesCallback

Interface of the callback that deposits loan tokens into a vault and supplies the shares as collateral.

Deposits sellerAssets + amountFromSeller of loan tokens into the vault and supplies the shares as collateral, where amountFromSeller = ceil(sellerAssets * additionalDepositPercent / WAD).

Events

VaultSharesSupplied

event VaultSharesSupplied(
address indexed borrower,
bytes32 indexed marketId,
address indexed vault,
uint256 sellerAssets,
uint256 assetsDeposited,
uint256 sharesSupplied
);

Structs

CallbackData

Data encoded in the offer's callbackData.

struct CallbackData {
address vault;
uint256 collateralIndex;
uint256 additionalDepositPercent;
}

Properties

NameTypeDescription
vaultaddressThe ERC-4626 vault to deposit into; must be listed in market.collateralParams.
collateralIndexuint256The index of the vault in the market's collateralParams array.
additionalDepositPercentuint256The extra share of sellerAssets the seller must provide, in WAD (e.g. 0.1e18 = 10% extra). Must be at least WAD^3 / (price * LLTV) - WAD, where price = tickToPrice(offer.tick), to keep the position healthy (assuming the vault-share oracle prices shares at their loan-token redemption value); the callback does not enforce this minimum.