forked from Junirezz/YieldVault-RWA
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtransactionThresholds.ts
More file actions
61 lines (56 loc) · 2.32 KB
/
Copy pathtransactionThresholds.ts
File metadata and controls
61 lines (56 loc) · 2.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/**
* Transaction confirmation security thresholds.
* These values determine when the confirmation modal highlights unusual values.
*
* Maintainers: Review and adjust these thresholds based on typical transaction
* patterns and risk tolerance. All thresholds must be confirmed and documented.
*/
/**
* Amount threshold above which a transaction is flagged as "unusual" in XLM equivalent.
*
* Derivation: Conservative estimate based on typical user transaction sizes.
* - Vault minimum deposit: typically 1-100 USDC
* - Whale deposit: 10,000+ USDC becomes suspicious without explicit confirmation
*
* Update: Modify based on median transaction size growth or risk appetite.
* Monitor via transaction analytics dashboard (planned feature).
*/
export const UNUSUAL_AMOUNT_THRESHOLD = 10000; // 10,000 XLM or USDC equivalent
/**
* Fee multiplier above which a transaction fee is flagged as "unusual".
*
* Derivation: Stellar base fee is 100 stroops (0.00001 XLM).
* Typical transaction fee: 1 base fee = 0.00001 XLM.
* Unusual threshold: 100x base fee = 5 base fees (above typical range).
*
* Why 5x: Protects against fee spike attacks and misconfigured fee estimates.
* Networks may spike fees during congestion; 5x allows room for spikes
* without being false-positive prone.
*
* Update: Monitor Stellar network fee patterns and adjust if baseline changes.
*/
export const UNUSUAL_FEE_MULTIPLIER = 5;
/**
* Known contract addresses allowed for transactions.
* Contract addresses not in this list trigger "unknown contract" warning.
*
* This is a security allowlist that grows as new strategies are deployed.
* Every new contract must be added here and released in a controlled PR.
*
* Format: { address: "CXXXX...", name: "Human Readable Name" }
*/
export const TRUSTED_CONTRACT_ADDRESSES: Record<string, string> = {
// Vault contract - must be set from environment variable
// Add deployed contracts here as new strategies launch
};
/**
* Stellar base fee in stroops (1 XLM = 10,000,000 stroops).
* Used to calculate UNUSUAL_FEE_MULTIPLIER threshold.
*
* Reference: https://developers.stellar.org/docs/learn/fundamentals/fees-and-limits
*/
export const STELLAR_BASE_FEE_STROOPS = 100; // 1 base fee in stroops
/**
* Stellar base fee in XLM for human-readable fee comparisons.
*/
export const STELLAR_BASE_FEE_XLM = 0.00001;