๐Vault Router
The vault router contract is a convenient way to take flash loans from White Whale vaults. Instead of interacting with individual vaults, bots can request the vault router the desired asset to do the flash loan operation with and the router will take care of communicating and requesting the funds to the appropriate vault.
An interesting feature that the White Whale Vault Router is pioneering is the possibility to take multiple flash loans at once.
The code for the vault router can be found here.
The following are the messages that can be executed on the vault router:
Instantiate
Instantiates the vault router.
Key | Type | Description |
---|---|---|
| String | The owner of the router |
| String | The address for the vault factory |
Migrate
Migrates the vault router.
ExecuteMsg
Flashloan
Retrieves the desired assets
and runs the msgs
, paying the required amount back the vaults after running the messages, and returning the profit to the sender.
Key | Type | Description |
---|---|---|
| Vec<Asset> | Desired assets for the flash loan(s) |
| Vec<CosmosMsg> | Messages to be executed with the flash loan(s) |
Next loan
Performs the next loan in case multiple flash loans are taken. This message is called internally by the vault where the flash loan is being taken from. Cannot be called manually.
Key | Type | Description |
---|---|---|
| Addr | The address to pay back all profits to |
| String | The vault contract that calls the `NextLoan message |
| Vec<CosmosMsg> | The final message to run once all assets have been loaned |
| Vec<(String, Asset)> | The next loans to run |
| Vec<(String, Asset)> | The assets that have been loaned |
Complete loan
Completes the flash-loan by paying back all outstanding loans, and returning profits to the sender. This message is called internally by the vault router, cannot be called manually.
Key | Type | Description |
---|---|---|
| Addr | The address to pay back all profits to |
| Vec<(String, Asset)> | A vec of tuples where the first value represents the vault address, and the second value represents the loan size |
Update config
Updates the configuration of the vault router.
Key | Type | Description |
---|---|---|
| Option<String> | New owner of the router |
| Option<String> | New vault factory address |
Queries
Retrieves the configuration of the vault router. Returns a Config
struct.
Config
Last updated