MORPHO-COMPOUND-V2-A - Mainnet
Deposit ETH/ERC20_Token. Morpho-Compound-v1.0 connector on mainnet triggers methods like deposit, depositWithMaxGas, depositOnBehalf, borrow, borrowWithMaxGas, withdraw, payback, paybackOnBehalf. You can view details like source code, ABIs on Etherscan.
- Use
0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
to indicate ETH. - use -1 or
dsa.maxValue
for the maximum amount in function. - If not sure about the arguments
getId
andsetId
, pass 0.
Deposit
Deposit a token to Morpho Compound for lending / collaterization.
spells.add({ connector: "MORPHO-COMPOUND-V2-A", method: "deposit", args: [_tokenAddress, _poolTokenAddress, _amount, _getId, _setId]});
Parameter | Type | Description |
---|---|---|
_tokenAddress | address | The address of underlying token to deposit.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) |
_poolTokenAddress | address | The address of cToken to deposit.(For ETH: cETH address) |
_amount | uint256 | The amount of the token (in underlying) to deposit. (For max: `uint256(-1)`) |
_getId | uint256 | ID to retrieve amt. |
_setId | uint256 | ID stores the amount of tokens deposited. |
DepositWithMaxGas
Deposit a token to Morpho Compound for lending / collaterization with max gas.
spells.add({ connector: "MORPHO-COMPOUND-V2-A", method: "depositWithMaxGas", args: [_tokenAddress, _poolTokenAddress, _amount, _maxGasForMatching, _getId, _setId]});
Parameter | Type | Description |
---|---|---|
_tokenAddress | address | The address of underlying token to deposit.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) |
_poolTokenAddress | address | The address of cToken to deposit.(For ETH: cETH address). |
_amount | uint256 | The amount of the token (in underlying) to deposit. (For max: `uint256(-1)`). |
_maxGasForMatching | uint256 | The maximum amount of gas to consume within a matching engine loop. |
_getId | uint256 | ID to retrieve amt. |
_setId | uint256 | ID stores the amount of tokens deposited. |
DepositOnBehalf
Deposit a token to Morpho Compound for lending / collaterization on behalf of a user.
spells.add({ connector: "MORPHO-COMPOUND-V2-A", method: "depositOnBehalf", args: [_tokenAddress, _poolTokenAddress, _onBehalf, _amount, _getId, _setId]});
Parameter | Type | Description |
---|---|---|
_tokenAddress | address | The address of underlying token to deposit.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) |
_poolTokenAddress | address | The address of cToken to deposit.(For ETH: cETH address) |
_onBehalf | address | The address of user on behalf to deposit. |
_amount | uint256 | The amount of the token (in underlying) to deposit. (For max: `uint256(-1)`) |
_getId | uint256 | ID to retrieve amt. |
_setId | uint256 | ID stores the amount of tokens deposited. |
Borrow
Borrow a token from Morpho Compound.
spells.add({ connector: "MORPHO-COMPOUND-V2-A", method: "borrow", args: [_tokenAddress, _poolTokenAddress, _amount, _getId, _setId]});
Parameter | Type | Description |
---|---|---|
_tokenAddress | address | The address of underlying token to borrow.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) |
_poolTokenAddress | address | The address of cToken to borrow.(For ETH: cETH address) |
_amount | uint256 | The amount of the token (in underlying) to borrow. |
_getId | uint256 | ID to retrieve amt. |
_setId | uint256 | ID stores the amount of tokens borrowed. |
BorrowWithMaxGas
Borrow a token from Morpho Compound with max gas.
spells.add({ connector: "MORPHO-COMPOUND-V2-A", method: "borrowWithMaxGas", args: [_tokenAddress, _poolTokenAddress, _amount, _maxGasForMatching, _getId, _setId]});
Parameter | Type | Description |
---|---|---|
_tokenAddress | address | The address of underlying token to borrow.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) |
_poolTokenAddress | address | The address of cToken to borrow.(For ETH: cETH address) |
_amount | uint256 | The amount of the token (in underlying) to borrow. |
_maxGasForMatching | uint256 | The maximum amount of gas to consume within a matching engine loop. |
_getId | uint256 | ID to retrieve amt. |
_setId | uint256 | ID stores the amount of tokens borrowed. |
Withdraw
Withdraw a token from Morpho Compound.
spells.add({ connector: "MORPHO-COMPOUND-V2-A", method: "withdraw", args: [_tokenAddress, _poolTokenAddress, _amount, _getId, _setId]});
Parameter | Type | Description |
---|---|---|
_tokenAddress | address | The address of underlying token to withdraw.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) |
_poolTokenAddress | address | The address of cToken to withdraw.(For ETH: cETH address) |
_amount | uint256 | The amount of the token (in underlying) to withdraw. (For max: `uint256(-1)`) |
_getId | uint256 | ID to retrieve amt. |
_setId | uint256 | ID stores the amount of tokens withdrawed. |
Payback
Payback a token to Morpho Compound.
spells.add({ connector: "MORPHO-COMPOUND-V2-A", method: "payback", args: [_tokenAddress, _poolTokenAddress, _amount, _getId, _setId]});
Parameter | Type | Description |
---|---|---|
_tokenAddress | address | The address of underlying token to payback.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) |
_poolTokenAddress | address | The address of cToken to payback.(For ETH: cETH address) |
_amount | uint256 | The amount of the token (in underlying) to payback. (For max: `uint256(-1)`) |
_getId | uint256 | ID to retrieve amt. |
_setId | uint256 | ID stores the amount of tokens paid back. |
PaybackOnBehalf
Payback a token to Morpho Compound on behalf of a user.
spells.add({ connector: "MORPHO-COMPOUND-V2-A", method: "paybackOnBehalf", args: [_tokenAddress, _poolTokenAddress, _onBehalf, _amount, _getId, _setId]});
Parameter | Type | Description |
---|---|---|
_tokenAddress | address | The address of underlying token to payback.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) |
_poolTokenAddress | address | The address of cToken to payback.(For ETH: cETH address) |
_onBehalf | address | The address of user who's debt to repay. |
_amount | uint256 | The amount of the token (in underlying) to payback. (For max: `uint256(-1)`) |
_getId | uint256 | ID to retrieve amt. |
_setId | uint256 | ID stores the amount of tokens paid back. |
If you still can't find something you're looking for or have any questions, ask them at our developers community on Discord or simply send an Email.
Our team is excited about assisting you to build an application using Instadapp Developer Platform. Your questions and feedback help us make a better development environment for future developers.