-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
866ae1c
commit 17ea246
Showing
12 changed files
with
184 additions
and
290 deletions.
There are no files selected for viewing
67 changes: 67 additions & 0 deletions
67
packages/protocol/src/contracts/interfaces/IEpochConfigurationModule.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity >=0.8.2 <0.9.0; | ||
|
||
import {IFoilStructs} from "./IFoilStructs.sol"; | ||
import "../storage/Position.sol"; | ||
import "../storage/FAccount.sol"; | ||
|
||
interface IEpochConfigurationModule { | ||
function initializeMarket( | ||
address owner, | ||
address collateralAsset, | ||
address uniswapPositionManager, | ||
address uniswapQuoter, | ||
address uniswapSwapRouter, | ||
address optimisticOracleV3, | ||
IFoilStructs.EpochParams memory epochParams | ||
) external; | ||
|
||
function updateMarket( | ||
address owner, | ||
address uniswapPositionManager, | ||
address uniswapQuoter, | ||
address uniswapSwapRouter, | ||
address optimisticOracleV3, | ||
IFoilStructs.EpochParams memory epochParms | ||
) external; | ||
|
||
function createEpoch( | ||
uint256 startTime, | ||
uint256 endTime, | ||
uint160 startingSqrtPriceX96 | ||
) external; | ||
|
||
function getMarket() | ||
external | ||
view | ||
returns ( | ||
address owner, | ||
address collateralAsset, | ||
address uniswapPositionManager, | ||
address uniswapQuoter, | ||
address uniswapSwapRouter, | ||
address optimisticOracleV3, | ||
IFoilStructs.EpochParams memory epochParams | ||
); | ||
|
||
function getEpoch( | ||
uint256 id | ||
) | ||
external | ||
view | ||
returns ( | ||
uint256 startTime, | ||
uint256 endTime, | ||
address pool, | ||
address ethToken, | ||
address gasToken | ||
); | ||
|
||
function getPositionData( | ||
uint256 accountId | ||
) external returns (Position.Data memory); | ||
|
||
function getAccountData( | ||
uint256 accountId | ||
) external returns (FAccount.Data memory); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
packages/protocol/src/contracts/interfaces/IEpochTradeModule.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity >=0.8.2 <0.9.0; | ||
|
||
import {IFoilStructs} from "./IFoilStructs.sol"; | ||
|
||
interface IEpochTradeModule { | ||
function createTraderPosition( | ||
uint256 epochId, | ||
uint256 collateralAmount, | ||
int256 tokenAmount, | ||
int256 tokenAmountLimit | ||
) external returns (uint256 accountId); | ||
|
||
function modifyTraderPosition( | ||
uint256 epochId, | ||
uint256 accountId, | ||
uint256 collateralAmount, | ||
int256 tokenAmount, | ||
int256 tokenAmountLimit | ||
) external; | ||
|
||
function getReferencePrice( | ||
uint epochId | ||
) external view returns (uint256 price18Digits); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.