-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathenv.example
More file actions
227 lines (176 loc) · 6.89 KB
/
Copy pathenv.example
File metadata and controls
227 lines (176 loc) · 6.89 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
# Enhanced Stellar Risk & Liquidity Management System
# Environment Configuration
# ==============================================
# NETWORK CONFIGURATION
# ==============================================
# Stellar Network
STELLAR_NETWORK=TESTNET
STELLAR_RPC_URL=https://soroban-testnet.stellar.org
HORIZON_URL=https://horizon-testnet.stellar.org
# Network Passphrase
STELLAR_NETWORK_PASSPHRASE="Test SDF Network ; September 2015"
# ==============================================
# SMART CONTRACTS
# ==============================================
# Risk Tier Management Contract
NEXT_PUBLIC_RISK_TIER_CONTRACT_ID=CBTYHTWNY3HP6TIZCYKI6HP47YWVZCKQTWAD7SEK7AAVGCWY2ZIB6GRQ
# Original Risk Score Contract (backward compatibility)
# Smart Wallet Factory (Passkey-Kit)
NEXT_PUBLIC_FACTORY_CONTRACT_ID=your_passkey_factory_contract_here
# ==============================================
# PASSKEY-KIT CONFIGURATION
# ==============================================
# Stellar Network Configuration for Passkey-Kit
NEXT_PUBLIC_RPC_URL=https://soroban-testnet.stellar.org
NEXT_PUBLIC_NETWORK_PASSPHRASE=Test SDF Network ; September 2015
# Launchtube API for gas sponsorship (server-side only)
NEXT_PUBLIC_LAUNCHTUBE_API_URL=https://api.launchtube.xyz
LAUNCHTUBE_JWT=your_launchtube_jwt_token_here
# Mercury Configuration (server-side only)
MERCURY_URL=https://test.mercurydata.app
MERCURY_JWT=your_mercury_jwt_token_here
# Passkey Configuration
NEXT_PUBLIC_PASSKEY_ENABLED=true
NEXT_PUBLIC_WEBAUTHN_ORIGIN=http://localhost:3000
# ==============================================
# BACKEND SERVICES
# ==============================================
# Redis Configuration (for liquidity monitoring)
REDIS_HOST=localhost
REDIS_PORT=6379
REDIS_PASSWORD=your_redis_password_here
# Liquidity Monitor Configuration
MONITORING_INTERVAL=300000
LIQUIDITY_API_PORT=3001
# ==============================================
# API ENDPOINTS
# ==============================================
# Internal APIs
NEXT_PUBLIC_API_BASE_URL=http://localhost:3000/api
NEXT_PUBLIC_LIQUIDITY_API_URL=http://localhost:3001
# External APIs
HORIZON_API_TIMEOUT=30000
RPC_API_TIMEOUT=15000
# ==============================================
# SECURITY & AUTHENTICATION
# ==============================================
# JWT Secret for backend authentication
JWT_SECRET=your_super_secure_jwt_secret_here
# API Rate Limiting
RATE_LIMIT_REQUESTS_PER_MINUTE=100
RATE_LIMIT_WINDOW_MS=60000
# ==============================================
# RISK ANALYSIS CONFIGURATION
# ==============================================
# Risk Score Calculation Parameters
RISK_WEIGHT_TX_COUNT=0.3
RISK_WEIGHT_TIME_INTERVAL=0.25
RISK_WEIGHT_ASSET_DIVERSITY=0.25
RISK_WEIGHT_AMOUNT_PATTERN=0.1
RISK_WEIGHT_NIGHT_RATIO=0.1
# TVL Tier Thresholds (in USD)
TIER_1_THRESHOLD=1000000
TIER_2_THRESHOLD=250000
TIER_3_THRESHOLD=0
# ==============================================
# DEVELOPMENT & DEBUGGING
# ==============================================
# Debug Flags
DEBUG_LIQUIDITY_MONITORING=false
DEBUG_RISK_CALCULATIONS=false
DEBUG_PASSKEY_OPERATIONS=false
DEBUG_CONTRACT_CALLS=false
# Performance Monitoring
ENABLE_PERFORMANCE_METRICS=true
METRICS_ENDPOINT=/api/metrics
# ==============================================
# PRODUCTION OVERRIDES
# ==============================================
# These will be overridden in production
NODE_ENV=development
NEXT_PUBLIC_ENVIRONMENT=development
# Production URLs (commented out for development)
# NEXT_PUBLIC_API_BASE_URL=https://your-production-domain.com/api
# NEXT_PUBLIC_LIQUIDITY_API_URL=https://liquidity-api.your-domain.com
# STELLAR_NETWORK=PUBLIC
# STELLAR_RPC_URL=https://soroban.stellar.org
# ==============================================
# FEATURE FLAGS
# ==============================================
# Enable/Disable Features
FEATURE_PASSKEY_WALLET=true
FEATURE_LIQUIDITY_MONITORING=true
FEATURE_RISK_TIER_SYSTEM=true
FEATURE_AUTO_RISK_ANALYSIS=true
FEATURE_LAUNCHTUBE_SPONSORSHIP=true
# Demo Mode Settings
DEMO_MODE=false
DEMO_POOLS_ONLY=false
# ==============================================
# EXTERNAL INTEGRATIONS
# ==============================================
# Price Feed APIs (for TVL calculation)
COINGECKO_API_KEY=your_coingecko_api_key_here
STELLAR_EXPERT_API_URL=https://api.stellar.expert
# Notification Services
WEBHOOK_URL=your_webhook_url_for_notifications
DISCORD_WEBHOOK_URL=your_discord_webhook_for_alerts
# ==============================================
# DOCUMENTATION & PRESENTATION
# ==============================================
# Links for methodology explanation
GOLDFINCH_DOCS_URL=https://docs.goldfinch.finance
MAPLE_DOCS_URL=https://docs.maple.finance
PASSKEY_KIT_DOCS_URL=https://docs.stellar.org/passkey-kit
GUESTBOOK_EXAMPLE_URL=https://github.com/stellar/guestbook-example
# ==============================================
# USAGE INSTRUCTIONS
# ==============================================
# 1. Copy this file to .env.local:
# cp .env.example .env.local
# 2. Fill in your actual values for:
# - Contract IDs (deploy contracts first)
# - Redis connection details
# - Launchtube sponsor account
# - API keys
# 3. For development, you can leave demo values
# 4. For production, ensure all security-sensitive
# values are properly configured
# ==============================================
# CONTRACT DEPLOYMENT COMMANDS
# ==============================================
# Deploy Risk Tier Contract:
# stellar contract deploy \
# --wasm risk_score/target/wasm32-unknown-unknown/release/risk_score.wasm \
# --source-account YOUR_ACCOUNT \
# --network testnet
# Generate TypeScript bindings:
# stellar contract bindings typescript \
# --network testnet \
# --source-account YOUR_ACCOUNT \
# --contract-id YOUR_CONTRACT_ID \
# --output-dir ./src/lib/generated
# ==============================================
# BACKEND SERVICE STARTUP
# ==============================================
# Start Redis:
# redis-server
# Start Liquidity Monitor:
# cd backend && npm start
# Start Next.js Frontend:
# npm run dev
# ==============================================
# RISK ORACLE (server-side only — NEVER prefix with NEXT_PUBLIC_)
# ==============================================
# The oracle re-derives each risk score from Horizon data the SERVER fetches and
# signs `admin_set_risk_tier` with the contract admin key. This is what stops a
# user from self-reporting an arbitrary score. Keep the secret out of the client
# bundle and out of git.
#
# Must match the address passed to the contract's one-time `initialize(admin)`.
RISK_TIER_CONTRACT_ID=CBTYHTWNY3HP6TIZCYKI6HP47YWVZCKQTWAD7SEK7AAVGCWY2ZIB6GRQ
RISK_ORACLE_SECRET_KEY=S...your_oracle_admin_secret...
RISK_ORACLE_PUBLIC_KEY=G...your_oracle_admin_public_key...
# Passkey smart wallet: canonical passkey-kit v1 smart-wallet WASM hash.
# Without this, passkeyWallet.js refuses to initialise (DEMO_MODE_DISABLED).
NEXT_PUBLIC_WALLET_WASM_HASH=fdefad64b96837147e1c333e51f537b696eab925e9f147e63d597c04e3c903f0