A keeper's role in Perpetual Pools is to perform a maintenance task called upkeep. Pool upkeep is a contract call to trigger the rebalancing event. Because the pool contract is unable to perform the rebalance without this call, a keeper has to transact with the pool. Keepers need to be paid to perform upkeep so they transact with a keeper contract that determines the payment. See fees for more details. This is also the contract that triggers the rebalancing event.
Keepers can perform upkeep only if one hour has passed since the previous rebalance. The upkeep process occurs from 3.0 in the rebalancing flow detailed below.
A diagram of the rebalancing process for Perpetual Pools.
1.0 Trader deposits collateral into a Perpetual Pool. 2.0 Collateral accumulates into the pool contract. 3.0 Keepers trigger the keeper contract to begin the rebalance. 3.1a The pool contract asks the committer contract to verify the tokens past the time interval that qualify for minting, burning, or transfer. 3.1b The price feed is pulled from the oracle to inform rebalancing calculations. 3.1c The library calculates the rebalance. 4.0 Long and short tokens are minted and/or burned and the rebalance is complete.
Pool Factory High level: contains the logic determining pool parameters (both global and local). Local parameters include pool name, oracle wrapper, front running interval, update interval, leverage amount, and quote token. Global parameters include the fee taken by Tracer DAO.