IAlgorithm
Author: Async Labs
This interface defines the functions for transaction ordering algorithms used in the Async Swap AMM hook.
Functions
orderingRule
Executes the transaction ordering algorithm.
function orderingRule(bool zeroForOne, uint256 amount) external;
Parameters
| Name | Type | Description |
|---|---|---|
zeroForOne | bool | Indicates the direction of the trade (true for currency0 to currency1, false for currency1 to currency0). |
amount | uint256 | The amount of the order being processed. |
name
Returns the name of the ordering algorithm.
function name() external view returns (string memory);
Returns
| Name | Type | Description |
|---|---|---|
<none> | string | The name of the algorithm as a string. |
version
Version of the algorithm.
function version() external view returns (string memory);
Returns
| Name | Type | Description |
|---|---|---|
<none> | string | The version of the algorithm as a string. |
getVolatility
function getVolatility(AsyncOrder[] memory orders) external pure returns (uint256);