Delegation

In Kana Perps, we separate fund management from trading execution using a delegation model (optional). This architecture improves security, reduces wallet prompts, and enables features like one-click trading.

Overview

There are two account roles in this model:

  • Main Wallet: Custodian of funds. Only used for deposits and withdrawals.

  • Delegate Account: Authorized to place/cancel orders and manage positions on behalf of the main wallet. Cannot withdraw funds.

The main wallet is only used for deposits and withdrawals, while the delegate account is used to place/cancel orders and close positions. This separation allows us to offer one-click trading in the frontend by avoiding repeated wallet confirmations for each trade action.

Account Roles and Capabilities

Action
Main Wallet
Delegate Account

Deposit Funds

βœ…

❌

Withdraw Funds

βœ…

❌

Place Orders

❌

βœ…

Cancel Orders

❌

βœ…

Close/Update Positions

❌

βœ…

Transfer Between Profiles

βœ…

❌

πŸ’‘ The delegate account cannot withdraw funds, ensuring user funds remain secure even if the delegate key is compromised.

Use Cases

This delegation setup is ideal for:

  • One-click trading (auto-signing trade ops)

  • Enabling bots or trading assistants with limited permissions

πŸ†š Delegated vs Non-Delegated Scripts

Use Case
Script Module

Trading via delegate account

delegated_scripts.move

Direct control (no delegate)

perpetual_scripts.move

Security Benefits

  • Fine-grained control (toggle, change, extend, remove)

  • Time-bounded delegation

  • Only one proxy per user

  • On-chain enforcement of delegation permissions

Implementation Notes

  • Delegation is established by the main wallet via an on-chain transaction.

  • Delegates can be added or removed at any time.

  • Delegated function are available on delegated_scripts while non delegated functions available on perpetual_scripts

  • All delegate actions are scoped and validated to ensure they cannot move funds.

⚠️ Always recommend users to review delegate permissions and rotate keys if suspicious activity is detected.

Last updated