Router
The Router contract routes deposit/redeem requests by assigning operation contracts.
Note that the Router contract only supports wrapped UST and wrapped aUST for deposits and redemptions. For operations that involve non-UST stablecoins, interactions should be made via the ConversionPool contracts.

Functions

init

Initiates a deposit/redeem operation.
1
function init(
2
IOperation.Type _type,
3
address _operator,
4
uint256 _amount,
5
address _swapper,
6
address _swapDest,
7
bool _autoFinish
8
) external;
9
10
interface IOperation {
11
enum Type {NEUTRAL, DEPOSIT, REDEEM}
12
}
Copied!
Name
Type
Description
_type
IOperation.Type
Operation type. Can be either of deposit or redeem (withdraw)
_operator
address
Address of operation requester
_amount
uint256
Amount of wrapped UST/aUST used in operation
_swapper
address
Swapper contract that defines logic for swapping tokens
_swapDest
address
Address of token to receive post-operation
_autoFinish
bool
Indicator to signal whether to have the corresponding finish operation automated

finish

Finishes a deposit/redeem operation.
1
function finish(address _operation) external;
Copied!
Name
Type
Description
_operation
address
Address of Operation contract to call finish

depositStable

Deposits the specified amount of wrapped UST.
1
function depositStable(uint256 _amount) external;
Copied!
Name
Type
Description
_amount
uint256
Amount of wrapped UST to deposit

depositStable

Deposits the specified amount of wrapped UST. Returns resulting wrapped aUST to the specified address.
1
function depositStable(address _operator, uint256 _amount) external;
Copied!
Name
Type
Description
_operator
address
Address to receive resulting wrapped aUST
_amount
uint256
Amount of wrapped UST to deposit

depositStable

Deposits the specified amount of wrapped UST. Swaps resulting wrapped aUST to the specified token (_swapDest) using logic defined in the specified swapper contract (_swapper), and returns tokens to the specified address (_operator).
1
function depositStable(
2
address _operator,
3
uint256 _amount,
4
address _swapper,
5
address _swapDest
6
) external;
Copied!
Name
Type
Description
_operator
address
Address to receive resulting tokens
_amount
uint256
Amount of wrapped UST to deposit
_swapper
address
Swapper contract that defines logic for swapping tokens
_swapDest
address
Address of token to receive post-deposit

initDepositStable

Initiates a deposit request for the specified amount of wrapped UST.
1
function initDepositStable(uint256 _amount) external;
Copied!
Name
Type
Description
_amount
uint256
Amount of wrapped UST to deposit

initDepositStable

Initiates a deposit request for the specified amount of wrapped UST. Swaps resulting wrapped aUST to the specified token.
1
function initDepositStable(
2
uint256 _amount,
3
address _swapper,
4
address _swapDest
5
) external;
Copied!
Name
Type
Description
_amount
uint256
Amount to wrapped UST to deposit
_swapper
address
Swapper contract that defines logic for swapping tokens
_swapDest
address
Address of token to receive post-deposit

finishDepositStable

Finishes deposit operation for the specified Operation contract.
1
function finishDepositStable(address _operation) external;
Copied!
Name
Type
Description
_operation
address
Address of Operation contract to call finish

redeemStable

Redeems (withdraws) the specified amount of wrapped aUST.
1
function redeemStable(uint256 _amount) external;
Copied!
Name
Type
Description
_amount
uint256
Amount of wrapped aUST to redeem

redeemStable

Redeems the specified amount of wrapped aUST. Returns resulting wrapped UST to the specified address.
1
function redeemStable(address _operator, uint256 _amount) external;
Copied!
Name
Type
Description
_operator
address
Address to receive resulting wrapped UST
_amount
uint256
Amount of wrapped aUST to redeem

redeemStable

Redeems the specified amount of wrapped aUST. Swaps resulting wrapped UST to the specified token (_swapDest) using logic defined in the specified swapper contract (_swapper), and returns tokens to the specified address (_operator).
1
function redeemStable(
2
address _operator,
3
uint256 _amount,
4
address _swapper,
5
address _swapDest
6
) external;
Copied!
Name
Type
Description
_operator
address
Address to receive resulting tokens
_amount
uint256
Amount of wrapped aUST to redeem
_swapper
address
Swapper contract that defines logic for swapping tokens
_swapDest
address
Address of token to receive post-redemption

initRedeemStable

Initiates a redemption for the specified amount of wrapped aUST.
1
function initRedeemStable(uint256 _amount) external;
Copied!
Name
Type
Description
_amount
uint256
Amount of wrapped aUST to redeem

initRedeemStable

Initiates a stablecoin redemption. Swaps resulting wrapped UST to the specified token (_swapDest) using logic defined in the specified swapper contract (_swapper), and returns tokens to the specified address (_operator).
1
function initRedeemStable(
2
uint256 _amount,
3
address _swapper,
4
address _swapDest
5
) external;
Copied!
Name
Type
Description
_amount
uint256
Amount of aUST tokens to redeem
_swapper
address
Swapper contract that defines logic for swapping tokens
_swapDest
address
Address of token to receive post-redemption

finishRedeemStable

Finishes a redeem operation for the specified Operation contract.
1
function finishRedeemStable(address _operation) external;
Copied!
Name
Type
Description
_operation
address
Address of Operation contract to call finish
Last modified 5mo ago