> ## Documentation Index
> Fetch the complete documentation index at: https://blackswan-23965643.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Understanding BlackSwan Credit Scores and Trust Tiers

> BlackSwan credit scores are derived from real on-chain lending behavior. Learn what metrics make up a credit score and how tiers are assigned.

BlackSwan credit scores give lenders a reliable, trustless way to assess borrower risk without relying on off-chain identity or centralized data providers. Every score is computed entirely from verifiable on-chain lending activity, so any protocol or wallet can query and act on it in a permissionless way.

## Credit Score Components

When you query a wallet's credit score, BlackSwan returns a structured object with the following fields:

| Field             | Type    | Description                                     |
| ----------------- | ------- | ----------------------------------------------- |
| `trustRatio`      | integer | Core creditworthiness score, from 0 to 10,000   |
| `trustTier`       | string  | Letter grade derived from the Trust Ratio (A–E) |
| `currentApr`      | integer | Current borrowing APR in basis points           |
| `successfulLoans` | integer | Number of loans fully repaid on time            |
| `defaults`        | integer | Number of loans not repaid by the deadline      |

## Credit Tiers

Your `trustTier` is automatically assigned based on your `trustRatio`. Tiers are used by lenders and DeFi protocols to quickly classify borrower risk.

| Score Range | Tier | Meaning      |
| ----------- | ---- | ------------ |
| 9000–10000  | A    | Excellent    |
| 8000–8999   | B    | Good         |
| 7000–7999   | C    | Average      |
| 6000–6999   | D    | Building     |
| 0–5999      | E    | New or risky |

## Querying a Credit Score

You can fetch the full credit profile for any wallet — including trust ratio, tier, APR, and loan counts — using the BlackSwan SDK or REST API.

<CodeGroup>
  ```javascript JavaScript theme={null}
  import { BlackSwanClient } from "blackswan-sdk";

  const client = new BlackSwanClient({ apiKey: "YOUR_API_KEY" });

  const dashboard = await client.getCreditDashboard("0xYourWalletAddress");

  console.log("Trust Ratio:", dashboard.trustRatio);
  console.log("Trust Tier:", dashboard.trustTier);
  console.log("Current APR (bps):", dashboard.currentApr);
  console.log("Successful Loans:", dashboard.successfulLoans);
  console.log("Defaults:", dashboard.defaults);
  ```

  ```python Python theme={null}
  from blackswan import BlackSwanClient

  client = BlackSwanClient(api_key="YOUR_API_KEY")

  dashboard = client.get_credit_dashboard("0xYourWalletAddress")

  print("Trust Ratio:", dashboard["trustRatio"])
  print("Trust Tier:", dashboard["trustTier"])
  print("Current APR (bps):", dashboard["currentApr"])
  print("Successful Loans:", dashboard["successfulLoans"])
  print("Defaults:", dashboard["defaults"])
  ```

  ```bash REST theme={null}
  curl -X GET "https://api.blackswan.finance/v1/credit/0xYourWalletAddress" \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```
</CodeGroup>

**Example response:**

```json theme={null}
{
  "wallet": "0xYourWalletAddress",
  "trustRatio": 8450,
  "trustTier": "B",
  "currentApr": 750,
  "successfulLoans": 12,
  "defaults": 0
}
```

## Improving Your Credit Score

Improving your BlackSwan credit score is straightforward — it rewards consistent, responsible borrowing behavior over time.

<Steps>
  <Step title="Take small loans first">
    Start with modest loan amounts that are easy to repay. Early loans establish your on-chain credit history and form the foundation of your score.
  </Step>

  <Step title="Repay on time">
    Timely repayment is the most impactful action you can take. Each successful repayment strengthens your `trustRatio` and `successfulLoans` count.
  </Step>

  <Step title="Increase volume gradually">
    Once you have a repayment history, taking on larger loans — and repaying them — demonstrates growing creditworthiness and boosts your score further.
  </Step>

  <Step title="Avoid defaults">
    Defaults are recorded permanently on-chain and have the most significant negative impact on your score. See [How Loan Defaults Affect Credit](/concepts/default-handling) for recovery guidance.
  </Step>
</Steps>

<Warning>
  Defaults significantly decrease your Trust Ratio and can drop you into a lower trust tier, resulting in higher borrowing costs. There is no automatic recovery — you must rebuild your score through consistent repayments over time.
</Warning>
