Operations
This section explains what is an operation, how they work and what instruments do they use.

List of Available Operations

These are the current available operations:
Instrument
Description
In Assets
Out Assets
​Compound​
​Lend DAI​
DAI
CDAI
​​Compound​
​Redeem DAI​
CDAI
DAI
​Compound​
​Lend ETH​
ETH
CETH
​Compound​
​Redeem ETH​
CETH
ETH
​Compound​
​Lend USDC​
USDC
CUSDC
​Compound​
​Redeem USDC​
CUSDC
USDC
​Compound​
​Lend WBTC​
WBTC
CWBTC
​Compound​
​Redeem WBTC​
CWBTC
WBTC
​Uniswap​
​Trade DAI for ETH​
DAI
ETH
​Uniswap​
​Trade ETH for DAI​
ETH
DAI
​Uniswap​
​Trade USDC for ETH​
USDC
ETH
​Uniswap​
​Trade ETH for USDC​
ETH
USDC
​Uniswap​
​Trade WBTC for ETH​
WBTC
ETH
​Uniswap​
​Trade ETH for WBTC​
ETH
WBTC
​Wrappers​
​Wrap ETH​
ETH
WETH
​Wrappers​
​Unwrap ETH​
WETH
ETH
​Defire​
​Deposit in Fund​
[ANY]
FUND TOKEN
​Defire​
​Withdraw from Fund​
FUND TOKEN
[ANY]

Operation object

It contains the information, query and action methods about a specific operation.
Object fields
address string
Smart contract address of the operation

In assets query

A query method that returns the list of assets that the operations receives.
JavaScript & Node
1
const assets = await operation.query.getInAssets();
Copied!
Returns
This method returns a Promise which resolves with an Array of String containing the asset addresses.

Out assets query

A query method that returns the list of assets that the operations returns.
JavaScript & Node
1
const assets = await operation.query.getOutAssets();
Copied!
Returns
This method returns a Promise which resolves with an Array of String containing the asset addresses.

Redirect output

A method to redirect the output of an asset to another operation. The amount that is redirected can be a fixed amount or a percentage.
JavaScript & Node
1
operation.redirectOutput({
2
address: "0x711ADB1DaC5B7B6Ec60857b59dE3eeB3aE8b8927",
3
amount: "320000000000000000000", //320
4
to: operation3.address
5
}),
6
​
7
operation.redirectOutput({
8
address: "0x711ADB1DaC5B7B6Ec60857b59dE3eeB3aE8b8927",
9
isPercentage: true,
10
amount: "250000000000000000", //25%
11
to: operation3.address
12
}),
Copied!
Method parameters
address required address
Smart contract address of of the asset to redirect.
isPercentage optional boolean
If true, the amount field is not fixed but a percentage. Defaults: false
amountrequired string | number | JSBI​
Amount of the asset to redirect in wei format. If is percentage, must be between 0 and 1.
to required address
Smart contract address of another operation to redirect the assets.