> For the complete documentation index, see [llms.txt](https://docs.looputo.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.looputo.xyz/technical/roles-and-permissions.md).

# Roles and Permissions

Roles and permissions across the Looputo contracts.

The protocol uses a role-based access control system to update pool parameters, keep user positions solvent, and upgrade the contracts.

**FACTORY OWNER (Protocol Admin)**\
**Callable by:** Admin Multisig (3-of-5)\
**Description:** Deploys new pools and sets risk, fee, and routing parameters on every pool. The Factory is the `owner` of each pool, so all pool-level `onlyOwner` functions are reachable only through the Factory.\
**Functions:**

* `Factory::createLoopPool`\
  Deploys a new `BeaconProxy` pool for a given protocol id and runs its `initialize` call
* `Factory::setBeacon`\
  Sets the beacon used for a protocol id
* `Factory::setSystemTargetLTV`\
  Sets the pool-wide LTV ceiling enforced after every position action
* `Factory::setPositionMaxLTV`\
  Sets the per-user LTV ceiling
* `Factory::setCap`\
  Sets the maximum pool net equity, denominated in the debt token
* `Factory::setFeeConfiguration`\
  Sets the fee collector address, the open-position fee, and the close-position fee
* `Factory::setKeeper`\
  Sets the keeper address
* `Factory::setFlashloanFeePercentage`\
  Sets the flash-loan fee percentage
* `Factory::setAggregator`\
  Adds or removes a DEX aggregator router from the allowlist; removal also revokes the router's token approvals
* `Factory::transferOwnership`\
  Transfers ownership to a new owner

**KEEPER**\
**Callable by:** Keeper bot\
**Description:** Manages system leverage for risk control. The keeper deleverage and releverage to protect user positions from liquidation and negative carry. It is one address per pool and is rotated by the Factory owner.\
**Functions:**

* `LoopPool::deleverage`\
  Deleverage for a chosen set of positions, burning shares pro rata
* `LoopPool::releverage`\
  Releverage for a chosen set of positions, minting shares pro rata

Both functions must leave the pool under `systemTargetLTV` and each touched position under `positionMaxLTV`. Tokens moved during these operations are repaid to the lending market or re-supplied as collateral inside the same transaction and never leave the pool.

**BEACON OWNER (Upgrade Admin)**\
**Callable by:** 48h Timelock\
**Description:** Upgrades the implementation that all pools of a protocol type execute. `LoopPoolBeacon` is an unmodified OpenZeppelin `UpgradeableBeacon`; one beacon exists per underlying protocol.\
**Functions:**

* `LoopPoolBeacon::upgradeTo`\
  Updates current implementation to a new implementation
* `LoopPoolBeacon::transferOwnership`\
  Transfer ownership to a new owner
