Position status logic
Last updated
Last updated
A position can have a status that is determined based on the statuses of DEFII. The position status is the state in which a user's deposit is, and the DEFII status is the state in which a user's deposit is in a specific DEFII.
The logic of the statuses is implemented in the StatusLogic.sol library.
There are the following statuses:
NOT_PROCESSING - the default status. A position has this status when no actions have been taken.
ENTERING - the status set during entry into DEFII. DEFII can remain in the ENTERING status for a significant period if cross-chain interactions are taking place. If at least one DEFII in the position is in the ENTERING status, entry, exit, and deposit in the notion token are not possible.
EXITING - the status set during the initiation of the exit from DEFII. If at least one DEFII in the position is in the EXITING status, entry, exit, and deposit in notion tokens are not possible.
PROCESSED - the status where funds have either been delivered to DEFII, and all necessary actions for earning interest have been completed, or funds have been withdrawn from DEFII and delivered to the Vault.
For a position, the following statements are relevant:
When all DEFII are in the NOT_PROCESSED state, the position also has the NOT_PROCESSED status.
If at least one DEFII has an ENTERING or EXITING status, the position is in the ENTERING or EXITING status, respectively.
When all DEFII transition to PROCESSED, the position status is reset to NOT_PROCESSING.