Receives two reports of the same moment, compares them, checks the limits and passes one report to the vault. Slot 0 is any active operator of the vault, slot 1 is the second reporter.
Inherits Upgradeable base.
Anyone
executeExceptional
function executeExceptional(Report calldata report) external;
Applies an approved report after the waiting time, makes the books equal to it, and starts the funding windows again. Anyone can call it.
Reporter
submit
function submit(Report calldata report) external;
Sends or replaces the report of the caller. The second matching report within the limits is applied in the same transaction.
Reporter only. Not stopped by any status except WindDown.
Admin
approveExceptional
function approveExceptional(bytes32 reportHash, uint64 fundingUntil) external;
Starts the 24 hours for a held report. Both reporters must have sent it exactly the same. A new report from either of them cancels the approval.
Admin only. Admin cannot give numbers.
| Parameter | Type | Description |
|---|
reportHash | bytes32 | |
fundingUntil | uint64 | After the report is accepted, reports up to this time are not held for the day and month limits. At most 7 days after the 24 hours. Zero lifts nothing. |
24-hour time delay
setSecondReporter
function setSecondReporter(address reporter) external;
Replaces the second reporter.
24 hour timelock only.
| Parameter | Type |
|---|
reporter | address |
Deployer
initialize
function initialize(address secondReporter) external;
Sets the second reporter once, through the proxy.
| Parameter | Type |
|---|
secondReporter | address |
Read
secondReporter
function secondReporter() external view returns (address);
fundingAllowanceUntil
function fundingAllowanceUntil() external view returns (uint64);
Reports up to this time are not held for the day and month limits.
submitted
function submitted(uint8 slot) external view returns (Report memory);
Report waiting in a slot for the next number.
lastNumber
function lastNumber() external view returns (uint64);
lastTime
function lastTime() external view returns (uint64);
Time of the last accepted report of any kind.
lastHour
function lastHour() external view returns (uint64);
Time of the last accepted hourly report.
fundingWindows
function fundingWindows() external view returns (int256 day, int256 month);
Funding rate of the last 24 and 720 hours, scaled by 1e18.
| Returns | Type |
|---|
day | int256 |
month | int256 |
limitsBroken
function limitsBroken(Report calldata report) external view returns (uint256);
Limits a report breaks, one bit for each, zero when it is within all of them.
Bit 0 hour, 1 day, 2 month, 3 short size, 4 fill price, 5 fill size, 6 cash, 7 liquidation that the books do not explain.
Events
ReportSubmitted
event ReportSubmitted(
uint8 indexed slot,
address indexed reporter,
uint64 indexed number,
Report report
);
| Parameter | Type |
|---|
slot (indexed) | uint8 |
reporter (indexed) | address |
number (indexed) | uint64 |
report | Report |
ReportMismatch
event ReportMismatch(uint64 indexed number);
| Parameter | Type |
|---|
number (indexed) | uint64 |
ReportHeld
event ReportHeld(uint64 indexed number, bytes32 reportHash, uint256 limits);
| Parameter | Type |
|---|
number (indexed) | uint64 |
reportHash | bytes32 |
limits | uint256 |
ReportAccepted
event ReportAccepted(
uint64 indexed number,
uint64 indexed time,
bytes32 reportHash
);
| Parameter | Type |
|---|
number (indexed) | uint64 |
time (indexed) | uint64 |
reportHash | bytes32 |
ExceptionalReportApproved
event ExceptionalReportApproved(
uint64 indexed number,
bytes32 indexed reportHash,
uint64 readyAt,
uint64 fundingUntil
);
| Parameter | Type |
|---|
number (indexed) | uint64 |
reportHash (indexed) | bytes32 |
readyAt | uint64 |
fundingUntil | uint64 |
ExceptionalReportWithdrawn
event ExceptionalReportWithdrawn(
uint64 indexed number,
bytes32 indexed reportHash
);
| Parameter | Type |
|---|
number (indexed) | uint64 |
reportHash (indexed) | bytes32 |
SecondReporterChanged
event SecondReporterChanged(
address indexed oldReporter,
address indexed newReporter
);
| Parameter | Type |
|---|
oldReporter (indexed) | address |
newReporter (indexed) | address |
Errors
NotReporter
The caller is neither an operator nor the second reporter.
SameReporter
One address cannot fill both slots.
WrongNumber
error WrongNumber(uint64 expected);
The report is not the next one.
| Parameter | Type |
|---|
expected | uint64 |
WrongTime
error WrongTime(uint64 expected);
The time is in the future, not later than the last report, or skips an hour.
| Parameter | Type |
|---|
expected | uint64 |
FundingOutsideHour
error FundingOutsideHour();
An execution report carries funding or is exactly on the hour.
BadFill
error BadFill(uint256 commandId);
A command is missing, unknown, twice or in the wrong place, its fill is below an earlier report, or it is done too early.
| Parameter | Type |
|---|
commandId | uint256 |
BadPriceRound
error BadPriceRound(uint80 roundId);
The Chainlink round was not in force while the command was open, or, for a liquidation, since the report before.
| Parameter | Type |
|---|
roundId | uint80 |
NotHeld
error NotHeld(bytes32 reportHash);
No held report has this hash.
| Parameter | Type |
|---|
reportHash | bytes32 |
error AllowanceTooLong(uint64 limit);
The allowance is too long.
ExceptionalNotReady
error ExceptionalNotReady(uint64 readyAt);
The waiting time of the exceptional report is not over.
| Parameter | Type |
|---|
readyAt | uint64 |