Holds the money, owns the Lighter account, keeps the books and is the FV token. One address, with all functions of the three contracts of its code.
Inherits ERC20Metadata, ERC20Permit, Upgradeable base.
Anyone
swapForCommand
function swapForCommand(
uint256 commandId,
uint256 amountIn,
uint256 minOut
) external returns (uint256 amountOut);
Trades the asset for a command, within its limit and near the Chainlink price. For an entry or exit that is reported as done, anyone can trade what its fill needs and no more.
An operator can trade for any command. Anyone else only for an entry or exit that is reported as done.
| Parameter | Type |
|---|
commandId | uint256 |
amountIn | uint256 |
minOut | uint256 |
| Returns | Type |
|---|
amountOut | uint256 |
finishCommand
function finishCommand(uint256 commandId) external;
Closes the books of a reported command and charges its cost. A command without an order counts as reported when its asset trade is complete, after its deadline, or for an operator.
| Parameter | Type |
|---|
commandId | uint256 |
depositCollateral
function depositCollateral() external returns (uint256 amount);
Sends waiting capital to Lighter, and what the Funding Box owes Lighter. Money kept for a reset or for an open command that buys the asset stays. Less than Lighter takes waits for more.
sweepFunding
function sweepFunding() external returns (uint256 ticketId);
Asks Lighter for the part of the Funding Box that was not asked for yet.
| Returns | Type |
|---|
ticketId | uint256 |
retryWithdrawal
function retryWithdrawal(uint256 amount) external;
Asks again for withdrawals that Lighter did not execute, all of them or a part. Lighter ignores an amount above the free balance, so one call asks for at most half of what is missing.
| Parameter | Type |
|---|
amount | uint256 |
collect
function collect() external returns (uint256 amount);
Collects finished withdrawals and fills the tickets, some at a time when there are many. Series payments are also filled from the Funding Box and from capital in the vault that is not reserved, and without a short payouts and refunds from that capital. Withdrawals that nobody asked for become capital. In a wind-down it only fills tickets that pay others.
| Returns | Type | Description |
|---|
amount | uint256 | What arrived. Zero when a series was paid only from what the vault already had. |
sendFee
function sendFee() external returns (uint256 amount);
Sends the protocol fee that is in the vault to the treasury of GedhoControl. Zero when there is none.
recoverFromSubaccount
function recoverFromSubaccount(uint48 accountIndex, uint256 amount) external;
Asks for money from another Lighter account of the vault.
| Parameter | Type |
|---|
accountIndex | uint48 |
amount | uint256 |
guard
function guard(uint80 earlierRoundId) external;
Shrinks the short and sells as much of the asset after a larger rise, when there were no reports for two hours, or when an adjustment was due half an hour ago and nothing was done.
| Parameter | Type | Description |
|---|
earlierRoundId | uint80 | Chainlink round in force 30 minutes ago. Only read when reports arrive. |
emergencyExit
function emergencyExit() external;
Closes the whole short and sells all of the asset after the largest rise, without reports for two hours.
sellAfterTrigger
function sellAfterTrigger(
uint256 maxAsset,
uint256 minOut
) external returns (uint256 usdg);
Sells the asset that no longer has a short: after guard(), emergencyExit(), closeAll(), or 30 minutes after a lost short or an unrepaired difference. Not while the position is repaired.
| Parameter | Type |
|---|
maxAsset | uint256 |
minOut | uint256 |
publicAlign
function publicAlign() external returns (uint256 commandId);
Reduces the short to the asset after an operator did not repair the difference for 30 minutes. While an adjustment or alignment of an operator is open it only ends that one, so that a fill is not closed twice.
| Returns | Type | Description |
|---|
commandId | uint256 | Zero when it only ended a command. |
repeatClose
function repeatClose() external;
Sends the closing order again in an emergency, when reports say that it was not filled.
poke
function poke() external;
Records a status that changed by time or price.
removeRevokedKey
function removeRevokedKey(uint8 apiKeySlot) external;
Asks Lighter again to remove the API key of an operator that was revoked, while no active operator uses the slot. Anyone can call it.
During a pause only Admin can call it.
| Parameter | Type |
|---|
apiKeySlot | uint8 |
startWindDown
function startWindDown() external;
Ends the vault for good, after 14 days without a valid hourly report or after Lighter stopped.
windDownClose
function windDownClose(uint48 accountIndex) external;
Cancels orders, removes the API keys and closes the short of one account, while Lighter still runs.
| Parameter | Type |
|---|
accountIndex | uint48 |
windDownSell
function windDownSell(
uint256 maxAsset,
uint256 minOut
) external returns (uint256 usdg);
Sells the asset in parts, near the Chainlink price.
| Parameter | Type |
|---|
maxAsset | uint256 |
minOut | uint256 |
windDownWithdraw
function windDownWithdraw(uint48 accountIndex, uint256 amount) external;
Asks Lighter for money from any account of the vault.
| Parameter | Type |
|---|
accountIndex | uint48 |
amount | uint256 |
windDownDistribute
function windDownDistribute() external returns (uint256 usdg, uint256 asset);
Counts USDG that arrived and shares it among all shares. After 30 days also the asset that was not sold.
| Returns | Type |
|---|
usdg | uint256 |
asset | uint256 |
windDownClaim
function windDownClaim(
uint256 shares
) external returns (uint256 usdg, uint256 asset);
Burns shares of the caller once and pays what they earned so far. Later arrivals are paid by calling it again with zero shares.
| Parameter | Type |
|---|
shares | uint256 |
| Returns | Type |
|---|
usdg | uint256 |
asset | uint256 |
Operator
startAdjustment
function startAdjustment() external returns (uint256 commandId);
Shrinks the short back to 2x after the asset rose as far as the market allows.
| Returns | Type |
|---|
commandId | uint256 |
startAlign
function startAlign() external returns (uint256 commandId);
Removes a difference between the asset and the short by reducing the larger one.
| Returns | Type |
|---|
commandId | uint256 |
prepareReset
function prepareReset() external returns (uint256 ticketId);
Moves the Funding Box into the capital, between two series, and asks Lighter for the money that startReset() needs to buy the asset.
| Returns | Type | Description |
|---|
ticketId | uint256 | Zero when nothing is needed. |
startReset
function startReset() external returns (uint256 commandId);
Brings the position to 2x after prepareReset(). Done at once when the difference is smaller than one lot.
| Returns | Type |
|---|
commandId | uint256 |
startReopen
function startReopen() external returns (uint256 commandId);
Opens the short at 2x when there is none: the first time, or after it was lost.
| Returns | Type |
|---|
commandId | uint256 |
Admin
seed
function seed() external;
First deposit, once. Creates the Lighter account. Its shares can never be redeemed.
closeAll
function closeAll() external;
Closes the whole position at once.
revokeOperator
function revokeOperator(address operator) external;
Removes an operator at once, and asks Lighter to remove its API key. The role ends even when the command to Lighter fails.
| Parameter | Type |
|---|
operator | address |
24-hour time delay
setOperator
function setOperator(
address operator,
uint8 apiKeySlot,
bytes calldata publicKey
) external;
Installs an operator with its API key.
24 hour timelock only. Slots 4 to 254.
| Parameter | Type |
|---|
operator | address |
apiKeySlot | uint8 |
publicKey | bytes |
72-hour time delay
setCodec
function setCodec(address codec) external;
Replaces the codec.
72 hour timelock only.
| Parameter | Type |
|---|
codec | address |
Deployer
initialize
function initialize(address codec) external;
Names the FV token and sets the codec, once, through the proxy. Fails unless the extension and the code of the wind-down were built for this address and with the same values.
| Parameter | Type |
|---|
codec | address |
The queue
beginEntry
function beginEntry(
uint64 roundHour,
uint256 usdg,
uint256 asset
) external returns (uint256 commandId, uint256 value, uint256 price);
Takes the entries of a round and issues the order for their short. Never fails because of their size or of the books.
| Parameter | Type |
|---|
roundHour | uint64 |
usdg | uint256 |
asset | uint256 |
| Returns | Type | Description |
|---|
commandId | uint256 | Zero when entries cannot be taken now. Nothing is taken then. |
value | uint256 | Denominator for the parts of the requests, USDG. |
price | uint256 | Price for the asset, the lower of Chainlink and pool. |
finalizeEntry
function finalizeEntry(
uint64 roundHour
) external returns (uint256 shares, uint256 refundUsdg, uint256 refundAsset);
Mints shares for the part that became a position. The rest is the refund. Without a position, or when the vault has no short, everything is the refund.
| Parameter | Type |
|---|
roundHour | uint64 |
| Returns | Type |
|---|
shares | uint256 |
refundUsdg | uint256 |
refundAsset | uint256 |
beginExit
function beginExit(
uint64 roundHour,
uint256 shares
) external returns (uint256 commandId);
Sets the part of the leaving shares apart and issues the order for their short. Without a short the command has no size and only sells the asset.
| Parameter | Type |
|---|
roundHour | uint64 |
shares | uint256 |
| Returns | Type | Description |
|---|
commandId | uint256 | Zero when the order would be smaller than one lot. Nothing is set apart then. |
finalizeExit
function finalizeExit(
uint64 roundHour
) external returns (uint256 sharesReturned, uint256 usdg);
Pays the part that was closed. The rest joins the vault again for sharesReturned.
| Parameter | Type |
|---|
roundHour | uint64 |
| Returns | Type |
|---|
sharesReturned | uint256 |
usdg | uint256 |
The series contract
chargeFee
function chargeFee(
uint256 seriesId,
uint256 rate,
int256 indexAtOpen
) external returns (int256 fundingIndex);
Charges the protocol fee of a series that ends, before its Yield is counted: rate of the rise of the index above the higher of indexAtOpen and the peak, for all shares. Lowers the index and the Funding Box by it. The peak becomes the index after the fee when that is higher.
| Parameter | Type |
|---|
seriesId | uint256 |
rate | uint256 |
indexAtOpen | int256 |
| Returns | Type | Description |
|---|
fundingIndex | int256 | After the fee. |
settleSeries
function settleSeries(
uint256 seriesId,
uint256 usdg
) external returns (uint256 sharesBurned);
Pays a series from the Funding Box and burns shares of the same value.
| Parameter | Type |
|---|
seriesId | uint256 |
usdg | uint256 |
| Returns | Type |
|---|
sharesBurned | uint256 |
The report oracle
applyReport
function applyReport(Report calldata report, bool exceptional) external;
Applies a report that passed every check. An exceptional report also makes the books equal to itself.
| Parameter | Type |
|---|
report | Report |
exceptional | bool |
setReportHold
function setReportHold(uint256 reason, bool active) external;
Sets or clears a hold that comes from the reports.
| Parameter | Type |
|---|
reason | uint256 |
active | bool |
Read
market
function market() external view returns (IGedhoMarket);
extension
function extension() external view returns (address);
Code of the functions that the vault does not have itself, except the wind-down.
windDownCode
function windDownCode() external view returns (address);
Code of the wind-down.
status
function status() external view returns (Status);
holdReasons
function holdReasons() external view returns (uint256);
Active reasons of a hold, including the ones that come from time and price.
book
function book() external view returns (Book memory);
nav
function nav() external view returns (int256);
Everything the shares own, in USDG.
sharePrice
function sharePrice() external view returns (uint256);
USD per share, 18 decimals, rounded down. Zero without shares, or when nothing is left for them.
fundingIndex
function fundingIndex() external view returns (int256);
Funding since the start for one share, USD with 18 decimals.
assetPrice
function assetPrice() external view returns (uint256);
Checked asset price, 8 decimals. Fails when it cannot be trusted.
simulateReport
function simulateReport(
Report calldata report
) external view returns (int256 shortSize, int256 cash, uint256 notional);
What a report should show: the books after its fills and funding. Fails when Chainlink is older than maxPriceAge.
| Returns | Type | Description |
|---|
shortSize | int256 | All books together, before the liquidated size. Negative when the fills do not fit a book. |
cash | int256 | Before the liquidated notional and any loss. |
notional | uint256 | Base of the tolerances, USDG: the larger short before and after the report, the liquidated size taken off. |
command
function command(uint256 commandId) external view returns (Command memory);
| Parameter | Type |
|---|
commandId | uint256 |
openCommands
function openCommands() external view returns (uint256[] memory);
baseStatus
function baseStatus() external view returns (Status);
State without holds: Normal, NoShort, Emergency or WindDown.
readyForSeries
function readyForSeries() external view returns (bool);
A completely filled reset, or first opening at 2x, came after the last settlement, no command or round is open, and the asset is within 5% of the price at which the books are at 2x. False without a good price.
seededAt
function seededAt() external view returns (uint64);
When seed() was called, zero before.
isOperator
function isOperator(address account) external view returns (bool);
| Parameter | Type |
|---|
account | address |
equity
function equity() external view returns (int256);
Value of the short at the current price: collateral, profit or loss, adjustment.
effectiveSupply
function effectiveSupply() external view returns (uint256);
Shares that own the books: total supply without shares leaving in the open round.
marginRatio
function marginRatio() external view returns (int256);
Equity over the value of the short, 1e18 is 100%. The largest number without a short.
referencePrice
function referencePrice() external view returns (uint256);
Asset price at which the books are at 2x, 8 decimals. Zero without a short.
lostShortAt
function lostShortAt() external view returns (uint64);
When the asset lost its short. A later reopening that fails does not change it. Zero when the asset matches.
positionHeldSince
function positionHeldSince() external view returns (uint64);
When the hold for a difference between the asset and the short began, zero without it.
ticket
function ticket(
uint256 ticketId
) external view returns (WithdrawalTicket memory);
| Parameter | Type |
|---|
ticketId | uint256 |
fees
function fees(
) external view returns (uint256 cash, uint256 receivable, int256 peak);
Protocol fee in the vault and at Lighter, and the peak of the funding index above which the next fee is charged.
| Returns | Type |
|---|
cash | uint256 |
receivable | uint256 |
peak | int256 |
roundBooks
function roundBooks(
) external view returns (Book memory entry, Book memory leaving);
Books of the part of the open round that enters or leaves.
totalSent
function totalSent() external view returns (uint256);
totalReceived
function totalReceived() external view returns (uint256);
lighterAccount
function lighterAccount() external view returns (uint48);
codec
function codec() external view returns (address);
windDownPerShare
function windDownPerShare() external view returns (uint256 usdg, uint256 asset);
Earned by one share in the wind-down: USD with 18 decimals, and the smallest unit of the asset per 1e18 shares with 18 more decimals.
| Returns | Type |
|---|
usdg | uint256 |
asset | uint256 |
Events
StatusChanged
event StatusChanged(
Status indexed status,
Status indexed baseStatus,
uint256 holdReasons
);
| Parameter | Type |
|---|
status (indexed) | Status |
baseStatus (indexed) | Status |
holdReasons | uint256 |
BookUpdated
event BookUpdated(
Book book,
int256 fundingIndex,
uint256 supply,
uint256 assetPrice
);
The books of the vault after a change. assetPrice is zero without a good price.
| Parameter | Type |
|---|
book | Book |
fundingIndex | int256 |
supply | uint256 |
assetPrice | uint256 |
FundingApplied
event FundingApplied(
uint64 indexed hour,
int256 funding,
int256 vaultFunding,
int256 index
);
| Parameter | Type |
|---|
hour (indexed) | uint64 |
funding | int256 |
vaultFunding | int256 |
index | int256 |
CostCharged
event CostCharged(uint256 indexed commandId, uint256 cost, uint256 fromBox);
| Parameter | Type |
|---|
commandId (indexed) | uint256 |
cost | uint256 |
fromBox | uint256 |
Liquidated
event Liquidated(
uint64 indexed time,
uint256 size,
uint256 notional,
uint256 loss
);
| Parameter | Type |
|---|
time (indexed) | uint64 |
size | uint256 |
notional | uint256 |
loss | uint256 |
ReportApplied
event ReportApplied(
uint64 indexed number,
uint64 indexed time,
uint256 shortSize,
int256 cash,
uint256 depositsCredited,
uint256 withdrawalsExecuted
);
The values of an accepted report.
| Parameter | Type |
|---|
number (indexed) | uint64 |
time (indexed) | uint64 |
shortSize | uint256 |
cash | int256 |
depositsCredited | uint256 |
withdrawalsExecuted | uint256 |
BookReconciled
event BookReconciled(
uint64 indexed number,
int256 shortDelta,
int256 cashDelta
);
An exceptional report made the books equal to itself.
| Parameter | Type |
|---|
number (indexed) | uint64 |
shortDelta | int256 |
cashDelta | int256 |
RoundBooksUpdated
event RoundBooksUpdated(Book entry, Book leaving);
The books of the open round after a change.
CommandIssued
event CommandIssued(
uint256 indexed commandId,
CommandKind indexed kind,
bool opensShort,
uint256 size,
bool sellsAsset,
uint256 assetLimit,
uint64 deadline
);
| Parameter | Type |
|---|
commandId (indexed) | uint256 |
kind (indexed) | CommandKind |
opensShort | bool |
size | uint256 |
sellsAsset | bool |
assetLimit | uint256 |
deadline | uint64 |
CommandFilled
event CommandFilled(
uint256 indexed commandId,
uint256 size,
uint256 notional,
bool done
);
| Parameter | Type |
|---|
commandId (indexed) | uint256 |
size | uint256 |
notional | uint256 |
done | bool |
CommandFinished
event CommandFinished(uint256 indexed commandId);
| Parameter | Type |
|---|
commandId (indexed) | uint256 |
CommandCut
event CommandCut(uint256 indexed commandId, uint64 deadline);
A protection ended the command early.
| Parameter | Type |
|---|
commandId (indexed) | uint256 |
deadline | uint64 |
Swapped
event Swapped(
uint256 indexed commandId,
bool soldAsset,
uint256 asset,
uint256 usdg,
uint256 assetPrice
);
Trade of the asset. commandId is zero in a wind-down and after a lost short.
| Parameter | Type |
|---|
commandId (indexed) | uint256 |
soldAsset | bool |
asset | uint256 |
usdg | uint256 |
assetPrice | uint256 |
EntryStarted
event EntryStarted(
uint64 indexed roundHour,
uint256 usdg,
uint256 asset,
uint256 value
);
| Parameter | Type |
|---|
roundHour (indexed) | uint64 |
usdg | uint256 |
asset | uint256 |
value | uint256 |
EntryFinished
event EntryFinished(
uint64 indexed roundHour,
uint256 shares,
uint256 refundUsdg,
uint256 refundAsset
);
| Parameter | Type |
|---|
roundHour (indexed) | uint64 |
shares | uint256 |
refundUsdg | uint256 |
refundAsset | uint256 |
ExitStarted
event ExitStarted(uint64 indexed roundHour, uint256 shares);
| Parameter | Type |
|---|
roundHour (indexed) | uint64 |
shares | uint256 |
ExitFinished
event ExitFinished(
uint64 indexed roundHour,
uint256 sharesBurned,
uint256 usdg
);
| Parameter | Type |
|---|
roundHour (indexed) | uint64 |
sharesBurned | uint256 |
usdg | uint256 |
SeriesPaid
event SeriesPaid(uint256 indexed seriesId, uint256 usdg, uint256 sharesBurned);
| Parameter | Type |
|---|
seriesId (indexed) | uint256 |
usdg | uint256 |
sharesBurned | uint256 |
FeeCharged
event FeeCharged(
uint256 indexed seriesId,
uint256 fee,
uint256 fromCash,
int256 fundingIndex
);
The protocol fee of a series at its settlement. fromCash was in the vault, the rest is at Lighter. Not emitted without a fee.
| Parameter | Type |
|---|
seriesId (indexed) | uint256 |
fee | uint256 |
fromCash | uint256 |
fundingIndex | int256 |
FeeSent
event FeeSent(address indexed treasury, uint256 amount);
| Parameter | Type |
|---|
treasury (indexed) | address |
amount | uint256 |
CollateralDeposited
event CollateralDeposited(uint256 amount, uint256 totalSent);
| Parameter | Type |
|---|
amount | uint256 |
totalSent | uint256 |
WithdrawalRequested
event WithdrawalRequested(
uint256 indexed ticketId,
WithdrawalPurpose indexed purpose,
uint256 ref,
uint256 amount
);
| Parameter | Type |
|---|
ticketId (indexed) | uint256 |
purpose (indexed) | WithdrawalPurpose |
ref | uint256 |
amount | uint256 |
WithdrawalRefused
event WithdrawalRefused(uint256 indexed ticketId, uint256 amount);
Lighter refused the request. The ticket stays open.
| Parameter | Type |
|---|
ticketId (indexed) | uint256 |
amount | uint256 |
WithdrawalReceived
event WithdrawalReceived(uint256 amount, uint256 totalReceived);
| Parameter | Type |
|---|
amount | uint256 |
totalReceived | uint256 |
TicketFilled
event TicketFilled(uint256 indexed ticketId, uint256 amount, bool complete);
| Parameter | Type |
|---|
ticketId (indexed) | uint256 |
amount | uint256 |
complete | bool |
TicketConverted
event TicketConverted(
uint256 indexed fromTicket,
uint256 indexed toTicket,
uint256 amount
);
Part of a funding ticket now pays a series.
| Parameter | Type |
|---|
fromTicket (indexed) | uint256 |
toTicket (indexed) | uint256 |
amount | uint256 |
OperatorAdded
event OperatorAdded(
address indexed operator,
uint8 indexed apiKeySlot,
bytes publicKey
);
| Parameter | Type |
|---|
operator (indexed) | address |
apiKeySlot (indexed) | uint8 |
publicKey | bytes |
OperatorRevoked
event OperatorRevoked(address indexed operator, uint8 indexed apiKeySlot);
| Parameter | Type |
|---|
operator (indexed) | address |
apiKeySlot (indexed) | uint8 |
KeyRemovalSent
event KeyRemovalSent(uint8 indexed apiKeySlot, bool accepted);
Lighter took the command to remove a key, or refused it.
| Parameter | Type |
|---|
apiKeySlot (indexed) | uint8 |
accepted | bool |
CodecChanged
event CodecChanged(
address indexed oldCodec,
address indexed newCodec,
address target
);
| Parameter | Type |
|---|
oldCodec (indexed) | address |
newCodec (indexed) | address |
target | address |
WindDownStarted
event WindDownStarted(bool lighterStopped, uint256 supply);
| Parameter | Type |
|---|
lighterStopped | bool |
supply | uint256 |
WindDownReceived
event WindDownReceived(
uint256 usdg,
uint256 asset,
uint256 usdgPerShare,
uint256 assetPerShare
);
| Parameter | Type |
|---|
usdg | uint256 |
asset | uint256 |
usdgPerShare | uint256 |
assetPerShare | uint256 |
WindDownClaimed
event WindDownClaimed(
address indexed owner,
uint256 shares,
uint256 usdg,
uint256 asset
);
| Parameter | Type |
|---|
owner (indexed) | address |
shares | uint256 |
usdg | uint256 |
asset | uint256 |
Errors
NotOperator
The caller is not an active operator.
NotQueue
Only the queue can call this.
NotSeries
Only the series contract can call this.
NotOracle
Only the report oracle can call this.
StatusForbids
error StatusForbids(Status status);
The status does not allow this.
ReportNotFresh
error ReportNotFresh(uint64 lastHour);
The last hourly report is not of the current hour.
| Parameter | Type |
|---|
lastHour | uint64 |
PriceStale
error PriceStale(uint256 updatedAt);
Chainlink gave no price, or an old one.
| Parameter | Type |
|---|
updatedAt | uint256 |
PriceDeviates
error PriceDeviates(uint256 chainlink, uint256 pool);
Chainlink and the pool differ too much.
| Parameter | Type |
|---|
chainlink | uint256 |
pool | uint256 |
PriceBelowTrigger
error PriceBelowTrigger(uint256 price, uint256 trigger);
The asset has not risen enough for this.
| Parameter | Type |
|---|
price | uint256 |
trigger | uint256 |
RiseNotSustained
error RiseNotSustained(uint80 roundId);
Reports arrive, and the round given was not in force 30 minutes ago or is too low.
| Parameter | Type |
|---|
roundId | uint80 |
OperatorNotSilent
error OperatorNotSilent(uint64 lastHour);
The last valid report is too recent for this.
| Parameter | Type |
|---|
lastHour | uint64 |
AlreadyTriggered
error AlreadyTriggered();
This protection was already used and is not settled yet.
CommandOpen
error CommandOpen(uint256 commandId);
Another command must finish first.
| Parameter | Type |
|---|
commandId | uint256 |
CommandUnknown
error CommandUnknown(uint256 commandId);
The command does not exist, or is finished.
| Parameter | Type |
|---|
commandId | uint256 |
CommandNotReported
error CommandNotReported(uint256 commandId);
Reports have not settled the command.
| Parameter | Type |
|---|
commandId | uint256 |
TooCloseToHour
The next hour is too close to start a command.
AboveLimit
error AboveLimit(uint256 limit);
The trade is larger than the command allows.
| Parameter | Type |
|---|
limit | uint256 |
AssetTradeIncomplete
error AssetTradeIncomplete(uint256 missing);
The asset trade of the command is not complete.
| Parameter | Type |
|---|
missing | uint256 |
error PriceTooLow(uint256 received, uint256 minimum);
The result is below the minimum.
| Parameter | Type |
|---|
received | uint256 |
minimum | uint256 |
SeriesActive
A series is open or not fully paid.
BoxTooSmall
error BoxTooSmall(int256 box);
The payment is larger than the Funding Box.
LighterStopped
Lighter stopped for good.
BadApiKeySlot
error BadApiKeySlot(uint8 slot);
The API key slot cannot be used.
NotSubaccount
error NotSubaccount(uint48 accountIndex);
The account is the main account of the vault.
| Parameter | Type |
|---|
accountIndex | uint48 |
RoundOpen
error RoundOpen(uint64 hour);
A round is executing.
CapitalMissing
error CapitalMissing(uint256 missing);
Money that the command needs has not arrived from Lighter.
| Parameter | Type |
|---|
missing | uint256 |
NothingToDo
There is nothing to do.
CodecMisbehaved
A command built by the codec changed a balance, or has a forbidden target.
WrongMarket
error WrongMarket(address market);
The codec builds orders of another market.
| Parameter | Type |
|---|
market | address |
OperatorExists
The address or slot is already used.
WindDownNotAllowed
error WindDownNotAllowed();
The wind-down conditions are not met.
AssetShared
The asset of the wind-down is shared now, not sold.
AlreadySeeded
The seed was already deposited.
NotVault
This code only runs at the address of its vault.
WrongExtension
error WrongExtension(address extension);
A contract of its code is of another vault, or was built with other values.
| Parameter | Type |
|---|
extension | address |
WrongPool
error WrongPool(address pool);
The router and the factory would trade in another pool than the one of the market.