> ## Documentation Index
> Fetch the complete documentation index at: https://docs.credprotocol.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Engaging and Educating Users

> Help users understand and improve their on-chain financial behavior

Engaging and educating users is an important aspect of expanding access to DeFi products. By measuring and communicating on-chain financial behavior, protocols, wallets, and partners can help their users to better understand the products and services they're using and how they can benefit from them—leading to increased customer satisfaction and engagement, which can ultimately result in increased revenue.

## Why Engage and Educate?

<CardGroup cols={2}>
  <Card title="User Retention" icon="users">
    Engaged users stay longer and interact more with your product
  </Card>

  <Card title="Trust Building" icon="handshake">
    Education builds confidence and trust in your platform
  </Card>

  <Card title="Healthy Behavior" icon="heart">
    Guidance leads to better financial decisions and outcomes
  </Card>

  <Card title="Differentiation" icon="star">
    Stand out by providing value beyond basic functionality
  </Card>
</CardGroup>

***

## The Power of Credit Scores

As soon as people have a credit score, they often want to know how they can improve it. Users recognize that creditworthiness enables them to access financial products on beneficial terms, and they are looking for guidance on healthy behavior that can help them improve their credit scores.

This creates a natural engagement opportunity: provide users with their score, explain what it means, and guide them on how to improve it.

***

## Implementation Example

### Credit Score Dashboard

```javascript theme={null}
async function renderCreditDashboard(address) {
  const response = await fetch(
    `https://api.credprotocol.com/api/v2/score/address/${address}?include_factors=true`,
    { headers: { 'Authorization': `Bearer ${API_KEY}` } }
  );

  const { score, range, decile, factors } = await response.json();

  return {
    // Core score display
    score: {
      value: score,
      range: formatRange(range),
      percentile: `Top ${(10 - decile + 1) * 10}%`,
    },

    // Factor breakdown for education
    factors: factors.map(factor => ({
      name: factor.label,
      rating: factor.rating,
      description: factor.description,
      tips: getImprovementTips(factor.label, factor.rating),
    })),

    // Personalized recommendations
    recommendations: getRecommendations(factors),

    // Educational content
    education: getEducationalContent(range, factors),
  };
}

function formatRange(range) {
  const labels = {
    excellent: 'Excellent',
    very_good: 'Very Good',
    good: 'Good',
    fair: 'Fair',
    low: 'Needs Improvement',
  };
  return labels[range] || range;
}
```

### Improvement Tips by Factor

```javascript theme={null}
function getImprovementTips(factorLabel, rating) {
  const tips = {
    'Borrowing History': {
      low: [
        'Start with a small loan on a reputable lending protocol',
        'Make consistent, on-time repayments',
        'Avoid liquidations by monitoring your positions',
      ],
      medium: [
        'Continue your strong repayment history',
        'Consider diversifying across lending protocols',
        'Maintain positions well above liquidation thresholds',
      ],
      high: [
        'Your borrowing history is excellent—keep it up!',
        'Consider helping others learn responsible borrowing',
      ],
    },
    'Wallet Composition': {
      low: [
        'Diversify your holdings across different asset types',
        'Consider adding stablecoins to reduce volatility',
        'Avoid concentration in single tokens',
      ],
      medium: [
        'Good diversification—consider adding more stable assets',
        'Review your portfolio balance periodically',
      ],
      high: [
        'Excellent portfolio composition',
        'Your diversification strategy is working well',
      ],
    },
    'Wallet Health': {
      low: [
        'Increase your collateral ratios on open positions',
        'Reduce leverage to safer levels',
        'Monitor positions more frequently',
      ],
      medium: [
        'Consider adding buffer to your collateral',
        'Set up alerts for position health',
      ],
      high: [
        'Your positions are well-managed',
        'Great job maintaining healthy collateral ratios',
      ],
    },
    'Trust': {
      low: [
        'Register an ENS name to establish identity',
        'Complete Gitcoin Passport verification',
        'Participate in community events to earn POAPs',
      ],
      medium: [
        'Add more identity attestations',
        'Participate in governance to build reputation',
      ],
      high: [
        'Strong identity verification',
        'Your on-chain reputation is well-established',
      ],
    },
    'Interactions': {
      low: [
        'Explore reputable DeFi protocols',
        'Engage with established smart contracts',
        'Build transaction history over time',
      ],
      medium: [
        'Continue engaging with the ecosystem',
        'Try new protocols to broaden your activity',
      ],
      high: [
        'Excellent ecosystem engagement',
        'Your activity demonstrates strong participation',
      ],
    },
    'New Credit': {
      low: [
        'Avoid opening too many new positions at once',
        'Space out new borrowing activity',
        'Let recent positions mature before taking new ones',
      ],
      medium: [
        'Your recent credit activity is balanced',
        'Continue measured approach to new borrowing',
      ],
      high: [
        'Well-managed new credit activity',
        'Your approach to new positions is prudent',
      ],
    },
  };

  const factorTips = tips[factorLabel] || {};

  if (rating === 'Excellent' || rating === 'Very Good') return factorTips.high || [];
  if (rating === 'Good' || rating === 'Fair') return factorTips.medium || [];
  return factorTips.low || [];
}
```

***

## Educational Content

### Score Explainer Component

```javascript theme={null}
function getScoreExplainer(score) {
  if (score >= 920) {
    return {
      title: 'Excellent Credit',
      description: 'Your on-chain activity demonstrates exceptional financial responsibility. You have access to the best terms and products.',
      icon: 'trophy',
      color: 'green',
    };
  }
  if (score >= 840) {
    return {
      title: 'Very Good Credit',
      description: 'You have a strong credit profile with consistent positive behavior. Most products and favorable terms are available to you.',
      icon: 'star',
      color: 'blue',
    };
  }
  if (score >= 750) {
    return {
      title: 'Good Credit',
      description: 'Your credit profile is solid. You qualify for most standard products. Focus on the tips below to reach the next level.',
      icon: 'check-circle',
      color: 'teal',
    };
  }
  if (score >= 640) {
    return {
      title: 'Fair Credit',
      description: 'You\'re building your credit history. Follow the recommendations below to improve your score and unlock more opportunities.',
      icon: 'trending-up',
      color: 'yellow',
    };
  }
  return {
    title: 'Building Credit',
    description: 'Everyone starts somewhere. Follow our guidance to build a strong on-chain credit history and unlock DeFi opportunities.',
    icon: 'seedling',
    color: 'orange',
  };
}
```

### Educational Resources by Level

```javascript theme={null}
function getEducationalContent(range, factors) {
  const content = {
    excellent: {
      articles: [
        { title: 'Advanced Yield Strategies', url: '/learn/advanced-yield' },
        { title: 'Managing Large Positions', url: '/learn/large-positions' },
        { title: 'Cross-Chain Opportunities', url: '/learn/cross-chain' },
      ],
      tips: [
        'Consider sharing your knowledge with newer users',
        'Explore governance participation',
        'Look into advanced DeFi strategies',
      ],
    },
    very_good: {
      articles: [
        { title: 'Optimizing Your Portfolio', url: '/learn/portfolio-optimization' },
        { title: 'Understanding Liquidation Risk', url: '/learn/liquidation-risk' },
        { title: 'Earning with LP Positions', url: '/learn/liquidity-provision' },
      ],
      tips: [
        'Focus on maintaining your strong history',
        'Consider diversifying protocol exposure',
        'Monitor positions to avoid liquidations',
      ],
    },
    good: {
      articles: [
        { title: 'How Credit Scores Work', url: '/learn/credit-scores' },
        { title: 'Safe Borrowing Practices', url: '/learn/safe-borrowing' },
        { title: 'Building Trust On-Chain', url: '/learn/on-chain-trust' },
      ],
      tips: getWeakestFactorTips(factors),
    },
    fair: {
      articles: [
        { title: 'Getting Started with DeFi Lending', url: '/learn/defi-lending' },
        { title: 'Understanding Collateral', url: '/learn/collateral-basics' },
        { title: 'Your First Loan', url: '/learn/first-loan' },
      ],
      tips: getWeakestFactorTips(factors),
    },
    low: {
      articles: [
        { title: 'DeFi 101: The Basics', url: '/learn/defi-basics' },
        { title: 'Wallet Security Best Practices', url: '/learn/wallet-security' },
        { title: 'How to Build Credit On-Chain', url: '/learn/build-credit' },
      ],
      tips: [
        'Start with small, manageable positions',
        'Focus on learning before taking risks',
        'Build transaction history gradually',
      ],
    },
  };

  return content[range] || content.low;
}

function getWeakestFactorTips(factors) {
  // Find the weakest factor and return targeted tips
  const weakest = factors.reduce((min, factor) =>
    getRatingScore(factor.rating) < getRatingScore(min.rating) ? factor : min
  );

  return getImprovementTips(weakest.label, weakest.rating);
}

function getRatingScore(rating) {
  const scores = { 'Excellent': 5, 'Very Good': 4, 'Good': 3, 'Fair': 2, 'Low': 1 };
  return scores[rating] || 0;
}
```

***

## Engagement Features

### Progress Tracking

```javascript theme={null}
async function trackScoreProgress(address) {
  // Store historical scores (you'd implement your own storage)
  const history = await getScoreHistory(address);
  const currentScore = await getCurrentScore(address);

  const thirtyDaysAgo = history.find(h =>
    h.date >= Date.now() - 30 * 24 * 60 * 60 * 1000
  );

  return {
    current: currentScore,
    change30d: thirtyDaysAgo ? currentScore - thirtyDaysAgo.score : null,
    trend: calculateTrend(history),
    milestones: getMilestones(currentScore, history),
  };
}

function getMilestones(currentScore, history) {
  const milestones = [];
  const thresholds = [640, 750, 840, 920];

  for (const threshold of thresholds) {
    if (currentScore >= threshold) {
      const achievedDate = history.find(h => h.score >= threshold)?.date;
      milestones.push({
        threshold,
        label: getThresholdLabel(threshold),
        achieved: true,
        date: achievedDate,
      });
    } else {
      milestones.push({
        threshold,
        label: getThresholdLabel(threshold),
        achieved: false,
        pointsNeeded: threshold - currentScore,
      });
    }
  }

  return milestones;
}
```

### Gamification Elements

```javascript theme={null}
function getAchievements(score, report) {
  const achievements = [];

  // Score-based achievements
  if (score >= 920) achievements.push({ id: 'excellent', name: 'Credit Elite', icon: '🏆' });
  if (score >= 840) achievements.push({ id: 'very_good', name: 'Rising Star', icon: '⭐' });
  if (score >= 750) achievements.push({ id: 'good', name: 'On Track', icon: '✅' });

  // Activity-based achievements
  if (report.summary.count_repayments >= 10) {
    achievements.push({ id: 'repayer', name: 'Consistent Repayer', icon: '💪' });
  }
  if (report.summary.count_chains_with_activity >= 3) {
    achievements.push({ id: 'multichain', name: 'Chain Explorer', icon: '🌐' });
  }
  if (report.summary.count_identity_attestations >= 2) {
    achievements.push({ id: 'verified', name: 'Verified Identity', icon: '🔐' });
  }
  if (report.summary.count_liquidations === 0 && report.summary.count_active_loans > 0) {
    achievements.push({ id: 'safe', name: 'Safe Borrower', icon: '🛡️' });
  }

  return achievements;
}
```

***

## Safety and Risk Education

As the web3 and DeFi space is relatively new, guidance on how to engage with these products safely is important:

<AccordionGroup>
  <Accordion title="Managing Risks">
    * Never invest more than you can afford to lose
    * Understand liquidation thresholds before borrowing
    * Use stop-losses and position alerts
    * Diversify across protocols and chains
  </Accordion>

  <Accordion title="Evaluating Providers">
    * Check if protocols have been audited
    * Review TVL (Total Value Locked) as a trust signal
    * Look for established track records
    * Research the team and governance structure
  </Accordion>

  <Accordion title="Staying Secure">
    * Use hardware wallets for significant holdings
    * Never share your seed phrase
    * Verify contract addresses before interacting
    * Be wary of too-good-to-be-true yields
  </Accordion>
</AccordionGroup>

***

## Best Practices

<AccordionGroup>
  <Accordion title="Make it actionable">
    Don't just show a score—provide specific, actionable steps users can take to improve.
  </Accordion>

  <Accordion title="Celebrate progress">
    Acknowledge improvements and milestones to keep users engaged and motivated.
  </Accordion>

  <Accordion title="Be honest about limitations">
    If a user's score is low, be supportive rather than discouraging. Everyone can improve.
  </Accordion>

  <Accordion title="Update content regularly">
    As DeFi evolves, keep educational content current with new protocols and best practices.
  </Accordion>
</AccordionGroup>

***

## Related

<CardGroup cols={2}>
  <Card title="How It Works" icon="circle-question" href="/how-it-works">
    Learn about credit factors and scoring methodology
  </Card>

  <Card title="Personalizing Experiences" icon="sliders" href="/use-cases/personalizing-experiences">
    Tailor product experiences based on creditworthiness
  </Card>
</CardGroup>
