Skip to main content

ExitPositions

Git Source ↗

Includes the common functionality for managing exit positions in queues

Functions

peek

Fetches the exit data from a mapping-based queue

function peek(mapping(address vault => DoubleEndedQueue.Bytes32Deque) storage exits, address vault)
internal
view
returns (uint160 positionTicket, uint96 shares);

Parameters

NameTypeDescription
exitsmapping(address vault => DoubleEndedQueue.Bytes32Deque)The mapping of exit queues
vaultaddressThe address of the vault

Returns

NameTypeDescription
positionTicketuint160The position ticket
sharesuint96The shares to be exited

push

Stores exit data in a mapping-based queue

function push(
mapping(address vault => DoubleEndedQueue.Bytes32Deque) storage exits,
address vault,
uint160 positionTicket,
uint96 shares,
bool front
) internal;

Parameters

NameTypeDescription
exitsmapping(address vault => DoubleEndedQueue.Bytes32Deque)The mapping of exit queues
vaultaddressThe address of the vault
positionTicketuint160The position ticket
sharesuint96The shares to be exited
frontboolWhether to insert the exit data at the front of the queue

pop

Removes and returns exit data from a mapping-based queue

function pop(mapping(address vault => DoubleEndedQueue.Bytes32Deque) storage exits, address vault)
internal
returns (uint160 positionTicket, uint96 shares);

Parameters

NameTypeDescription
exitsmapping(address vault => DoubleEndedQueue.Bytes32Deque)The mapping of exit queues
vaultaddressThe address of the vault

Returns

NameTypeDescription
positionTicketuint160The position ticket
sharesuint96The shares to be exited