Function: amend(address account, AmendArgs args)
This function amends an existing limit order for the specified account. It can be called by the account itself or an approved operator, and it handles matching and settling amended orders with the existing order book. It also notifies the CLOBManager for token settlement and applies fees.
Inputs
accountControl: Full control.
Constraints: Should be
msg.senderitself or an approved operator for theaccountand the owner of the order.Impact: The owner of the order being amended.
argsControl: Full control.
Constraints:
args.limitOrderTypecan only bePOST_ONLY.Impact: Contains
orderId,amountInBase,price,cancelTimestamp,side,limitOrderType, andsettlement.
Branches and code coverage
Intended branches
If
args.cancelTimestampis less than the currentblock.timestamp, the order will be canceled successfully without a fee.If
args.amountInBaseis less than thesettings.minLimitOrderAmountInBase, the order will be canceled successfully without a fee.The
sideof the order has been changed successfully.The
priceof the order has been updated successfully.
Negative behavior
order.owner != account.The caller is not an
accountoroperatorof the account.price % tickSize != 0.args.price == 0.limitOrderType == LimitOrderType.GOOD_TILL_CANCELLED.order.iddoes not exist.