Swan Network
English
  • Getting Started
    • Overview
    • Protocol Stack
      • Cross-chain Consensus Layer
      • Peer-to-peer (P2P) Network
      • Payment Channels
      • Service Discovery
      • Data Marketplace
      • Indexing and Caching Marketplace
      • Web3 Task Auction
      • Storage Layer
      • Computing Layer
      • CDN Layer
      • Economic System
        • Grants
        • Computing Jobs
        • Universal Basic Income (UBI)
        • Swan Provider Income
      • Token
      • Governance
        • Treasure DAO
      • Glossary
    • Contact Us
      • Social Accounts & Communities
      • Business Partnerships
    • FAQ
  • QuickStarts
    • Dive into QuickStarts
      • Swan Chain: Developing Smart Contracts with Go
  • Swan Storage Market
    • Overview
      • Swan Auction System
      • Reputation System
    • Key functionalities
      • Task Management
        • Create a New Task
        • Navigate Tasks
        • Update Tasks
        • Assign Tasks
      • My Profile
        • Register as a storage provider
      • Find Storage Providers
        • Storage Provider Details
      • Extend DataCap Terms Service
  • Swan IPFS Storage
    • Overview
      • Flink
    • Swan IPFS Storage User Guide
      • Networks
      • Setup MetaMask
    • Developer Quickstart
      • SDK
        • js MCS SDK
          • Prerequisites
          • Get Started
          • Bucket Storage
          • Onchain Storage
          • SDK JS Installation Tutorial Video
        • python MCS SDK
          • Quickstart
          • Bucket Storage
          • Onchain Storage
          • SDK Python Installation Tutorial Video
      • Additional Resources
    • Best Practice
      • Use Swan IPFS Storage as Platform Storage Solution
        • Single Organization Design
        • Multiple Organization Design
    • FAQ
  • Swan Provider
    • Overview
    • Features
    • Tutorial
      • Prerequisites
      • Installation
      • Configure and Run
      • Swan Provider Tutorial Video
    • FAQ
      • 1. Change the linked Email
      • 2. Check Storage Provider connectivity/stability
      • 3. How to stop accepting "auto-bid" deals?
      • 4. `aria2_download_dir` vs. `aria2_candidate_dirs`
      • 5. How to configure "import deals from Swan Provider" when Boostd is running normally
      • 6. A rejection msg always appears during the deal-importing process
      • 7. How to check if aria2 is running?
      • 8. No response from Swan Platform?
      • 9. Why Storage Provider status shows offline?
      • 10. How to check the Task Status?
      • 11. How to configure the Storage Provider Market?
      • 12. How to set the "ask price"?
      • 13.aria2_download_dir VS. aria2_candidate_dirs
      • 14. How to control the number of deals imported?
  • Swan Client
    • Overview
    • Basic Concepts
    • Tutorial
      • Filecoin Deal Sender
        • Installation
        • Configuration
        • Prerequisites
        • Generate CAR Files
        • Meta-CAR
        • Upload CAR Files to IPFS
        • Create a Task
      • Blockchain RPC Service
        • Deploy RPC Service
        • RPC Command Service
      • Swan Client Tutorial Video
    • FAQ
      • How to prepare data?
  • FS3
    • Overview
    • Setup your FS3
      • Prerequisites
      • Install FS3
      • FS3 Set up Video
    • FS3 User Guide
    • FS3 User Guide (Cloud Version)
  • Lagrange DAO
    • Overview
  • Development Resource
    • Swan Token Contract
      • Acquire Testnet USDC and MATIC tokens
    • Swan API
    • Swan IPFS Storage API
    • Swan IPFS Storage 2.0 API
    • Flink API
    • FS3 API
    • API keys
  • Swan Testnet
    • Swan Jupiter Testnet
      • How to Participate
      • Before You Get Started
      • Network Early Adopter
      • Computing Provider Setup
        • Prerequisites
        • Install the Kubernetes
        • Install and config the Nginx
        • Install the Hardware resource-exporter
        • Install the Redis service
        • Build and config the Computing Provider
        • Install AI Inference Dependency(Optional)
        • Start the Computing Provider
        • CLI of Computing Provider
        • FAQ
      • FAQ
Powered by GitBook
On this page

Was this helpful?

  1. Getting Started
  2. Protocol Stack
  3. Economic System

Swan Provider Income

1. Introduction

In the Swan decentralized computing ecosystem, providers earn income by executing jobs. Their income is influenced by various factors, including the number of jobs they execute, their reputation, and the Universal Basic Income (UBI) mechanism. This document outlines the mathematical model governing provider income in the Swan system.


2. Job Allocation to Nodes

Job distribution in the Swan system is done through an auction mechanism. However, the likelihood of a provider winning a job is influenced by their reputation. The job distribution engine follows a lambda distribution based on reputation scores.

Equation:

Pwin(R)=λ×e−λRP_{win}(R) = \lambda \times e^{-\lambda R}Pwin​(R)=λ×e−λR

Where:

  • ( P_{win}(R) ) = Probability of winning a job based on reputation ( R )

  • ( \lambda ) = Rate parameter (determined by the system)


3. Total Jobs in the System

The total number of jobs in the system grows according to the logistic growth curve:

Equation:

Jtotal(x)=Linitial1+e−kinitial×(x−x0initial) J_{total}(x) = \frac{L_{initial}}{1 + e^{-k_{initial} \times (x - x_{0_{initial}})}}Jtotal​(x)=1+e−kinitial​×(x−x0initial​​)Linitial​​

Where:

  • ( J_{total}(x) ) = Total number of jobs at time ( x )

  • ( L_{initial} ) = Carrying capacity for initial jobs (maximum number of jobs without incentives)

  • ( k_{initial} ) = Growth rate for initial jobs

  • ( x_{0_{initial}} ) = Midpoint of the growth curve, where growth is fastest


4. Base Income from Jobs

Providers earn a base income from executing jobs. This income is determined by the auction mechanism, where providers bid for jobs.

Equation:

Ibase(j)=Pj×NjI_{base}(j) = P_j \times N_j Ibase​(j)=Pj​×Nj​

Where:

  • ( I_{base}(j) ) = Income from job ( j )

  • ( P_j ) = Price bid for job ( j )

  • ( N_j ) = Number of instances of job ( j ) executed


5. Universal Basic Income (UBI)

Qualified providers receive a UBI. However, if a node has job income, the UBI is reduced by that amount. If the job income exceeds the average UBI, the UBI becomes zero.

Equation:

IUBI=U−min(Itotaljobs,U) I_{UBI} = U - min(I_{total_jobs}, U) IUBI​=U−min(Itotalj​obs​,U)

Where:

  • ( I_{UBI} ) = UBI income

  • ( U ) = Average UBI income

  • ( I_{total_jobs} ) = Total income from all jobs


6. Bonus from Reputation

Providers with higher reputations can earn more due to a higher likelihood of winning bids in the auction system.

Equation:

Ibonus(R)=λ×e−λRI_{bonus}(R) = \lambda \times e^{-\lambda R}Ibonus​(R)=λ×e−λR

Where:

  • ( I_{bonus}(R) ) = Bonus income based on reputation ( R )


7. Total Provider Income

The total income for a provider is the sum of the base income from jobs, the UBI, and any bonuses from reputation.

Equation:

Itotal=Ibase+IUBI+IbonusI_{total} = I_{base} + I_{UBI} + I_{bonus}Itotal​=Ibase​+IUBI​+Ibonus​

8. Conclusion

The Swan provider income model ensures a balanced distribution of income, rewarding providers for their service quality (reputation) and ensuring a safety net through the UBI. This comprehensive approach ensures the sustainability and attractiveness of the Swan ecosystem for potential providers.


Code Simulation and Plot

import numpy as np
import matplotlib.pyplot as plt

# Parameters
lambda_parameter = 5.0
L_initial = 200
k_initial = 0.2
x_0_initial = 25
U = 800
P_j = 100  # Price bid for job

# Equations
P_win = lambda R: lambda_parameter * np.exp(-lambda_parameter * R)
J_total = lambda x: L_initial / (1 + np.exp(-k_initial * (x - x_0_initial)))
jobs_won = lambda R, total_jobs: np.round(P_win(R) * total_jobs).astype(int)
I_base = lambda jobs_won: P_j * jobs_won
I_UBI = lambda I_base: U - min(I_base, U)
I_total = lambda I_base, I_UBI: I_base + I_UBI

# Simulation
x = np.linspace(0, 20, 100)
R = 0.5  # Assuming a constant reputation score for simplicity
total_jobs = np.round(J_total(x)).astype(int)
jobs_won_by_provider = jobs_won(R, total_jobs)
base_income = I_base(jobs_won_by_provider)
ubi_income = [I_UBI(i) for i in base_income]
total_income = I_total(base_income, ubi_income)

# Plot
plt.figure(figsize=(15, 10))

# Plotting Total Jobs and Jobs Won by Provider
plt.subplot(2, 1, 1)
plt.plot(x, total_jobs, label="Total Jobs")
plt.plot(x, jobs_won_by_provider, label="Jobs Won by Provider", linestyle='--')
plt.xlabel("Time")
plt.ylabel("Jobs")
plt.title("Job Metrics Over Time")
plt.legend()
plt.grid(True)

# Annotate y-values for integer x-values
for i in range(0, len(x), 5):  # Adjusted the loop to iterate over the length of x with a step of 5
    plt.annotate(f"{total_jobs[i]}", (x[i], total_jobs[i]), textcoords="offset points", xytext=(0,5), ha='center')
    plt.annotate(f"{jobs_won_by_provider[i]}", (x[i], jobs_won_by_provider[i]), textcoords="offset points", xytext=(0,5), ha='center')

# Plotting UBI Income, Base Income, and Total Income
plt.subplot(2, 1, 2)
plt.plot(x, total_income, label="Total Income", linestyle='-')
plt.plot(x, ubi_income, label="UBI Income", linestyle='-.')
plt.plot(x, base_income, label="Base Income", linestyle='-.')
plt.xlabel("Time")
plt.ylabel("Income")
plt.title("Income Metrics Over Time")
plt.legend()
plt.grid(True)

# Annotate y-values for integer x-values
for i in range(0, len(x), 5):  # Adjusted the loop to iterate over the length of x with a step of 5
    plt.annotate(f"{total_income[i]}", (x[i], total_income[i]), textcoords="offset points", xytext=(0,5), ha='center')
    plt.annotate(f"{ubi_income[i]}", (x[i], ubi_income[i]), textcoords="offset points", xytext=(0,5), ha='center')
    plt.annotate(f"{base_income[i]}", (x[i], base_income[i]), textcoords="offset points", xytext=(0,5), ha='center')

plt.tight_layout()
plt.show()

This code simulates the provider income over time based on the equations provided. Adjust the parameters as needed to fit the specific requirements of the Swan system.

PreviousUniversal Basic Income (UBI)NextToken

Last updated 1 year ago

Was this helpful?