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
JavaScript & Node
const assets = await operation.query.getInAssets();

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
JavaScript & Node
const assets = await operation.query.getOutAssets();

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
JavaScript & Node
operation.redirectOutput({
address: "0x711ADB1DaC5B7B6Ec60857b59dE3eeB3aE8b8927",
amount: "320000000000000000000", //320
to: operation3.address
}),
operation.redirectOutput({
address: "0x711ADB1DaC5B7B6Ec60857b59dE3eeB3aE8b8927",
isPercentage: true,
amount: "250000000000000000", //25%
to: operation3.address
}),

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.