IBlueshiftArbitrageRouter
Parameter Structs
Signature
Standard ECDSA signature structure.
ExternalOraclePrice
Structure that holds lists of tokens and their prices got from Blueshift`s verified external price source.
Fields description
Name | Type | Description |
baseToken | address | Base token of the portfolio that holds tokens |
prices | uint256[] | Prices of portfolio`s tokens in a portfolio`s base currency |
tokens | address[] | Tokens from one portfolio, not essentially all the tokens of the portfolio, could be a subset of all portfolio`s tokens (up to only one token) |
timestamp | uint256 | Indicates when the tokens` prices were signed by the external source |
signature | struct EOP.Signature | Standard ECDSA signature. Verified external source signs all other structure`s fields together and then adds a signature field |
Functions
WETH
Returns current network`s wrapped native token`s address.
arbitrageSwapExactTokensForTokens
Performs arbitrage swap using specified tokens of the specified portfolio (arbitrage swaps do not have fees).
Parameters
Name | Type | Description |
tokenIn | address | Address of swap`s token in |
tokenOut | address | Address of swap`s token out |
amountIn | uint256 | Exact amount of swap`s token in |
minAmountOut | uint256 | Minimal amount of swap`s tokenOut. If less tokens are received during swap the transaction is reverted |
to | address | Output token`s receiver address |
deadline | uint256 | Timestamp indicates when the swap becomes irrelevant |
portfolio | address | Address of portfolio that holds tokenIn and tokenOut |
externalOraclePrice | struct EOP. External OraclePrice | Struct with signature to be verified by portfolio to use data in order to check if arbitrage swap condition is met |
Return values
Name | Type | Description |
amountOut | uint256 | Amount of tokenOut received after swap |
arbitrageSwapExactETHForTokens
Performs ETH -> tokenOut arbitrage swap using the specified portfolio (arbitrage swaps do not have fees).
Parameters
Name | Type | Description |
tokenOut | address | Address of swap`s token out |
minAmountOut | uint256 | Minimal amount of swap`s tokenOut. If less tokens are received during swap the transaction is reverted |
to | address | Output token`s receiver address |
deadline | uint256 | Timestamp indicates when the swap becomes irrelevant |
portfolio | address | Address of portfolio that holds ETH and tokenOut |
externalOraclePrice | struct EOP. External OraclePrice | Struct with signature to be verified by portfolio to use data in order to check if arbitrage swap condition is met |
Return values
Name | Type | Description |
amountOut | uint256 | Amount of tokenOut received after swap |
Last updated