updateStrategy
Last updated
Last updated
This function is used to make changes to a strategy on Carbon DeFi, such as adding or removing liquidity, pausing/unpausing, changing trade rates, etc.
Name | Type | Description |
---|---|---|
While all required data is available on chain, it is recommended to use the Carbon DeFi SDK.
To create a strategy with the ETH token, use the contract address: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE
strategyId
uint256
The ID of the strategy to update.
currentOrders
array
This is the current values of the order being edited. This is included to verify the state of the order before changing it, ensuring it's being updated from the expected state. This safeguard prevents editing an order right after it was changed due to trades.
newOrders
array
This is an array of the new Order objects, with their updated parameters, exactly the same as the object in createStrategy. Each order contains the following: y: uint128 The amount of tokens deposited into the order. z: uint128 The y intercept of the order. A: uint64 Price range (width) parameter. B: uint64 Price range (edge) parameter.