|
| 1 | +// SPDX-License-Identifier: MIT |
| 2 | +pragma solidity ^0.8.26; |
| 3 | + |
| 4 | +import { BaseAlgorithm } from "./BaseAlgorithm.sol"; |
| 5 | +import { IAlgorithm } from "@async-swap/interfaces/IAlgorithm.sol"; |
| 6 | + |
| 7 | +/// @title Greedy Sequencing Rule (GSR) Ordering Contract |
| 8 | +/// @author Meek Msaki @ Async Labs |
| 9 | +/// @notice This contract implements the Greedy Sequencing Rule (GSR) for ordering transactions. |
| 10 | +/// The GSR algorithm is a transaction ordering rule that follows the following principles: |
| 11 | +/// 1. Start with any trade. Incase of GSRa, the first trade is the smallest trade. |
| 12 | +/// 2. If the price is above status-quo (overbought), pick a sell. |
| 13 | +/// 3. Otherwise, pick a buy. |
| 14 | +/// 4. Repeat 2-3 until all choices are exhausted. |
| 15 | +/// @custom:clvr https://arxiv.org/abs/2408.02634 |
| 16 | +/// @custom:gdr https://arxiv.org/pdf/2209.15569 |
| 17 | +contract GSR is BaseAlgorithm { |
| 18 | + |
| 19 | + constructor(address _hookAddress) BaseAlgorithm(_hookAddress) { } |
| 20 | + |
| 21 | + /// @inheritdoc IAlgorithm |
| 22 | + function name() external pure override returns (string memory) { |
| 23 | + return "GSR"; |
| 24 | + } |
| 25 | + |
| 26 | + /// @inheritdoc IAlgorithm |
| 27 | + function version() external pure override returns (string memory) { |
| 28 | + return "1.0.0"; |
| 29 | + } |
| 30 | + |
| 31 | + /// @inheritdoc IAlgorithm |
| 32 | + function orderingRule(bool zeroForOne, uint256 amount) external pure override { |
| 33 | + /// TODO: Implement the GSR algorithm logic here. |
| 34 | + } |
| 35 | + |
| 36 | +} |
0 commit comments