All files / database seed.js

0% Statements 0/19
0% Branches 0/2
0% Functions 0/2
0% Lines 0/19

Press n or j to go to the next uncovered block, b, p or k for the previous block.

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                                                                                                                                                                                                                                                                                                                                                                                                                               
const { Strategy } = require('../models');
const logger = require('../utils/logger');
 
async function seedStrategies() {
  const strategies = [
    {
      name: 'Arbitrage Trading',
      slug: 'arbitrage',
      description: 'Exploit price differences across multiple exchanges for consistent profits',
      type: 'arbitrage',
      riskLevel: 'medium',
      minInvestment: 100,
      expectedReturn: {
        min: 8,
        max: 15,
        average: 12
      },
      fees: {
        management: 0.02,
        performance: 0.20
      },
      supportedChains: ['ethereum', 'bsc', 'polygon'],
      supportedTokens: ['ETH', 'BTC', 'USDC', 'USDT'],
      isActive: true,
      isPremium: false
    },
    {
      name: 'Flash Loan Strategy',
      slug: 'flashloan',
      description: 'Leverage uncollateralized loans for maximum capital efficiency',
      type: 'flashloan',
      riskLevel: 'high',
      minInvestment: 1000,
      expectedReturn: {
        min: 15,
        max: 30,
        average: 22.5
      },
      fees: {
        management: 0.02,
        performance: 0.20
      },
      supportedChains: ['ethereum', 'polygon', 'arbitrum'],
      supportedTokens: ['ETH', 'WBTC', 'USDC', 'DAI'],
      isActive: true,
      isPremium: true
    },
    {
      name: 'MEV Extraction',
      slug: 'mev',
      description: 'Extract maximum extractable value from blockchain transactions',
      type: 'mev',
      riskLevel: 'high',
      minInvestment: 500,
      expectedReturn: {
        min: 20,
        max: 50,
        average: 35
      },
      fees: {
        management: 0.02,
        performance: 0.20
      },
      supportedChains: ['ethereum'],
      supportedTokens: ['ETH', 'WBTC', 'USDC'],
      isActive: true,
      isPremium: true
    },
    {
      name: 'Auto Trading',
      slug: 'autotrading',
      description: 'AI-powered automated trading based on technical indicators',
      type: 'autotrading',
      riskLevel: 'medium',
      minInvestment: 100,
      expectedReturn: {
        min: 10,
        max: 25,
        average: 17.5
      },
      fees: {
        management: 0.02,
        performance: 0.20
      },
      supportedChains: ['ethereum', 'bsc', 'polygon', 'arbitrum'],
      supportedTokens: ['ETH', 'BTC', 'SOL', 'USDC'],
      isActive: true,
      isPremium: false
    },
    {
      name: 'Grid Trading Bot',
      slug: 'grid',
      description: 'Profit from range-bound markets with automated grid orders',
      type: 'grid',
      riskLevel: 'low',
      minInvestment: 100,
      expectedReturn: {
        min: 5,
        max: 12,
        average: 8.5
      },
      fees: {
        management: 0.02,
        performance: 0.20
      },
      supportedChains: ['ethereum', 'bsc', 'polygon'],
      supportedTokens: ['ETH', 'BTC', 'USDC'],
      isActive: true,
      isPremium: false
    },
    {
      name: 'DCA Bot',
      slug: 'dca',
      description: 'Dollar-cost averaging for long-term investment strategies',
      type: 'dca',
      riskLevel: 'low',
      minInvestment: 50,
      expectedReturn: {
        min: 3,
        max: 8,
        average: 5.5
      },
      fees: {
        management: 0.02,
        performance: 0.15
      },
      supportedChains: ['ethereum', 'bsc', 'polygon', 'arbitrum'],
      supportedTokens: ['ETH', 'BTC', 'SOL', 'AVAX'],
      isActive: true,
      isPremium: false
    },
    {
      name: 'Copy Trading',
      slug: 'copytrading',
      description: 'Follow and replicate trades from successful traders',
      type: 'copytrading',
      riskLevel: 'medium',
      minInvestment: 200,
      expectedReturn: {
        min: 8,
        max: 20,
        average: 14
      },
      fees: {
        management: 0.02,
        performance: 0.25
      },
      supportedChains: ['ethereum', 'bsc'],
      supportedTokens: ['ETH', 'BTC', 'USDC'],
      isActive: true,
      isPremium: true
    },
    {
      name: 'Pump.fun Sniper',
      slug: 'sniper',
      description: 'Snipe new token launches on Solana Pump.fun platform',
      type: 'sniper',
      riskLevel: 'high',
      minInvestment: 100,
      expectedReturn: {
        min: 50,
        max: 500,
        average: 150
      },
      fees: {
        management: 0.02,
        performance: 0.30
      },
      supportedChains: ['solana'],
      supportedTokens: ['SOL'],
      isActive: true,
      isPremium: true
    }
  ];
 
  try {
    for (const strategy of strategies) {
      await Strategy.findOrCreate({
        where: { slug: strategy.slug },
        defaults: strategy
      });
    }
    logger.info('Strategies seeded successfully');
  } catch (error) {
    logger.error('Error seeding strategies:', error);
    throw error;
  }
}
 
async function seed() {
  try {
    logger.info('Starting database seed...');
    await seedStrategies();
    logger.info('Database seeded successfully');
    process.exit(0);
  } catch (error) {
    logger.error('Database seed failed:', error);
    process.exit(1);
  }
}
 
if (require.main === module) {
  seed();
}
 
module.exports = { seed, seedStrategies };