Skip to main content

Operators

Introduction

Operators represent a powerful generalization of the traditional token approval system in Euler, enabling users to delegate permissions to external contracts that can act on their behalf. This feature unlocks a wide range of advanced functionality, particularly for users who prefer to interact with the protocol through external interfaces or automated systems.

Understanding Operators

At its core, the operator system allows users to attach external contracts to act on behalf of their sub-accounts. This is more sophisticated than simple token approvals because it provides a way to delegate control of specific sub-accounts to external contracts. The system is designed to be flexible while maintaining security and control for the user.

Potential Features

The operator system enables several powerful capabilities that can be implemented to enhance the user experience and enable more sophisticated interactions with the protocol:

Automated Trading Strategies: Operators could be used to implement automated trading systems that execute trades based on predefined conditions. This could include features like stop-loss orders, take-profit targets, or trailing stops without requiring manual intervention.

Position Management: External contracts could be authorized to manage positions, enabling more complex strategies that might involve multiple steps or require precise timing. This would be particularly useful for professional traders or automated trading systems.

Risk Management: The system could support automated risk management features like dynamic collateral rebalancing, automated deleveraging during high volatility, or portfolio-wide stop-loss mechanisms.

Security Considerations

While the operator system provides powerful functionality, it's important to understand the security implications:

Binary Permissions: Operator permissions are binary - an operator either has full control over a sub-account or no control at all. This means users should carefully consider which sub-accounts they delegate to operators.

Emergency Controls: In case of security concerns, users can revoke operator permissions at any time. This provides an important safety mechanism if an operator's behavior becomes suspicious or if the user wants to regain full control of their positions.

Trust Requirements: Users should only grant operator permissions to contracts they trust and have thoroughly vetted. This is particularly important as operators have full control over the sub-accounts they're authorized to act on behalf of.

Best Practices

When using operators, consider these best practices:

Selective Delegation: Only delegate sub-accounts to operators when necessary, and consider using separate sub-accounts for different operators to maintain better control over your positions.

Regular Reviews: Periodically review your operator settings and revoke permissions for operators you no longer use or trust.

Use Reputable Services: When possible, use operators provided by well-known and trusted services that have been audited and have a track record of security.

Monitor Activity: Keep an eye on the actions taken by your operators to ensure they're behaving as expected.