Additional Functions
This section describes additional functions that provide flexibility and security when working with pools. These functions include cooldown, exit pool, and pool activation.
1. Cooldown Function
The cooldown function prevents assets from being withdrawn from the pool for a specified period after a deposit. This helps protect the pool from manipulation and ensures stability.
Implementation:
How It Works:
The user deposits assets via
deposit()
.The deposit timestamp is recorded in
depositTimestamps
.The user cannot withdraw assets via
unstake()
until the cooldown period (7 days) has passed.
2. Exit Pool Function
The exitPool
function allows users to withdraw their assets from the pool. The withdrawal takes a specified amount of time to ensure pool stability.
Implementation:
How It Works:
The user requests a withdrawal via
requestExit()
.After 3 days, the user can call
exitPool()
to complete the withdrawal.
3. Pool Activation
Pool activation is the time required for deposited assets to start generating yield. This may be due to technical limitations of external protocols.
Implementation:
How It Works:
The user deposits assets via
deposit()
.The activation timestamp is recorded in
activationTimestamps
.Assets start generating yield only after the activation period (1 day) has passed.
Security
Cooldown: Protects the pool from rapid asset withdrawals.
Withdrawal Delay: Ensures pool stability.
Activation: Accounts for technical limitations of external protocols.
This section of the documentation provides developers with a technical description of FlowDex's additional functions. Let me know if you need further clarification or additions!
Last updated