# Transaction policy

## Transaction Policy Features Overview

### Introduction

The Transaction Policy (TP) module ensures secure and customizable transaction controls for users by integrating features like whitelisting and time delays.

***

### Core Features

* Enable/disable transaction policies (TP).
* Customize transaction behavior for whitelisted and non-whitelisted addresses.

***

### Time Limitations & Whitelisting

#### Time Limitations

* **Whitelisted**: Immediate.
* **Non-whitelisted**: Pre-set delay (e.g., 12, 24, 48 hours, etc.).

#### Whitelisting

* **Non-whitelisted Addresses**:
  * Time delay according to the pre-set to be whitelisted.
  * Time delay according to the pre-set for a one-time transaction.
* **Whitelisted Addresses**:
  * Instant transactions.

***

## Transaction Policy – Amount Limitations

### Overview

Like bank transaction limits, the Transaction Policy offers to secure your account with preset daily and per-transaction limits.

### Definitions and Behaviors

This section defines how the daily and per-transaction limits behave from the user's perspective.

**Note:** The terms _security delay_ and _whitelisting process_ refer to the same concept and are used interchangeably throughout this document.

#### Global and Address Scopes

Transaction limits can be applied in two scopes:

* **Global Scope:**\
  A limit that applies universally across all addresses.
* **Single Address Scope:**\
  A limit that applies only to the corresponding address.

#### Two Types of Limits

For each scope, there are two distinct limits:

* **Daily Limit:**\
  The maximum amount that can be sent during the past 24-hour period.
* **Per Transaction Limit:**\
  The maximum amount that can be sent in a single transaction.

#### Relationships between Limits and Scopes

The following rules apply, similar to traditional bank transaction limits:

* **Scope Hierarchy:**
  * Limits set on a single address should be less than or equal to the corresponding global limits.
* **Limit Comparisons:**
  * The per transaction limit should be less than or equal to the daily limit within the same scope.
  * Each scope includes both a daily and a per transaction limit.

In particular, the rules translate to the following relationships:

* A single address's per transaction limit should be less than or equal to the global per transaction limit.
* A single address's daily limit should be less than or equal to the global daily limit.
* The global per transaction limit should be less than or equal to the global daily limit.
* A single address's per transaction limit should be less than or equal to its own daily limit.

_Note: The rules do not consider the sum of all single address limits together._

#### Examples of Valid and Invalid Settings

**Valid Settings #1 ✅**

* **Global Limits:**
  * Daily Limit: $100,000
  * Per Transaction Limit: $50,000
* **Address Limits:**
  * **Address A:**
    * Daily Limit: $100,000
    * Per Transaction Limit: $50,000
  * **Address B:**
    * Daily Limit: $80,000
    * Per Transaction Limit: $30,000

**Valid Settings #2 ✅**

* **Global Limits:**
  * Daily Limit: $100,000
  * Per Transaction Limit: $100,000
* **Address Limits:**
  * **Address A:**
    * Daily Limit: $100,000
    * Per Transaction Limit: $100,000
  * **Address B:**
    * Daily Limit: $100,000
    * Per Transaction Limit: $80,000

**Invalid Settings #1 ❌**

* **Global Limits:**
  * Daily Limit: $100,000
  * Per Transaction Limit: $150,000\
    &#xNAN;_&#x49;ssue: The per transaction limit exceeds the daily limit._

**Invalid Settings #2 ❌**

* **Global Limits:**
  * Daily Limit: $100,000
  * Per Transaction Limit: $50,000
* **Address Limits:**
  * **Address A:**
    * Daily Limit: $100,000
    * Per Transaction Limit: $50,000
  * **Address B:**
    * Daily Limit: $180,000
    * Per Transaction Limit: $30,000\
      &#xNAN;_&#x49;ssue: Address B's daily limit exceeds the global daily limit._

#### Behavior When Setting an Amount Limit

* **Before Whitelisting:**\
  Prior to an address completing the security delay (whitelisting process), the user can set the amount limit following the rules above. An indicator displaying the global limit should be shown to assist the user—optionally with a "max" button to quickly apply the global limit.
* **After Whitelisting (When Increasing Limits):**\
  If the user increases the amount limit during or after the whitelisting process, the address must go through the security delay (whitelisting process) again. Conversely, reducing the limit does not require a security delay.
