Compound
Information on Compound protocol and Defire's operations that interact with it.

Overview

Compound is an algorithmic, autonomous interest rate protocol developed by Compound Labs, Inc. that allows users and applications to frictionlessly earn interest or borrow Ethereum assets. Visit this site for more information on Compound protocol.

Operations

Lending DAI

In Assets: DAI Out Assets: CDAI
A lender supplies DAI to the protocol and receives CDAI tokens in exchange (IOU tokens). Based on demand and supply of DAI in the market, functions of the compound protocol will calculate the interest accrued for all those issued CDAI tokens.
JavaScript & Node
1
const operation = new defire.Operations.Compound.Lend.DAI({
2
amountDAI: "5000000000000000000" //5 DAI
3
});
Copied!
Constructor object fields
amountDAIrequired string | number | JSBI
Amount of DAI to lend in wei format
Returns
Creates a new operation object

Redeem DAI

In Assets: CDAI Out Assets: DAI
A lender returns CDAI to the protocol and receives in exchange DAI that includes the interest accrued.
JavaScript & Node
1
const operation = new defire.Operations.Compound.Redeem.DAI({
2
amountCDAI: "5000000000000000000" //5 CDAI
3
});
Copied!
Constructor object fields
amountCDAI required string | number | JSBI
Total number of CDAI to return in wei format
Returns
Creates a new operation object

Lending ETH

In Assets: ETH Out Assets: CETH
A lender supplies ETH to the protocol and receives CETH tokens in exchange (IOU tokens). Based on demand and supply of ETH in the market, functions of the compound protocol will calculate the interest accrued for all those issued CETH tokens.
JavaScript & Node
1
const operation = new defire.Operations.Compound.Lend.ETH({
2
amountETH: "5000000000000000000" //5 ETH
3
});
Copied!
Constructor object fields
amountETHrequired string | number | JSBI
Amount of ETH to lend in wei format
Returns
Creates a new operation object

Redeem ETH

In Assets: CETH Out Assets: ETH
A lender returns CETH to the protocol and receives in exchange ETH that includes the interest accrued.
JavaScript & Node
1
const operation = new defire.Operations.Compound.Redeem.ETH({
2
amountCETH: "5000000000000000000" //5 CETH
3
});
Copied!
Constructor object fields
amountCETH required string | number | JSBI
Total number of CETH to return in wei format
Returns
Creates a new operation object

Lending USDC

In Assets: USDC Out Assets: CUSDC
A lender supplies USDC to the protocol and receives CUSDC tokens in exchange (IOU tokens). Based on demand and supply of USDC in the market, functions of the compound protocol will calculate the interest accrued for all those issued CUSDC tokens.
JavaScript & Node
1
const operation = new defire.Operations.Compound.Lend.USDC({
2
amountUSDC: "5000000000000000000" //5 USDC
3
});
Copied!
Constructor object fields
amountUSDCrequired string | number | JSBI
Amount of USDC to lend in wei format
Returns
Creates a new operation object

Redeem USDC

In Assets: CUSDC Out Assets: USDC
A lender returns CUSDC to the protocol and receives in exchange USDC that includes the interest accrued.
JavaScript & Node
1
const operation = new defire.Operations.Compound.Redeem.USDC({
2
amountCUSDC: "5000000000000000000" //5 CUSDC
3
});
Copied!
Constructor object fields
amountCUSDC required string | number | JSBI
Total number of CUSDC to return in wei format
Returns
Creates a new operation object

Lending WBTC

In Assets: WBTC Out Assets: CWBTC
A lender supplies WBTC to the protocol and receives CWBTC tokens in exchange (IOU tokens). Based on demand and supply of WBTC in the market, functions of the compound protocol will calculate the interest accrued for all those issued CWBTC tokens.
JavaScript & Node
1
const operation = new defire.Operations.Compound.Lend.WBTC({
2
amountWBTC: "5000000000000000000" //5 WBTC
3
});
Copied!
Constructor object fields
amountDAIrequired string | number | JSBI
Amount of WBTC to lend in wei format
Returns
Creates a new operation object

Redeem WBTC

In Assets: CWBTC Out Assets: WBTC
A lender returns CWBTC to the protocol and receives in exchange WBTC that includes the interest accrued.
JavaScript & Node
1
const operation = new defire.Operations.Compound.Redeem.WBTC({
2
amountCWBTC: "5000000000000000000" //5 CWBTC
3
});
Copied!
Constructor object fields
amountCDAI required string | number | JSBI
Total number of CWBTC to return in wei format
Returns
Creates a new operation object
Last modified 1yr ago