Blueshift Docs
  • Introduction
    • What is Blueshift?
    • Blueshift token (BLUES)
    • Blueshiftโ€™s audit
    • Fees
  • Getting started
    • How do I connect wallet?
      • Configuring MetaMask
    • How to transfer ADA from Cardano to Milkomeda network?
    • How to transfer Cardano Native Tokens (CNTs) to Milkomeda network?
    • How to transfer ALGO from Algorand to Milkomeda A1 network?
    • How do I trade on Blueshift?
      • ๐ŸŽ“ Swap tutorial
    • How do I provide liquidity (get LP tokens)?
      • ๐ŸŽ“ Add liquidity tutorial
    • How do I withdraw liquidity?
      • ๐ŸŽ“ Withdraw tutorial
    • How do I use farms ?
  • Product concept
    • ๐Ÿ”ฅ Swap Cross-Chain/Local
    • Portfolios
      • Single token invest
    • Farming
    • Yield pools
      • Auto HODL BLUES Pool
    • Smart minting system
    • Referral program ๐Ÿ”ฅ
    • Cardano Wrapped Smart Contracts
  • TECHNICAL REFERENCE
    • Smart contracts overview
    • Blueshift contracts addresses
    • Interface specifications
      • IBlueshiftRouter
      • IBlueshiftArbitrageRouter
      • IOracle
      • IPortfolio
      • IMinterV3
      • IEarningV2
      • IStakingV2
      • IAutoStakingV3
  • Community
    • Telegram (Off. group)
    • Telegram (Chat)
    • Twitter
Powered by GitBook
On this page
  • Parameter Structs
  • Signature
  • ExternalOraclePrice
  • Functions
  • WETH
  • arbitrageSwapExactTokensForTokens
  • arbitrageSwapExactETHForTokens

Was this helpful?

  1. TECHNICAL REFERENCE
  2. Interface specifications

IBlueshiftArbitrageRouter

Parameter Structs

Signature

ExternalOraclePrice

Functions

WETH

arbitrageSwapExactTokensForTokens

arbitrageSwapExactETHForTokens

Parameter Structs

Signature

struct Signature {
        uint8 v;
        bytes32 r;
        bytes32 s;
    }

Standard ECDSA signature structure.

ExternalOraclePrice

struct ExternalOraclePrice {
        address baseToken;
        uint256[] prices;
        address[] tokens;
        uint256 timestamp;
        Signature signature;
    }

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

function WETH() external view returns (address)

Returns current network`s wrapped native token`s address.

arbitrageSwapExactTokensForTokens

function arbitrageSwapExactTokensForTokens(
        address tokenIn,
        address tokenOut,
        uint256 amountIn,
        uint256 minAmountOut,
        address to,
        uint256 deadline,
        address portfolio,
        EOP.ExternalOraclePrice calldata externalOraclePrice
    ) external returns (uint256 amountOut)

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

function arbitrageSwapExactETHForTokens(
        address tokenOut,
        uint256 minAmountOut,
        address to,
        uint256 deadline,
        address portfolio,
        EOP.ExternalOraclePrice calldata externalOraclePrice
    ) external payable returns (uint256 amountOut)

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

PreviousIBlueshiftRouterNextIOracle

Last updated 2 years ago

Was this helpful?