Function: settle(IERC20[] tokens, uint256[] clearingPrices, Trade[] trades, Action[][Literal(value=3, unit=None)] actions)

This function is a decentralized batch-settlement system where the authorized solver submits the optimal batch-settlement solution.

Inputs

  • tokens

    • Control: Full control.

    • Constraints: None.

    • Impact: An array of ERC-20 tokens to be traded in the settlement.

  • clearingPrices

    • Control: Full control.

    • Constraints: The length must be the same as the length of the tokens array, and the price value cannot be 0 (which will cause a division-by-zero error).

    • Impact: An array of token-clearing prices.

  • trades

    • Control: Full control.

    • Constraints: Each trade must have a valid user signature, tokenInIndex and tokenOutIndex must be within the range of the tokens array, validTo must be greater than or equal to block.timestamp, feeAmount must be less than amountIn, the order cannot have been filled or canceled, and the actual output amount must be greater than or equal to minAmountOut.

    • Impact: Structure representing a trade to be executed in a settlement.

  • actions

    • Control: Full control.

    • Constraints: action.target cannot be a VAULT_RELAYER address.

    • Impact: Structure representing an action to be executed during settlement.

Branches and code coverage

Intended branches

Negative behavior

Zellic © 2025Back to top ↑