Set Documentation
Search…
Lending on Compound

Getting the Wrap Calldata from Compound:

In order to lend or withdraw your components on Compound, you will need to call the wrap (wrapWithEther) or unwrap (unwrapWithEther) functions on the WrapModule. Compound interacts directly with Ether, so wrapWithEther and unwrapWithEther are needed when depositing or withdrawing WETH in the SetToken.
Select examples:
This is an example of what to pass into the wrap function for WBTC to cWBTC.
1
/**
2
* MANAGER-ONLY: Instructs the SetToken to wrap an underlying asset into a wrappedToken via a specified adapter.
3
*
4
* @param _setToken Instance of the SetToken
5
* @param _underlyingToken Address of the component to be wrapped
6
* @param _wrappedToken Address of the desired wrapped token
7
* @param _underlyingUnits Quantity of underlying units in Position units
8
* @param _integrationName Name of wrap module integration (mapping on integration registry)
9
*/
10
function wrap(
11
0xYourSetTokenAddress,
12
0x2260fac5e5542a773aa44fbcfedf7c193bc2c599,
13
0xccf4429db6322d5c611ee964527d42e5d685dd6a,
14
3000,
15
CompoundWrapAdapter
16
)
Copied!
This is an example of what to pass into the unwrap function for cETH to WETH.
1
/**
2
* MANAGER-ONLY: Instructs the SetToken to unwrap a wrapped asset collateralized by Ether into Wrapped Ether. Since
3
* external protocol will send back Ether that Ether must be Wrapped into WETH in order to be accounted for by SetToken.
4
*
5
* @param _setToken Instance of the SetToken
6
* @param _wrappedToken Address of the component to be unwrapped
7
* @param _wrappedUnits Quantity of wrapped tokens in Position units
8
* @param _integrationName ID of wrap module integration (mapping on integration registry)
9
*/
10
function unwrapWithEther(
11
0xYourSetTokenAddress,
12
0x4ddc2d193948926d02f9b1fe9e1daa0718270ed5,
13
1000000000000000000,
14
CompoundWrapAdapter
15
)
Copied!
Last modified 6mo ago
Copy link