-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add missing docs on interfaces and modules (#1745)
* Add missing docs on interfaces and modules * Update markets/perps-market/contracts/interfaces/IPerpsMarketFactoryModule.sol Co-authored-by: troy (troyb.eth) <[email protected]> * pr review -> size in `units of native asset` * docgen --------- Co-authored-by: troy (troyb.eth) <[email protected]>
- Loading branch information
1 parent
06f070b
commit 08fd1fe
Showing
13 changed files
with
517 additions
and
5 deletions.
There are no files selected for viewing
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
28 changes: 28 additions & 0 deletions
28
markets/perps-market/contracts/interfaces/ILiquidationModule.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 |
---|---|---|
@@ -1,19 +1,47 @@ | ||
//SPDX-License-Identifier: MIT | ||
pragma solidity >=0.8.11 <0.9.0; | ||
|
||
/** | ||
* @title Liquidation module | ||
*/ | ||
interface ILiquidationModule { | ||
/** | ||
* @notice Thrown when attempting to liquidate an account not elegible for liquidation | ||
*/ | ||
error NotEligibleForLiquidation(uint128 accountId); | ||
|
||
/** | ||
* @notice Gets fired when an account position is liquidated . | ||
* @param marketId Id of the position's market. | ||
* @param accountId Id of the account liquidated. | ||
* @param amountLiquidated amount liquidated. | ||
* @param currentPositionSize position size after liquidation. | ||
*/ | ||
event PositionLiquidated( | ||
uint128 indexed accountId, | ||
uint128 indexed marketId, | ||
uint256 amountLiquidated, | ||
int128 currentPositionSize | ||
); | ||
|
||
/** | ||
* @notice Gets fired when an account is liquidated. | ||
* @dev this event is fired once per liquidation tx after the each position that can be liquidated at the time was liquidated. | ||
* @param accountId Id of the account liquidated. | ||
* @param reward total reward sent to liquidator. | ||
* @param fullLiquidation flag indicating if it was a partial or full liquidation. | ||
*/ | ||
event AccountLiquidated(uint128 indexed accountId, uint256 reward, bool fullLiquidation); | ||
|
||
/** | ||
* @notice Liquidates an account. | ||
* @dev according to the current situation and account size it can be a partial or full liquidation. | ||
* @param accountId Id of the account to liquidate. | ||
*/ | ||
function liquidate(uint128 accountId) external; | ||
|
||
/** | ||
* @notice Liquidates all flagged accounts. | ||
*/ | ||
function liquidateFlagged() external; | ||
} |
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.