updateStrategy

This function creates an unsigned transaction to update an existing strategy.

public async updateStrategy(
    strategyId: BigNumberish,
    encoded: EncodedStrategy,
    baseToken: { address: string; decimals: number },
    quoteToken: { address: string; decimals: number },
    buyPriceLow: string,
    buyPriceHigh: string,
    buyBudget: string,
    sellPriceLow: string,
    sellPriceHigh: string,
    sellBudget: string,
    overrides?: PayableOverrides
  )
NameTypeDescription

strategyId

number

The id of the strategy to update.

encoded

EncodedStrategy

The encoded form of the strategy that is being updated. This can be acquired using the getUserStrategies function.

baseToken

object {token address, number}

An object containing a token address and a string with the number of decimal places used for the given token.

quoteToken

object {token address, number}

An object containing a token address and a string with the number of decimal places used for the given token.

buyPriceLow

string (number)

The lowest price at which to buy the quote token, in the form of quoteTokens per 1 baseToken.

buyPriceHigh

string (number)

The highest price at which to buy the quote token, in the form quoteTokens per 1 baseToken.

buyBudget

string (number)

The number of base tokens to start the strategy with.

sellPriceLow

string (number)

The lowest price at which to buy the base token, in the form of baseTokens per 1 quote token.

sellPriceHigh

string (number)

The highest price at which to buy the base token, in the form of baseTokens per 1 quote token.

sellBudget

string (number)

The number of quote tokens to start the strategy with.

overrides

object (optional)

This optional object contains transaction parameters, such as gas price, Eth value, etc. See overrides in the Ethers documentation for details.

Returns

This function returns an unsigned transaction, ready to be signed and submitted to the blockchain.

Last updated