-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
65 lines (52 loc) · 2.19 KB
/
index.js
File metadata and controls
65 lines (52 loc) · 2.19 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
#!/usr/bin/env node
/**
* Base Network DeFi Yield Scanner v2
* Filters for legitimate, sustainable yields
*/
const https = require('https');
const DEFI_LLAMA_YIELDS = 'https://yields.llama.fi/pools';
function fetchJSON(url) {
return new Promise((resolve, reject) => {
https.get(url, (res) => {
let data = '';
res.on('data', chunk => data += chunk);
res.on('end', () => resolve(JSON.parse(data)));
}).on('error', reject);
});
}
async function scanBaseYields() {
console.log('🔍 Base Network Yield Scanner v2\n');
console.log('Filtering for: TVL > $100k, APY 5-100%, established protocols\n');
const data = await fetchJSON(DEFI_LLAMA_YIELDS);
// Filter criteria for legitimate yields
const legitimatePools = data.data.filter(pool =>
pool.chain === 'Base' &&
pool.tvlUsd > 100000 && // Min $100k TVL
pool.apy > 5 && // Min 5% APY
pool.apy < 100 && // Max 100% (filter out IL traps)
['aave-v3', 'compound-v3', 'aerodrome', 'moonwell', 'beefy', 'uniswap-v3'].includes(pool.project)
);
legitimatePools.sort((a, b) => b.tvlUsd - a.tvlUsd); // Sort by TVL (safer)
console.log(`Found ${legitimatePools.length} legitimate pools\n`);
console.log('📊 SAFEST HIGH-YIELD POOLS (by TVL):\n');
console.log('APY | TVL | Protocol | Symbol');
console.log('-'.repeat(55));
legitimatePools.slice(0, 20).forEach(pool => {
const apy = pool.apy.toFixed(2).padStart(7);
const tvl = `$${(pool.tvlUsd / 1e6).toFixed(2)}M`.padStart(11);
const protocol = pool.project.padEnd(12);
console.log(`${apy}% | ${tvl} | ${protocol} | ${pool.symbol}`);
});
// Best risk-adjusted returns (high TVL + decent APY)
console.log('\n🏆 TOP 5 RISK-ADJUSTED PICKS:\n');
const riskAdjusted = legitimatePools
.filter(p => p.tvlUsd > 500000) // $500k+ TVL
.sort((a, b) => (b.apy * b.tvlUsd) - (a.apy * a.tvlUsd))
.slice(0, 5);
riskAdjusted.forEach((pool, i) => {
console.log(`${i+1}. ${pool.project}: ${pool.apy.toFixed(2)}% APY on $${(pool.tvlUsd/1e6).toFixed(2)}M TVL`);
console.log(` Symbol: ${pool.symbol}`);
});
return legitimatePools;
}
scanBaseYields().catch(console.error);