FluidVaultT3Operate ​
Inherits:Internals
Functions ​
operate ​
Performs operations on a vault position
This function allows users to modify their vault position by adjusting collateral and debt
solidity
function operate(
uint256 nftId_,
int256 newCol_,
int256 newDebtToken0_,
int256 newDebtToken1_,
int256 debtSharesMinMax_,
address to_
) external payable _delegateCallCheck returns (uint256, int256, int256);
Parameters
Name | Type | Description |
---|---|---|
nftId_ | uint256 | The ID of the NFT representing the vault position |
newCol_ | int256 | The change in collateral amount (positive for deposit, negative for withdrawal) |
newDebtToken0_ | int256 | The change in debt amount for token0 (positive for borrowing, negative for repayment) |
newDebtToken1_ | int256 | The change in debt amount for token1 (positive for borrowing, negative for repayment) |
debtSharesMinMax_ | int256 | Min or max debt shares to mint or burn (positive for borrowing, negative for repayment) |
to_ | address | The address to receive withdrawn collateral or borrowed tokens (if address(0), defaults to msg.sender) |
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | nftId_ The ID of the NFT representing the updated vault position |
<none> | int256 | supplyAmt_ Final supply amount (negative if withdrawal occurred) |
<none> | int256 | borrowAmt_ Final borrow amount (negative if repayment occurred) |
operatePerfect ​
Performs operations on a vault position with perfect collateral shares
This function allows users to modify their vault position by adjusting collateral and debt
solidity
function operatePerfect(
uint256 nftId_,
int256 newCol_,
int256 perfectDebtShares_,
int256 debtToken0MinMax_,
int256 debtToken1MinMax_,
address to_
) external payable _delegateCallCheck returns (uint256, int256[] memory r_);
Parameters
Name | Type | Description |
---|---|---|
nftId_ | uint256 | The ID of the NFT representing the vault position |
newCol_ | int256 | The change in collateral amount (positive for deposit, negative for withdrawal) |
perfectDebtShares_ | int256 | The change in debt shares (positive for borrowing, negative for repayment) |
debtToken0MinMax_ | int256 | Min or max debt amount for token0 to payback or borrow (positive for borrowing, negative for repayment) |
debtToken1MinMax_ | int256 | Min or max debt amount for token1 to payback or borrow (positive for borrowing, negative for repayment) |
to_ | address | The address to receive withdrawn collateral or borrowed tokens (if address(0), defaults to msg.sender) |
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | nftId_ The ID of the NFT representing the updated vault position |
r_ | int256[] | int256 array of return values: 0 - col amount, will only change if user sends type(int).min 1 - final debt shares amount (can only change on max payback) 2 - token0 borrow or payback amount 3 - token1 borrow or payback amount |
constructor ​
solidity
constructor(ConstantViews memory constants_) Internals(constants_);
Structs ​
SmartOperate ​
solidity
struct SmartOperate {
uint256 initialEth;
int256 debtShares;
uint256 vaultVariables;
}
SmartOperatePerfect ​
solidity
struct SmartOperatePerfect {
uint256 initialEth;
int256 newDebtToken0;
int256 newDebtToken1;
uint256 vaultVariables;
}