B.Protocol Compound - Mainnet

Lending & Borrowing. B.Compound-v1.0 connector on mainnet triggers methods like depositRaw, deposit, withdrawRaw, withdraw, borrowRaw, borrow, paybackRaw, payback, depositCTokenRaw, depositCToken, withdrawCTokenRaw, withdrawCToken. 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 and setId, pass 0.

DepositRaw

Deposit a token to Compound for lending / collaterization.

spells.add({  connector: "B-COMPOUND-A",  method: "depositRaw",  args: [token, cToken, amt, getId, setId]});
Parameter Type Description
token address The address of the token to deposit. (For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE)
cToken address The address of the corresponding cToken.
amt uint256 The amount of the token to deposit. (For max: `uint256(-1)`)
getId uint256 ID to retrieve amt.
setId uint256 ID stores the amount of tokens deposited.

Deposit

Deposit a token to Compound for lending / collaterization.

spells.add({  connector: "B-COMPOUND-A",  method: "deposit",  args: [tokenId, amt, getId, setId]});
Parameter Type Description
tokenId string The token id of the token to deposit.(For eg: ETH-A)
amt uint256 The amount of the token to deposit. (For max: `uint256(-1)`)
getId uint256 ID to retrieve amt.
setId uint256 ID stores the amount of tokens deposited.

WithdrawRaw

Withdraw deposited token from Compound

spells.add({  connector: "B-COMPOUND-A",  method: "withdrawRaw",  args: [token, cToken, amt, getId, setId]});
Parameter Type Description
token address The address of the token to withdraw. (For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE)
cToken address The address of the corresponding cToken.
amt uint256 The amount of the token to withdraw. (For max: `uint256(-1)`)
getId uint256 ID to retrieve amt.
setId uint256 ID stores the amount of tokens withdrawn.

Withdraw

Withdraw deposited token from Compound

spells.add({  connector: "B-COMPOUND-A",  method: "withdraw",  args: [tokenId, amt, getId, setId]});
Parameter Type Description
tokenId string The token id of the token to withdraw.(For eg: ETH-A)
amt uint256 The amount of the token to withdraw. (For max: `uint256(-1)`)
getId uint256 ID to retrieve amt.
setId uint256 ID stores the amount of tokens withdrawn.

BorrowRaw

Borrow a token using Compound

spells.add({  connector: "B-COMPOUND-A",  method: "borrowRaw",  args: [token, cToken, amt, getId, setId]});
Parameter Type Description
token address The address of the token to borrow. (For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE)
cToken address The address of the corresponding cToken.
amt uint256 The amount of the token to borrow.
getId uint256 ID to retrieve amt.
setId uint256 ID stores the amount of tokens borrowed.

Borrow

Borrow a token using Compound

spells.add({  connector: "B-COMPOUND-A",  method: "borrow",  args: [tokenId, amt, getId, setId]});
Parameter Type Description
tokenId string The token id of the token to borrow.(For eg: DAI-A)
amt uint256 The amount of the token to borrow.
getId uint256 ID to retrieve amt.
setId uint256 ID stores the amount of tokens borrowed.

PaybackRaw

Payback debt owed.

spells.add({  connector: "B-COMPOUND-A",  method: "paybackRaw",  args: [token, cToken, amt, getId, setId]});
Parameter Type Description
token address The address of the token to payback. (For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE)
cToken address The address of the corresponding cToken.
amt uint256 The amount of the token to payback. (For max: `uint256(-1)`)
getId uint256 ID to retrieve amt.
setId uint256 ID stores the amount of tokens paid back.

Payback

Payback debt owed.

spells.add({  connector: "B-COMPOUND-A",  method: "payback",  args: [tokenId, amt, getId, setId]});
Parameter Type Description
tokenId string The token id of the token to payback.(For eg: COMP-A)
amt uint256 The amount of the token to payback. (For max: `uint256(-1)`)
getId uint256 ID to retrieve amt.
setId uint256 ID stores the amount of tokens paid back.

DepositCTokenRaw

Same as depositRaw. The only difference is this method stores cToken amount in set ID.

spells.add({  connector: "B-COMPOUND-A",  method: "depositCTokenRaw",  args: [token, cToken, amt, getId, setId]});
Parameter Type Description
token address The address of the token to deposit. (For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE)
cToken address The address of the corresponding cToken.
amt uint256 The amount of the token to deposit. (For max: `uint256(-1)`)
getId uint256 ID to retrieve amt.
setId uint256 ID stores the amount of cTokens received.

DepositCToken

Same as deposit. The only difference is this method stores cToken amount in set ID.

spells.add({  connector: "B-COMPOUND-A",  method: "depositCToken",  args: [tokenId, amt, getId, setId]});
Parameter Type Description
tokenId string The token id of the token to depositCToken.(For eg: DAI-A)
amt uint256 The amount of the token to deposit. (For max: `uint256(-1)`)
getId uint256 ID to retrieve amt.
setId uint256 ID stores the amount of cTokens received.

WithdrawCTokenRaw

Same as withdrawRaw. The only difference is this method fetch cToken amount in get ID.

spells.add({  connector: "B-COMPOUND-A",  method: "withdrawCTokenRaw",  args: [token, cToken, cTokenAmt, getId, setId]});
Parameter Type Description
token address The address of the token to withdraw. (For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE)
cToken address The address of the corresponding cToken.
cTokenAmt uint The amount of cTokens to withdraw
getId uint ID to retrieve cTokenAmt
setId uint ID stores the amount of tokens withdrawn.

WithdrawCToken

Same as withdraw. The only difference is this method fetch cToken amount in get ID.

spells.add({  connector: "B-COMPOUND-A",  method: "withdrawCToken",  args: [tokenId, cTokenAmt, getId, setId]});
Parameter Type Description
tokenId string The token id of the token to withdraw CToken.(For eg: ETH-A)
cTokenAmt uint The amount of cTokens to withdraw
getId uint ID to retrieve cTokenAmt
setId uint ID stores the amount of tokens withdrawn.

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.