PowerPool
  • powerpool overview
    • PowerPool
      • PowerPool DAO Story
      • Value Proposition
      • Use Cases
      • CVP Token
      • Vision 2027
    • Blockchain Automation
      • Glossary
    • PowerAgent Stats
    • How to contribute
    • Contracts and Links
  • Power Agent
    • 🎯PowerAgent features
    • 🏛️Architecture
      • ℹ️Agent
      • ℹ️Keeper
      • ℹ️Job
        • Full Specification
    • 📜User Guides and Instructions
      • ❓I Want to Automate my Tasks
        • Job Registration Guide
      • ❓I Want to Become a Keeper
    • ℹ️Scenarios
    • ⌛Old Pages
      • Installation Guide (Old)
        • Prerequisites
        • DAppNode Installation
        • Registering in PowerAgent
        • Installing PowerAgent Package on DAppNode
        • Standalone Installation
        • Chain-specific configs
      • Keeper (Old)
        • Keeper Registration and Update
        • Keeper staking, withdrawal, and deactivation
          • Keeper activation and deactivation in PPAgentV2RANDAO
        • Keeper assignment and release in RanDAO realisation
      • Job (Old)
        • Job Registration & Update
        • Job funds deposition and withdrawal
      • Agent (old)
        • Page
        • Execution
      • Technical Implementation (Old)
        • Hooks and helper functions
        • Errors
        • Modifiers
          • Flags
      • Job Registration Guide (Old)
      • 📑Testnet Rules
      • Slashing
        • Copy of Slashing
      • Task Reward and Gas Compensation
        • Fees and income sources
        • Copy of Task Reward and Gas Compensation
  • PowerPool Incentives
    • PowerPool Points Program
  • Security
    • Bug Bounty
    • Security Audits
  • Research
    • Automation Networks Research
      • Approaches on Keeper Selection
      • On-chain Random Number Generation
      • Keeper Weighing
      • 🌊PowerPool & PowerAgent Automation Network
      • Value Proposition-PowerPool
    • PowerAgent v2.1
      • Keeper Selection
      • Hooks
  • Resources
    • Website
    • Twitter
    • Medium
    • Discord
    • Github
    • Telegram
    • Governance Voting
    • Governance Forum
  • Legacy & Deprecated
    • Index Products
      • $YLA: Yearn Lazy Ape
        • Invest (ZAP) in YLA with low fees
        • Instant YLA mint via USDC
        • $CVP Boost Program
        • Redeem YLA
        • YLA Onsen Liquidity Mining [deprecated]
      • $BSCDEFI: BSC DeFi Pool/Index
        • Guide: Mint $BSCDEFI with $BNB
        • Guide: Multi-Asset $BSCDEFI Mint
        • Guide: PancakeSwap LM Farming
        • Add $BSCDEFI to MetaMask.
        • Redeem $BSCDEFI
      • $ASSY: Aave, SushiSwap, Synthetix, and Yearn Index
        • $CVP Boost Program
        • Underlying Token Staking
      • $PIPT: PowerIndex Pool
      • $YETI: Yearn Ecosystem Index
      • Market Price vs Fair Value
      • About ZAP
    • CVP reward program
      • How to create a DCA flow in Partitura
Powered by GitBook
On this page
  • Before execution
  • After execution

Was this helpful?

  1. Research
  2. PowerAgent v2.1

Hooks

To prepare and finish the execution of the task by PowerAgent, helper functions are called. They may be changed in different realizations of PowerAgent.

Before execution

A slasher can try to execute the task if the assigned keeper has failed to do so.

The function beforeExecute(bytes32 jobKey, uint256 actualKeeperId_, uint256 binJob_) is the first statement in the execute function of the PowerAgent. It contains a set of checks for the slasher and reverts at any step with failed check, interrupting the execution function of the PowerAgent.

Checks

  • Slasher id

    If the caller is the currently assigned keeper, the checks are skipped, and the execution continues. Otherwise, all checks are performed. If the caller is neither a keeper nor a slasher, the function reverts.

  • Only next keeper

    For interval tasks, if the slasher has called the execution too early.

  • Slashing not initiated

    This job is not configured for slashing.

  • Too early for slashing

    For resolver jobs a certain block can be specified after which a negligent keeper can be slashed.

  • Only reserved slasher

    A reserved slasher can be assigned to the job. If so, only this slasher can execute the failed task.

If all checks have been passed, the execution continues.

After execution

function afterExecute(bytes32 jobKey, uint256 actualKeeperId_, uint256 binJob_) internal override is called after the execution has succeeded. If the caller was not a slasher, it simply releases the previous keeper and assigns a new keeper (see Keeper Selection).

If the caller was a slasher, the negligent keeper is slashed by the following formula:

  • uint256 dynamicSlashAmount = eKeeper.cvpStake * uint256(rdConfig.slashingFeeBps) / 10000

  • uint256 fixedSlashAmount = uint256(rdConfig.slashingFeeFixedCVP) * 1 ether

  • uint88 totalSlashAmount = uint88(fixedSlashAmount + dynamicSlashAmount)

The CVP stake of the failed keeper is reduced by this amount, and the CVP stake of the slasher which successfully executed the task is increased by this amount.

PreviousKeeper SelectionNextIndex Products

Last updated 1 year ago

Was this helpful?