> ## Documentation Index
> Fetch the complete documentation index at: https://docs.perpetradex.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Keeper System

> How Perpetra decides which bots are allowed to trigger platform actions

Several things on Perpetra don't happen on their own, they need an outside bot to trigger them: matching two orders together, liquidating an unhealthy position, updating the funding rate, or pushing a fresh price. Perpetra keeps a whitelist of exactly which bots are allowed to do each of those things. That whitelist is what we call the keeper system.

<Note>
  Keepers never hold or control user funds. Being on the whitelist only lets a
  bot trigger an action that the platform would already allow, it doesn't give
  the bot any special power over anyone's money.
</Note>

## The four jobs a keeper can do

Each keeper is approved for one or more of these:

* **Matching**: submitting matched trades for settlement
* **Liquidating**: closing out positions that have become unhealthy
* **Funding**: updating the funding rate on schedule
* **Pricing**: pushing fresh prices for the platform to use

A single bot can be approved for more than one of these at once.

## How a check works

```mermaid theme={null}
flowchart LR
    A[Bot attempts a\nprivileged action] --> B{Is this bot on\nthe whitelist and\napproved for this job?}
    B -- Yes --> C[Action goes through]
    B -- No --> D[Action is rejected]
```

Every time a bot tries to do one of these privileged things, the platform checks two things first: is this bot currently active, and is it actually approved for this specific job. If either check fails, the action is blocked before anything else happens.

## Pausing a bot without losing its history

If a bot misbehaves or goes offline, it can be paused rather than deleted. Pausing stops it from triggering anything further, but its registration record, when it joined, what it was approved for, stays intact. It can be reactivated later without starting over. A bot's approved jobs can also be changed on their own, independent of pausing it.

## Keeping an eye on bot health

Every time a bot successfully triggers something, the platform records that it was active just now. This record can only be written by the platform itself, a bot can't fake its own activity log. That gives an easy signal for spotting a bot that's gone quiet: if it's still on the whitelist but hasn't done anything in a while, that's a sign something's wrong with that specific bot, not with Perpetra itself.
