# Introduction

Powering the future of web3, SOURCE is building limitless enterprise applications on a secure and sustainable global network.

## Foreword

Beyond the fundamental blockchain technologies of Bitcoin and Ethereum, technical expertise in the crypto space has limited adoption on a broader scale. There is an educational gap that prevents many non-tech-savvy users, as well as modern enterprises, from entering the space. Imagine a technology that promotes security, user-friendliness, efficiency, scalability, automation, and built-in sustainable growth. If proper levels of participation were acheived, such a technology would have a significant impact on increasing adoption and daily use case for blockchain technology at large. Similar to how DOS evolved into Windows, a web3 ecosystem has yet to bridge the gap to mass adoption.\
&#x20;

## What is Source?

SOURCE is a comprehensive blockchain technology suite for individuals, enterprises and developers to easily use, integrate and build web3.0 applications. It is a broad-spectrum technology ecosystem that transforms centralized web tools and financial instruments into decentralized ones.

Powering the future of web3, SOURCE is building limitless enterprise applications on a secure and sustainable global network. Defi white-labelled services, NFT markets, RWA tokenization, play-to-earn gaming, Internet of Things, data management and more. SOURCE is providing blockchain solutions to the real world and leveraging the power of interoperability.&#x20;

The SOURCE blockchain offers a quantum leap in performance and security for web3 innovation compared to its predecessors. With lightning-fast transaction speeds and a scalable architecture, SOURCE goes beyond the capabilities of Bitcoin and Ethereum. The SOURCE team is actively working with enterprise businesses to create blockchain solutions that harness the power of smart contracts, IBC, and the Cosmos Ecosystem. Say goodbye to slow transactions, high fees, and no practical business solutions – SOURCE is the future of blockchain technology.

SOURCE's backend infrastructure is also being made available for white label integration with existing online banking and finance solutions in order to more efficiently service the traditional finance industry.

## Background

The SOURCE team has a combined 30 years of experience in blockchain technology and cryptocurrency markets and its founders have been active since 2013. Through this experience, the team has come to recognize the benefits and drawbacks that various cryptos/blockchains have to offer. While many of these technologies are showing promise, it is undeniable that much of crypto's mainstream use is plagued by low transaction speeds, expensive gas fees, network congestion, lack of scalability, 51% attacks, centralized exchange hacks, minimal interoperability, and billionaire influencer tweets, etc.&#x20;

A major lack of solvency, liquidity and economic sustainability with prominent protocols, centralized or otherwise, has also become very clear. Evidence of this fact is arguably more visible due to the hype and what many would consider extreme over-valuations of “meme coins” and NFTs. This has created an irrational market lacking a significant presence of real utility and a dominant technology.​

While Bitcoin remains king as a store of value, and Ethereum leads the way in smart contract capabilities, the slow transaction speeds of BTC and ETH’s ever-increasing gas fees have hindered enterprise development and excluded many retail investors from being able to utilize valuable apps, smart contracts and tooling. This lack of scalability has ushered in a new “race to build the modern railroad,” with competing layer one blockchain technologies such as Cardano, Polkadot, Solana, Polygon, Avalanche, Binance Smart Chain, and Cosmos all trying to build the most efficient, secure and affordable blockchains available.

From a business and economic perspective, the market will naturally seek out ecosystems that excel in these categories. For this reason, SOURCE commits to building on, integrating with and implementing the most efficient, compatible and adaptable tech as the crypto space evolves over time.

* Majority of protocols are reliant on centralized exchanges for liquidity, limiting their ability to scale independently
* Slow transactions speeds, high costs, limited scalability, and inability to collaborate and share information with other chains, has created severe limitations in [Gen 2 blockchain infrastructure](https://www.ledger.com/academy/blockchain/web-3-the-three-blockchain-generations)
* There still exists a level of complexity in blockchain applications that remains a barrier to entry for the average user
* There is not enough focus on building “bridges” for the enterprise to adopt this new technology easily and quickly

**Consumers are eager for a blockchain ecosystem that can securely and sustainably support mass adopted applications.**

## **A Summary on the $SOURCE blockchain network**

**SOURCE** is a standalone, layer 1, proof-of-stake blockchain, based in the [Cosmos Hub IBC ecosystem (the Interchain)](https://cosmos.network/). SOURCE has been built with Ignite CLI (formerly Starport), which utilizes the Tendermint BFT consensus mechanism (Ignite) and the Cosmos SDK. This enables interoperable transactions with other layer 1 Cosmos Hub blockchains and creates a developer-friendly platform to build on top of.

**With SOURCE, everyone has access to a highly efficient, scalable and interoperable blockchain network to create apps, smart contracts and tools for the Web 3.0 Economy.** Developers, enterprises and individuals can build, integrate and use everything from DeFi apps, NFTs, play-to-earn, metaverse, privacy networks, DeSci, and much more.

#### **Key Components**&#x20;

* Sustainable Growth model built for enterprise involvement and mass application adoption
* Guardian Validator Nodes for enhanced network security
* Integration with Source Protocol’s Binance Smart Chain Ecosystem and Decentralized Money Market, Source One Market&#x20;
* Source-Drop (Fair community airdrop and asset distribution for ATOM stakers and SRCX holders)&#x20;
* Interoperable smart contracts (IBC)&#x20;
* High speed transaction finality&#x20;
* Affordable gas fees (average of $0.01 per transaction)&#x20;
* Highly scalable infrastructure &#x20;
* Open-source&#x20;
* Permission-less Modular Wasm + (EVM)&#x20;
* Secured on-chain governance&#x20;
* Ease of use for developers

## Implementing Sustainable Growth&#x20;

Sustainable growth is a concept that is severely lacking in the blockchain space, and even in federally-managed fiat currency. Value-backed global currencies, like a gold-backed dollar, have been absent for decades, for example. The global financial system and its counterpart, the global economy, at their current states are more unstable than ever, with inflation and de-leveraging continually on the rise. Blockchain and smart contract technology has massive potential to emerge as key resolutions to the global fiat currency and economy devaluation and inflationary crisis. However, **inherent volatility and speculation with crypto assets and blockchain networks have been pointed to as primary unstable growth factors, hindering mass adoption of Bitcoin and more recently, Web 3.0 application usage.**

With smart contracts, we can lock-in sustainable value on-chain. They allow for transaction fee accrual and automated processes that can be strategically programmed into economic models that can achieve enduring success with enterprise business partners and developers.&#x20;

If growth mechanisms like the above were to be successfully integrated into a blockchain economy like SOURCE, it would play a significant factor toward improving security, trust and mass adoption. This, combined with fast transaction speeds, low network fees, secured governance modeling, highly scalable infrastructure, and interoperable IBC capable smart contracts, will provide a massive competitive advantage over current top-tier protocols.

**It is time for a blockchain ecosystem to push beyond the status quo and introduce a sustainable growth model that will help to unleash the power behind this great technology. This is what we are building with Source Protocol $SOURCE.**&#x20;


# Vision

Enabling individuals, developers, and enterprises to produce and consume with complete ownership and control over their assets

As a team of experienced developers, blockchain tech experts and finance professionals, SOURCE was created out of our belief in sovereignty for all. By supercharging the power of Web 3.0 tech and making economic interaction more accessible, efficient and private, **we’re building a new blockchain-powered ecosystem to enable the next generation of individuals, developers and enterprises with complete ownership and control over their assets.**

Despite the challenges, SOURCE embraces the evolution and benefits of various blockchain technologies to date. Thus, SOURCE is creating a continuously evolving and all-encompassing Web 3.0 suite that unites state of the art technologies in a multi-chain, interoperable and automated ecosystem. We're creating an environment where DeFi apps, NFTs, P2E, Metaverses, DeSci, Privacy Networks, and more can benefit from speed, cost and scalability; where users can enjoy a sustainable, secure and simple ecosystem; and where enterprises can adopt this technology with ease.

As the Web 3.0 space grows and matures, SOURCE's focus will remain on value creation design for our community and users, ensuring superior economic sustainability.


# Business Solutions

Blockchain-as-a-Service (BaaS) and Web3 Solutions

### What is BaaS and why is it Revolutionary?

Blockchain-as-a-Service (BaaS) is an offering that allows businesses to leverage web3 and blockchain technology. With (BaaS) companies can deploy blockchain applications and smart contracts without having to manage, maintane, or secure complex infrastructure. Similar to how web hosting works, but for blockchain applications. This allows for significant cost and efficiency savings for businesses across a broad scope of industries.

### What is DeFi-as-a-Service and Its Significance?

DeFi-as-a-Service is a step forward, letting businesses integrate decentralized finance functionalities into their operations without the heavy lifting of developing the technology from scratch. With DeFi and web3's explosive growth, businesses that capitalize on its potential can offer revolutionary financial solutions without the overheads of traditional banking systems.<br>

### Unlock the Potential of Your Business With web3 Integration

Source Protocol is not just a technology provider; it's a strategic partner for enterprises seeking to integrate the future of finance into their offerings. Here's what you stand to gain:<br>

**1. Seamless White-label Integration:** Integrate top-tier DeFi products like Source One Market, Source Swap, Source Launch Pad, and Source One Card into your existing platforms. Offer a robust decentralized banking experience without the need for rebranding.<br>

**2. Full Stack Support:** Whether you're a startup or an established enterprise, benefit from a scalable DeFi infrastructure that's backed by round-the-clock support.<br>

**3. Regulatory Compliance:** Navigate the complex landscape of global regulations with ease. Source's global SAFT licenses and compliant partner network ensure you're always on the right side of the law.<br>

**4. Efficiency and Cost Savings:** Decentralization means fewer intermediaries. This not only speeds up processes but also reduces costs associated with traditional financial systems.<br>

**5. Unmatched Security:** Rest easy knowing that Source Protocol's offerings are secured with fully audited third-party code and smart contract technology.<br>

**6. Non-Custodial Operations:** Source's DeFi solutions are designed with user trust in mind. There's no need to custody customers' assets, offering users peace of mind knowing their assets are in their control.<br>

**7. Global Accessibility:** The future of finance is borderless. With Source Protocol, businesses can tap into a global ecosystem that's open, fair, and accessible to everyone, everywhere.

The Takeaway: The fusion of BaaS and DeFi-as-a-Service plus web3 by Source Protocol is more than just a technological advance; it's a strategic move to position businesses at the forefront of the financial evolution. By democratizing access to decentralized solutions, Source Protocol is setting the stage for a more inclusive and efficient global financial landscape.

<br>

### Diverse Industry Applications of Source Protocol's BaaS and DeFi-as-a-Service

Source Protocol's BaaS and DeFi-as-a-Service capabilities can transform a multitude of industries, driving innovation, security, efficiency, and financial inclusivity. Let's explore how various sectors can leverage these services:

#### &#x20;1. Sports Management and Teams

\- Fan Engagement: Tokenized loyalty programs and NFT memberships can revolutionize fan experiences, offering exclusive content, memorabilia, and fan interactions.

\- Fundraising: Crowdfunding for new projects or infrastructure through tokenized assets, allowing fans to be a part of the team's growth and success.

\- Smart Contracts: Streamlining contract management for athletes and staff, with transparent, secure, and automated payment structures.<br>

#### &#x20;2. Cybersecurity Companies

\- Decentralized Security Solutions: Integrating blockchain into cybersecurity tools for enhanced data integrity and secure, transparent transactions.

\- Smart Contract Auditing: Utilizing blockchain for immutable logging of security events, enhancing traceability and accountability.

#### &#x20;3. Retail and E-commerce

\- Crypto Payments: Integrating crypto payment gateways, appealing to a broader, tech-savvy customer base and reducing transaction fees.

\- Supply Chain Transparency: Utilizing blockchain for traceable and transparent supply chain management, enhancing customer trust.<br>

#### &#x20;4. Healthcare

\- Secure Patient Records: Leveraging blockchain for secure, immutable patient data storage, ensuring privacy and ease of access for authorized parties.

\- Pharmaceutical Supply Chain: Tracing drug production and distribution to prevent counterfeiting and ensure quality control.

#### &#x20;5. Real Estate

\- Tokenization of Property: Facilitating fractional ownership and investment in real estate through blockchain, making it more accessible.

\- Smart Lease Contracts: Automating lease agreements with smart contracts, streamlining processes and enhancing security.<br>

#### &#x20;6. Banking and Financial Services

\- DeFi Lending and Borrowing: Offering alternative financing options for consumers and businesses, bypassing traditional banking systems.

\- Asset Management: Utilizing blockchain for transparent, efficient asset management and investment services.<br>

#### &#x20;7. Gaming and Entertainment

\- In-game Assets: Tokenization of in-game items and currencies, allowing real-world value and tradeability.

\- Royalty Distribution: Using smart contracts to automate and transparently distribute royalties to creators and artists.<br>

#### &#x20;8. Education and Research

\- Credential Verification: Secure, tamper-proof recording and verification of academic credentials.

\- Research Data Sharing: Facilitating secure and transparent sharing of research data within and across institutions.<br>

#### &#x20;9. Energy Sector

\- Decentralized Energy Grids: Implementing blockchain for transparent, efficient energy distribution and trading.

\- Carbon Credit Trading: Utilizing blockchain for the issuance, trading, and management of carbon credits.<br>

#### &#x20;10. Government and Public Services

\- Voting Systems: Implementing secure, transparent blockchain-based voting systems.

\- Public Records Management: Utilizing blockchain for immutable public record keeping, enhancing transparency and trust.<br>

#### &#x20;11. Agriculture and Farming

\- Supply Chain Optimization: Blockchain technology for tracking produce from farm to table, ensuring freshness and quality.

\- Smart Farming Contracts: Use of smart contracts for managing supply agreements and transactions with distributors and retailers.<br>

#### &#x20;12. Insurance

\- Claim Processing: Implementing smart contracts for automated, transparent, and faster claim processing.

\- Fraud Prevention: Utilizing blockchain's immutability to prevent and detect fraud in insurance operations.<br>

#### &#x20;13. Manufacturing

\- Quality Assurance: Tracking manufacturing processes and materials to ensure and certify product quality.

\- Inventory Management: Using blockchain for real-time, transparent inventory tracking and management.<br>

#### &#x20;14. Transportation and Logistics

\- Fleet Management: Implementing blockchain for transparent and efficient management of logistics and fleet operations.

\- Freight and Cargo Tracking: Real-time tracking of goods, ensuring transparency and security in the supply chain.<br>

#### &#x20;15. Hospitality and Tourism

\- Loyalty Programs: Tokenizing loyalty points to enhance customer engagement and reward systems.

\- Secure Booking Systems: Utilizing smart contracts for tamper-proof, reliable booking and reservation systems.<br>

#### &#x20;16. Construction and Real Estate Development

\- Project Management: Blockchain for efficient, transparent project management and contractor accountability.

\- Land Registry and Property Rights: Secure and immutable records for land and property ownership.<br>

#### &#x20;17. Automotive Industry

\- Vehicle Lifecycle Management: Tracking the entire lifecycle of a vehicle for quality assurance and maintenance history.

\- Supply Chain Management: Streamlining parts inventory and supplier contracts through blockchain.<br>

#### &#x20;18. Media and Publishing

\- Content Rights Management: Managing and enforcing intellectual property rights for digital content.

\- Transparent Advertising: Blockchain for transparent tracking and verification of advertising engagements and payments.<br>

#### &#x20;19. Non-Profit Organizations

\- Donation Tracking: Transparent tracking of donations to ensure proper usage and increase donor trust.

\- Grant Management: Automating and securing the grant application and disbursement process.<br>

#### &#x20;20. Professional Services

\- Contract Management: Utilizing smart contracts for transparent, enforceable service agreements.

\- Credential Verification: Secure, blockchain-based verification of professional credentials and licenses.

<br>


# DeFi-as-a-Service

Unlock the Potential of Your Business With DeFi Integration

Seamless white-label integration of Source Market, Source Swap, Source Launch Pad, and/or Source One Card with existing online banking and financial applications, allowing businesses to bring their customers a full-stack, fully compliant, secure, and non-custodial decentralized banking experience.

**Full Stack** - Scalable DeFi infrastructure with 24/7 support for enterprises of all sizes

**Fully Compliant** - Gain access to Source's global SAFT licenses and compliant partner network

**Efficient** - Reduce the involvement of intermediaries and limit latency with decentralization

**Secure** - 3rd-party fully audited code and development secured by smart contract technology

**Non-Custodial** - Source's DeFi suite requires no need to custody customer's assets

**Accessible** - Expand your operations with a borderless digital ecosystem that is open, fair and accessible to all


# Ecosystem Overview

A Web 3.0 Tech Suite for Individuals, Developers and Enterprises

## Approach

Source Protocol is launching a comprehensive web3.0 ecosystem composed of several cohesive products, starting with the SOURCE network (SOURCE), an interoperable Layer 1 blockchain built with the Cosmos SDK. The Source Protocol team is focused on establishing long-term relationships with enterprises that wish to participate in and benefit from the power of SOURCE's Web 3.0 ecosystem and its capabilities, as described in the summary below.

## **Ecosystem Overview**

### **SOURCE**&#x20;

An efficient, scalable and interoperable blockchain network to create apps, smart contracts and tools for the Web 3.0 Economy. Built with [Cosmos SDK](https://github.com/cosmos/cosmos-sdk) and secured for enterprise grade solutions. Supports CosmWasm and interoperable IBC Transfer capabilities.

### Native Applications

A decentralized application suite for access to large volumes and liquidity of digital assets. Available for retail and enterprise users. Built on the SOURCE network. Native applications are necessary to provide white-label services and many blockchain solutions.

* **SOURCEswap -** An Interchain DEX & AMM for permission-less listing of SOURCE-based tokens, native Cosmos SDK assets and cw20 tokens
* **SOURCEmarket -** Trade NFTs, RWAs, and more powered by the SOURCE blockchain network.&#x20;
* **SOURCEfi** - A defi marketplace of blue-chip crypto assets for lending and borrowing on-chain, peer to peer, and non-custodial
* **SOURCEworld™ -** An expansive metaverse and VIP social HUB for exploring all the SOURCE ecosystem and applications through an immersive experience.
* **SOURCElaunch** - Empowering projects to seamlessly distribute tokens and raise liquidity.

### **Source One Card & Members Rewards Program**

Become a Source One Rewards member and earn from a robust suite of perks and rewards. In the future, connect your Source One Card to your DeFi wallet and swipe with your crypto assets online and at retail locations in real time.

### **DeFi-as-a-Service (DaaS)**

Seamless white-label integration of Source One Market, Source Swap, Source Launch Pad, and/or Source One Card with existing online banking and financial applications, allowing businesses to bring their customers a full-stack, fully compliant, secure, and non-custodial decentralized banking experience.

## **Ecosystem Architecture**

Additional blockchains such as Ethereum, Solana, Polygon, and Avalanche can be integrated and developed into the Source One Market as needed. The Source One Market is chain-inclusive and is being designed to be a state of the art DeFi experience that expands and evolves with blockchain technologies. It will also have features that include interactions with NFTs, Source native token airdrops and promotions, and metaverse integrations.


# JOIN SOURCE

A tutorial for beginners on how to join and participate in the SOURCE blockchain network

## 1. Download and Secure your Keplr wallet

[CLICK HERE TO DOWNLOAD KEPLR](https://www.keplr.app/download)

<figure><img src="/files/Uomz4a3Gndzas8CwSm1z" alt=""><figcaption><p>Keplr is a web3 Interchain wallet </p></figcaption></figure>

Be sure to backup your 12- or 24-word Keplr Wallet seed phrase and store it offline. Remember, NOT YOUR KEYS, NOT YOUR CRYPTO. Your wallet is your own responsibility. We recommend backing up via a secure USB drive and notepad. ***NEVER STORE*** YOUR PHRASE ON GMAIL OR THE CLOUD.

Source can be added to the Keplr by navigating to settings then clicking "Add More Chains."

Search for Source and click "Add Chain."&#x20;

If SOURCE is not displayed, make sure to enable it under "Manage Chain Visibility."

## 2. Vist APP.OSMOSIS.ZONE

[CLICK HERE FOR OSMOSIS](https://app.osmosis.zone/?to=SOURCE\&from=OSMO)

<figure><img src="/files/cIBqHbnRJZNhjaMIadn7" alt=""><figcaption><p>connect Keplr web3 wallet to Osmosis</p></figcaption></figure>

2A. - Connect Keplr Wallet&#x20;

## 3. Buy OSMO or USDC and Swap for SOURCE

3A. - With Keplr connected to app.osmosis.zone a "BUY TOKENS" button will appear in the bottom left corner of the app. Click "Buy Tokens" to on-ramp fiat dollars into crypto.

<figure><img src="/files/8RHMJyXBWC5G0pUrFs78" alt="" width="327"><figcaption><p>"Buy tokens" button will only appear if Keplr is connected</p></figcaption></figure>

3B. - Use **Kado** or **Transak** to purchase OSMO or USDC. You will then be taken through a quick KYC form. This is for anti-money laundering purposes. Your information is secure. <br>

IMPORTANT: Always keep a small amount of OSMO in your wallet for gas and IBC transfers.

<figure><img src="/files/2JcAiufhRGC9ELX56lLI" alt=""><figcaption></figcaption></figure>

3C. - Swap OSMO or USDC for SOURCE and confirm the transaction with Keplr wallet

<figure><img src="/files/Wkxmn1gKE0zB52TloTl9" alt="" width="335"><figcaption><p>click "Swap" and confirm the transaction</p></figcaption></figure>

<figure><img src="/files/VnEoEg0m4Zt5XlDRaBVk" alt="" width="363"><figcaption><p>click Approve and you will now have SOURCE in your Keplr wallet</p></figcaption></figure>

## 4. Send SOURCE on Osmosis to SOURCE on Source via IBC transfer and stake SOURCE tokens to help secure the network

1. Click Assets tab on Osmosis, it will look something like this
2. Next on the SOURCE line, click "Withdraw >"

<figure><img src="/files/AM44HlbcCOGhEwqZFyFa" alt=""><figcaption><p>Click "Withdraw >" to start IBC transfer tokens to SOURCE</p></figcaption></figure>

3. Next, enter the amount you will be sending and click "Withdraw SOURCE", Keplr will then pop up and ask you to Approve the transaction. Click "Approve"

<figure><img src="/files/qDjwrVu3af8g6wlbwuw4" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/RVcvJ0yXvRNRrCUnLQbV" alt="" width="563"><figcaption><p>Click "Approve" to initiate the IBC transfer</p></figcaption></figure>

## 5. STAKE your SOURCE and earn rewards for contributing to secure the network

Now that you have SOURCE tokens on the SOURCE blockchain network you can stake to earn rewards.

[CLICK HERE TO VISIT PING.PUB/SOURCE](https://ping.pub/source)

5A. Connect Keplr by click "CONNECT WALLET" in the top right corner of the app

Once connected, refresh the page and you will see you SOURCE balance on the dashboard.

<figure><img src="/files/66RpyQrAmBrbw6zpTCXs" alt=""><figcaption><p>Connect Keplr to ping.pub/source</p></figcaption></figure>

5B. Click the "Staking tab"

<figure><img src="/files/PhwKojkcR0IlZhtkwIAG" alt=""><figcaption><p>Select validators to stake with (one at a time) </p></figcaption></figure>

It is recommended to spread your staking delegations to multiple Validators. Click the "Delegate" button next to the validator you wish to stake with.&#x20;

Click "SEND" and approve the transaction. Your tokens stay in your wallet this only gives the validator permission to stake your tokens on your behalf.  The validators earn a commission by providing this service to the network.

**Congratulations! you are now staking and earning rewards by the block on the SOURCE network. You can now return to the Dashboard and view your balance as well as how many Rewards have been earned.**

## LEAP WALLET - Alternative Wallet

Source is now accessible on LEAP. The LEAP Wallet can be downloaded [here](https://leapwallet.io/) as browser extension and can be downloaded as a mobile application from your app store and can be an alternative wallet solution that offers a different experience and additional features.

The SOURCE Network can be easily added by following the steps below.

### Browser Extension

Open your Leap Wallet Extension. Select Networks/Switch Chain and search "Source" and "Add Chain"

<figure><img src="/files/QvNlun32H7bPnwTEQDI0" alt="" width="188"><figcaption><p>Switch Chain</p></figcaption></figure>

<figure><img src="/files/3uZit9O3jfjlNI1DdwOG" alt="" width="188"><figcaption><p>Search and Add Source</p></figcaption></figure>

### Mobile

With the Leap Mobile App, Open the in app browser and go to: <https://developers.leapwallet.io/chain-store>

Search "Source" and "Add Chain"

<figure><img src="/files/8fpdJPZZsnFWGCLbJVkw" alt="" width="188"><figcaption><p>Search and Add Source</p></figcaption></figure>


# Tokenomics

## Overview&#x20;

SOURCE mainnet went live on October 13th, 2023 with the following genesis token distribution.

<table data-header-hidden><thead><tr><th width="276.4237360957615"></th><th width="152.648472944494" align="right"></th><th width="150" align="right"></th></tr></thead><tbody><tr><td><strong>SOURCE-Drop to ATOM stakers</strong></td><td align="right">156,000,000</td><td align="right">42.3%</td></tr><tr><td><strong>Strategic Reserve</strong></td><td align="right">124,000,000</td><td align="right">33.6%</td></tr><tr><td><strong>Liquidity Mining Rewards</strong></td><td align="right">65,000,000</td><td align="right">17.6%</td></tr><tr><td><strong>Community Pool (locked)</strong></td><td align="right">13,000,000</td><td align="right">3.5%</td></tr><tr><td><strong>Developer (vested)</strong></td><td align="right">11,000,000</td><td align="right">3.0%</td></tr><tr><td></td><td align="right"></td><td align="right"></td></tr><tr><td><strong>Total SOURCE at Genesis</strong></td><td align="right">369,000,000</td><td align="right"></td></tr></tbody></table>

![](/files/YT2KTQUC1yqwL7W2eaYb)

## **SOURCE Token Release Schedule (Fixed Inflation)**

| Year | Fixed Inflation | $SOURCE Added to Supply | Total Supply  |
| ---- | --------------- | ----------------------- | ------------- |
| 1    | 40%             | 146,000,000             | 511,000,000   |
| 2    | 20%             | 102,200,000             | 613,200,000   |
| 3    | 10%             | 61,320,000              | 674,520,000   |
| 4    | 9%              | 60,706,800              | 735,226,800   |
| 5    | 8%              | 58,818,144              | 794,044,944   |
| 6    | 7%              | 55,583,146              | 849,628,090   |
| 7    | 6%              | 50,977,685              | 900,605,775   |
| 8    | 5%              | 45,030,289              | 945,636,064   |
| 9    | 4%              | 37,825,443              | 983,461,507   |
| 10   | 3%              | 29,503,845              | 1,012,965,352 |
| 11   | 2%              | 20,259,307              | 1,033,224,659 |
| 12   | 1%              | 10,332,247              | 1,043,556,906 |

&#x20;

#### **MAX SUPPLY: 1,043,556,906 (unofficial)**

![](/files/paqOuf2PofAIHSlj6pGI)

## Staking&#x20;

Users will be able to delegate/stake their SOURCE to qualifying validator nodes via a Keplr wallet. Staking SOURCE will have a bonding period of 21 days. Once SOURCE is delegated to a validator, it can be re-delegated at any time to another validator node if desired without breaking the bonding period. However, once delegation is broken, the user will not receive staking rewards or have their holdings become liquid until 21 days have passed. The SOURCE development team is actively working with professional validators to help secure and decentralize the network. The staking rate is determined by numerous factors and will be viewable within the Keplr wallet.


# Features Part 1

Built With Individuals, Developers and the Enterprise in Mind

## Interoperability (IBC)

The interoperability and IBC Transfer function of the Cosmos Hub ecosystem (the Interchain) allows for sovereign layer 1 chains like SOURCE to communicate and transfer tokens in an efficient and secure manner without requiring a bridge. While bridging is a great tool for chains to transfer value, many bridges are plagued with hacks, security exploits and vulnerabilities. The IBC transfer capability of the Interchain simplifies value transfer and provides a more secure and scalable environment for users to participate in.

The Cosmos HUB has a horizontal scaling advantage for blockchains built within its ecosystem (known as the Interchain) due to the capability of IBC Transfers. A simple metaphor to understand this would be to look at Ethereum as a two lane highway where transactions are like vehicles that are limited from being able to change lanes. There is only one path which is very limiting. This causes network congestion, higher fees, and slower transaction finality. In contrast, the IBC capability of SOURCE and all other Cosmos Hub built blockchains.

Not only is IBC functionality a massive advantage for SOURCE, it also provides additional security for many token holders that participate in the Interchain ecosystem as it eliminates the need for bridging. With all the attacks and hacks on bridges in 2022, the IBC model is proving itself to be a much more future proof and scalable solution.

This model will be secured even further with the Interchain Security upgrade scheduled for the Cosmos HUB in 2022. This upgrade allows validator node operators to provide security to multiple chains simultaneously and receive additional incentives for doing so. For example, once this upgrade is live ATOM delegators will be able to receive ATOM, OSMO, EVMOS, JUNO and SOURCE all from staking their ATOM to validator nodes that should choose to participate. This promotes further decentralization and makes it easier to further secure newly built blockchains in the Interchain.

## CosmWasm

SOURCE enables Rust smart contract capability with CosmWasm and features a minting system that mints and releases new tokens over a predetermined inflation schedule. Rust is widely-used outside of blockchain technology and is a highly scalable language for smart contracts, making SOURCE an attractive blockchain for developers and enterprises looking to utilize the power of Web 3.0 technology. On top of that, CosmWasm allows IBC-capable smart contracts between chains, creating an extremely effective mechanism for cross-chain collaboration, value and data sharing. This is considerably important, as the need for information to be shared in an effective and secure way across networks is vital in order for decentralized applications to garner mass adoption.

## **Throughput & Affordable Gas Fees**

SOURCE has a throughput starting at 2,500 transactions per second (TPS), scalable up to 10,000 TPS, and an average block confirmation time of 7 seconds. Combined, these are significant increases from Bitcoin’s TPS of 7 and average confirmation time of 30+ minutes, and Ethereum’s TPS of 25 and average confirmation time of 6+ minutes. For further perspective, VISA handles about 1,700 to 4,000 transactions per second.

Transaction fees (otherwise known as ‘gas’) on SOURCE are extremely affordable at approximately $0.01 to $0.07 per transaction. This is significant for developers that wish to deploy various apps, marketplaces, metaverses, etc., as they do not want to be bottlenecked by high network congestion, downtime or high fees that slow user adoption and limit product scalability. Affordable transaction fees are imperative for enterprises, many of whom wish to utilize blockchain solutions for more efficient on-chain data storage via micro transactions.

## Decentralization Model&#x20;

Security for any blockchain is top priority. Without it, the network can be quickly halted or rendered useless, affecting all users, applications and services. SOURCE has a unique approach towards decentralization with an emphasis on security first.

Fully decentralized governance models have evident limitations in security. For just one example, a malicious on-chain governance proposal could be submitted under the guise of a well-designed narrative that appeals to the community, but in reality would be harmful to the network and its participants if passed. Unfortunately, governance hacks like this are common, and have happened as recently as July 23rd, 2022, when [hackers stole $6 million worth of AUD tokens from Audius, a Web 3.0 music platform](https://www.gate.io/blog_detail/1348/hackers-stole-6-million-from-audius-after-passing-a-malicious-governance-proposal). Governance systems without a failsafe create high levels of unnecessary risk. A system which considers short and long term risk, ramifications of changes, malicious intent, etc., is necessary to secure a blockchain ecosystem properly.

## Guardian Nodes&#x20;

13 Guardian Nodes will be deployed at the SOURCE genesis event, managed by the SOURCE Guardian DAO. Their purpose is to protect the sovereignty, ethos and constitution of the chain, as well as to provide sustainable funding for the community pool and SOURCE Swap incentives. These nodes hold authority by being delegated a combined minimum of 33.4% of SOURCE from the strategic reserve and SOURCE partners. This delegation ensures a successful “No with Veto” by the SOURCE Guardian DAO to shut down any threatening or manipulative governance proposals. The SOURCE Guardian DAO will consist of blockchain experts that share a common vision and purpose for the SOURCE blockchain. As a comparison to these 13 nodes, the top 7 validator nodes on ATOM are delegated 34.77% of circulating supply by ATOM delegators. The more distributed a chain’s supply is to various validators the more secure it is. Governance Proposals can be used to add additional Guardian Nodes in the future that will further secure the network.

In order to avoid top-heavy centralization, Guardian Nodes will be set to 100% commission. This removes any incentive for additional delegators to delegate to Guardian Nodes and encourages delegation to community validators. Guardian nodes will also avoid being involved in most governance proposals and will, by default, vote “Abstain” to prevent centralized influence over community governance. “No with Veto” will only be used by Guardian Nodes to protect the chain from malicious proposals.

Nefarious narratives are not always perceived as immediate threats by individuals with limited technical expertise, and the Guardian Nodes are to be viewed as a “fail-safe” mechanism that provides enhanced security to the chain. Subversive, threatening and spammy proposals will be immediately shut down and prevented by Guardian Nodes as they exist as a deterrent for any malicious behavior whatsoever.

***Guardian Nodes use SOURCE delegated to them from strategic enterprise partners. These partners will have signed private contracts to commit their delegated tokens to assigned Guardian Nodes as well as trusted community validators.***

Source Protocol’s founding team encourages the education and active participation of the community to distribute their delegations to several validator nodes. This increases chain security and makes the network more decentralized. Everyone in the community will have a different level of commitment to actively participate in governance. It is recommended to always research your SOURCE community validator.

**To summarize, the benefits provided by SOURCE Guardian Nodes are:**

* Designed to protect governance and secure the future of SOURCE
* Managed by SOURCE Guardian DAO’s expertise&#x20;
* 13 Guardian Nodes deployed at genesis to spread network distribution&#x20;
* Non-competing with SOURCE community validators&#x20;
* Provides additional funding for community pool&#x20;
* Abstains from voting unless the chain is threatened&#x20;
* Provides opportunity for strategic enterprise partners

### **Value-Backing from Guardian Node Staking**

Not only do Guardian Nodes protect and secure the chain, they also provide the chain with a revenue stream. Guardian Nodes will provide additional revenue to the Community Pool, Liquidity Mining Rewards and Strategic Reserve. This allows for a steady flow of value to expand and improve the development, adoption and progress of the SOURCE ecosystem.

## **Community Pool**

3.5% of the Genesis Distribution is allocated to the Community Pool. The pool is used to fund beneficial proposals passed by the community to improve the SOURCE ecosystem. There is a 5% tax on all block rewards that also contributes toward replenishing the Community Pool. A percentage of stake rewards from Guardian Validators will also contribute toward replenishing the community pool.

## **Strategic Reserve**

Approximately 33.6% of the SOURCE genesis distribution will be allocated to the Strategic Reserve. This is used for Guardian Nodes and the funding of SOURCE development efforts. These funds will be delegated into the 13 Guardian Nodes from the SOURCE Guardian DAO controlled multi-sig wallet. As strategic partnerships are formed, these funds will be transferred and the partners will sign private contract agreements that maintain their delegated SOURCE within the Guardian Nodes. SOURCE in the Strategic Reserve will not be market-sold, as it is needed to make Guardian Nodes possible. SOURCE purchased from the strategic reserve to raise development capital will also be released on a vesting schedule.

Staking rewards from the strategic reserve will be moderately compounded to uphold the 33.4% minimum delegation of total supply needed for Guardian Nodes. Additional SOURCE accrued from staking will be used to further fund the community pool, or will be delegated to top performing community validator nodes that provide exceptional services to the SOURCE ecosystem.

## Summary

<figure><img src="/files/X2YIfUL9Ymd40A8jiMQ6" alt=""><figcaption></figcaption></figure>

#### Developers click [HERE](broken://pages/bXkfPc7iDYiQauk7caSQ) to dive into SOURCE CHAIN DOCUMENTATION


# Features Part 2

**\*\*\*At this time, SOURCE Blockchain is in a testing phase and provides a Public Testnet**. The Testnet can be utilized to deploy Nodes, Validator Nodes and to deploy and test Smart Contracts and decentralized applications.

## **Inter Blockchain Communication (IBC)**

At the heart of Cosmos ecosystem is the [**Inter Blockchain Communication Protocol (IBC)**](https://ibc.cosmos.network/), which sets the table for an interoperable base layer 0 to now be used to transfer data packets across thousands of independent networks supporting IBC. Naturally, the next evolutionary milestone is to enable cross-network smart contracts. This enables Source smart contracts to interoperate with all IBC enabled networks, regardless of wasm support on external networks.

## **Cosmos SDK**

The Source blockchain is built using the [**Cosmos SDK framework**](https://docs.cosmos.network/). A generalized framework that simplifies the process of building secure blockchain applications on top of Tendermint BFT. It is based on two major principles: Modularity & capabilities-based security.

## **Tendermint Core** ![](/files/ajxEtTIWdojYRPB4llXz)

Agreement on the network is reached via [**Tendermint BFT consensus**](https://docs.tendermint.com/).

Tendermint BFT is a solution that packages the networking and consensus layers of a blockchain into a generic engine, allowing developers to focus on application development as opposed to the complex underlying protocol.&#x20;

## Ignite CLI ![](/files/FvpDIfca0LmYgre7SJvS)

[**Ignite CLI**](https://docs.ignite.com/) is a CLI tool for creating and maintaining sovereign application-specific blockchains. Blockchains created with Ignite CLI use Cosmos SDK and Tendermint. Ignite CLI and the Cosmos SDK modules are written in the Go programming language. The scaffolded blockchain that is created with Ignite CLI includes a command line interface that lets you manage keys, create validators, and send tokens.

## **CosmWasm** ![](/files/Xn5OrXfqAIg7kIoV7CGq)

[**CosmWasm**](https://docs.cosmwasm.com/docs/1.0/) is written as a module that can plug into the Cosmos SDK. This means that anyone currently building a blockchain using the Cosmos SDK can quickly and easily add CosmWasm smart contracting support to their chain, without adjusting existing logic.

[**Rust**](https://www.rust-lang.org/) is currently the most used programming language for CosmWasm, in the future, it is possible to have different programming languages like [**AssemblyScript**](https://www.assemblyscript.org/)


# Why Guardian Nodes?

Enhanced Security and Trust for Enterprise Solutions

The SOURCE team has set out to create a blockchain like no other. Inspired by the function of the United States Supreme Court. 13 Guardian Validator Nodes have been deployed at Genesis to ensure network security, enhance trust for enterprise businesses, and generate continuous value growth for the network and the SOURCE community. The Guardian Nodes offer strategic business advantages and leverage to support the network and strategic business partners.

#### The benefits of Guardian Nodes are as follows:

* **They act as a fale-safe to secure the chain** from malicious governance. NOTE: they do not participate in non-malicious governance, therefor governance is fully guided by the SOURCE community validators and delegators.<br>
* **They help distribute the network**. Guardian Nodes on SOURCE help mitigate a top heavy network distribution. This effectively spreads the network more fairly to more community validators.\
  \
  **How does the SOURCE team make the network more decentralized and distributed by running Guardian Nodes themselves and why not just run a single Guardian Node?** By setting commissions at 100% the SOURCE team has made it so that the community has no incentive to delegate to Guardian Nodes. This forces delegators to stake with community validators rewarding them as they would on any other POS chain and further distributing the network. A single top heavy node would also pose a security risk to the chain.<br>
* **They reduce circulating supply**. SOURCE tokens in the 13 Guardian Nodes cannot be sold off or "dumped" as they would then no longer provide the fail safe layer of security.<br>
* They always accumulate rewards effectively taking tokens out of circulating supply and are simultaneously increasing the value of the network.<br>
* Excess rewards that they produce can be sent to the community pool to further progress the chain or fund the community.<br>
* Provide a slight level of centralization to give enterprise businesses more confidence and trust in launching their blockchain solutions on SOURCE.

#### Guardian Nodes in regard to Governance

Nefarious narratives are not always perceived as immediate threats by individuals with limited technical expertise, and the Guardian Nodes are to be viewed as a “fail-safe” mechanism that provides enhanced security to the SOURCE network. Subversive, threatening and spammy proposals will be immediately shut down and prevented by Guardian Nodes as they exist as a deterrent for any malicious behavior.

***Guardian Nodes use SOURCE delegated to them from strategic enterprise partners. These partners will have signed private contracts to commit their delegated tokens to assigned Guardian Nodes as well as trusted community validators.***

Source Protocol’s founding team encourages the education and active participation of the community to distribute their delegations to several validator nodes. This increases chain security and makes the network more decentralized. Everyone in the community will have a different level of commitment to actively participate in governance. It is recommended to always research your SOURCE community validator.

#### **Value-Backing from Guardian Node Staking**

Not only do Guardian Nodes protect and secure the chain, they also provide the chain with a revenue stream. Guardian Nodes will provide additional revenue to the Community Pool, Liquidity Mining Rewards and Strategic Reserve. This allows for a steady flow of value to expand and improve the development, adoption and progress of the SOURCE ecosystem.


# Source Swap

An Interchain DEX and AMM

## Introduction

Source Swap is a DEX and AMM currently in beta testing that will allow for trading and liquidity mining of SOURCE-based tokens, native Cosmos SDK assets and cw-20's. Wrapped tokens from SOURCE Protocol’s Binance Smart Chain-based “Source One" Market will also be integrated. It will allow users to use IBC transfers from various chains for a secure and interoperable user experience. Liquidity pool incentives will be provided from the SOURCE liquidity mining reward allocation from the genesis distribution.&#x20;

![](https://lh4.googleusercontent.com/PTZVBuCT5d2MP9ks7PkQKJz104RGuv47AEnkLDeHbyiKN9AyeBm2uEcYieAcMXVMRvrYWoECFmob9jI2MeE3aJderfGXOjkhwP09bq3uNDz8Vi0ekoHihTTY6thVFddYdEQ_IQ25CygETp3yNuap77c)

## **Fees: Transaction, Swap, and Exit**

Transaction fees are paid by users when signing and posting transactions to SOURCE Chain. These fees are distributed to SOURCE stakers.

Swap fees are paid by users when trading with the SOURCE Swap AMM decentralized exchange. They are calculated based on trade size and vary by liquidity pool. These fees are added to their respective pool and then distributed to users based on the proportion of their liquidity pool token share.

Exit fees are paid by users when exiting a liquidity pool. They are calculated as a percentage of LP token shares being redeemed. Upon exit, the user’s LP shares are burned and the value is distributed to the remaining LP shares. Exit fees are set by the pool creator. SOURCE governance can also deploy additional fees to improve the network if needed.

## **Source One Market & Source One Card**

The Source One Market on Binance Smart Chain is a non-custodial, peer-to-peer lending and borrowing market where users are able to earn rewards from lending and access credit lines by collateralizing their crypto assets. Source One Market assets will be bridgeable to SOURCE Chain, where they can be traded and used for liquidity pool mining within Source Swap.

**This will allow for wrapped Binance Smart Chain assets (BEP-20) to have access to the Cosmos Interchain ecosystem.**

Source One Market has been developed on the Binance Smart Chain in order to access large volumes of wrapped assets. SOURCE will implement a bridge and swap feature that allows simple transfer of Source One assets to be used in liquidity pools on SOURCE and Source Swap.

The Source One card will allow users to manage and pre-load value from their crypto assets to spend at retail locations and online. The card will have several additional bonuses and reward incentives. Spending crypto earnings is a great feeling and the Source Protocol development team is building the backbone to support this in a truly decentralized manner.


# Airdrop

A Community-Driven Fair Airdrop of SOURCE to Cosmos Hub and Source Token Supporters

## Summary

The SOURCE-Drop has been carefully designed to provide maximum benefit to community members that hold **SRCX** (SRCX has since merged and swapped into SOURCE and the contract has been retired and tokens burned) and stake **Cosmos Hub** **(ATOM)**. ATOM should be staked (delegated) to a trusted validator via Keplr Wallet. *It is important to note that ATOM and SRCX staked or held on centralized exchanges will not be eligible for the airdrop.*

## Details

About 40% of SOURCE's Genesis Supply will be airdropped to **ATOM stakers** and **SRCX holders** based on **random snapshots of both networks** taken before the SOURCE Genesis Event in Q4 of 2022 (Genesis Event Date TBD)*.* The SOURCE-Drop will be whale-capped on both networks and will not be game-able.&#x20;

All ATOM addresses that qualify will be included in the SOURCE Genesis Event. This means the same private keys in Keplr that staked your ATOM are automatically populated with SOURCE. It is therefore not required to perform any claim action.

All SRCX addresses that qualify will be included in the SOURCE Genesis Event, so long as the user registers on Source Protocol's Web 3.0 application by connecting their Metamask and Keplr Wallets. A Keplr wallet is necessary to generate a SOURCE wallet address and thus receive your eligible airdrop.

\*\*As of writing (8/23/22), no ATOM or SRCX network snapshots have been taken. More information on specific eligibility ratios and genesis event date will be announced soon.

\*\*Registration has not opened yet. More information on when and how to register via the Source Web 3.0 app will be available soon.

## Bonus Eligibility

Contributors and participants to the SOURCE testnet (now public) will be eligible to receive bonus SOURCE-drop from active participation such as setting up a validator node, launching a smart contract, and more. Additional contributions and active participation by community members will also be rewarded.

### Airdrop Info

Source Members are eligible for the upcoming airdrop when the SOURCE Blockchain goes live October 13th 2023. Though completing both will provide a higher airdrop, users must reach at least one of the following qualifications:

* Hold a minimum of 500 SRCX and connect their Metamask wallet to the Members Dashboard. SRCX Holders receive a higher weight of the Source airdrop.
* Have at least 50 Atom Staked on the Cosmos Network via Keplr wallet.

### How to Purchase and Stake ATOM

Cosmos (ATOM) can be purchased on most Centralized exchanges, such as Coinbase, with a debit, credit card, or bank account.

Send Atom from the exchange to your Keplr Wallet.

Use the Stake feature in your Keplr Wallet to Stake your tokens to a Validator of your choice.


# Claim Source-Drop

Instructions for Connecting to the Source Blockchain and Accessing Your Airdrop

## Source Mainnet and Source-Drop Launch

Source Protocol is excited to announce the release of the Source Blockchain Mainnet! As of October 13, 2023, the blockchain is open an available for anyone to participate. Those who are eligible may have received their portion of the Source-Drop at the Genesis Block of the Source Blockchain.

### Who is Eligible?

Source Token (SRCX) holders on the Binance Smart Chain that signed up for the [Source Members Dashboard](https://members.sourceprotocol.io/sign-in), connected their wallets, and held at least 500 SRCX. Periodic snap shots taken between Q4 2022 and Q2 2023 with an initial qualifying date of November 30, 2022. Whale capped at 20,000 SOURCE.

All Atom Stakers that had at least 50 Atom staked to the network. Snapshots of the Atom network taken between Q4 2022 and Q1 2023 and were averaged and added to the Source-Drop. Whale Capped at 20,000 Source.

Validators that participated in the previous version of the testnet that have proven to be helpful and consistent in securing the Source Blockchain. Airdrop amounts based off of, but not limited to: ability to remain in the active set, time on network, network placement, services provided such as RPC/API/GRPC Endpoints, snapshots, installation scripts, explorer hosting and anything deemed helpful to the testnet as a whole.

## How to Claim the Source-Drop

Follow the steps below to access the Source Blockchain.

### Keplr Wallet

If you completed or participated in any of the three prerequisites for recieveing the Source-Drop, you should already have Keplr Installed. If for some reason you do not, you can download the Keplr Broswer Extension [here](https://www.keplr.app/).

### Connect Keplr to the Source Blockchain

Source is now listed in the Keplr Chain Registry. Add Source Directly to Keplr here: <https://chains.keplr.app/>

<figure><img src="/files/YQPEI9XfA1kEX6JoczIo" alt=""><figcaption><p>Add to Keplr</p></figcaption></figure>

<figure><img src="/files/dXHSfoorAupfNcAXjkTI" alt=""><figcaption><p>Approve Add Source to Keplr </p></figcaption></figure>

<figure><img src="/files/APIVtGAuVLn57jZiLt5h" alt=""><figcaption><p>Source Display in Keplr</p></figcaption></figure>

You may now send and receive SOURCE. Through the Explorers, you can now participate on the Blockchain such as delegating to Validator Nodes and voting on Governance Proposals.

We suggest delegating to trusted Validators that are not "Guardian Nodes" to encourage decentralization of the chain.

Learn more about the Guardian Nodes [here](https://docs.sourceprotocol.io/source-chain/features#guardian-nodes).

### Interacting With Explorers, Staking, and Governance

Source Explorer listings as of October 24, 2023 **Please Do Your Research Before Connecting Your Wallet To Any 3rd Party Website Or Application. No One Should Ever Ask You For Your Private Keys/Seed Phrase!**&#x20;

\| <https://ping.pub/source> | <https://explorer.tcnetwork.io/source> | <https://restake.app/source> | <https://explorer.stavr.tech/Source-Mainnet/staking> | <https://explorer.nodestake.top/source/staking> | <https://exp.nodeist.net/source> | <https://explorer.moonbridge.team/source> | <https://mainnet.itrocket.net/source/staking> | <https://explorer.sr20de.xyz/Source-mainnet> | <https://bonynode.online/source-mainnet> |

Example Below is based off Ping.Pub and may vary between Explorers

<figure><img src="/files/gGR0p68CIYNS6jKSgQHm" alt=""><figcaption><p>Connect Kepr</p></figcaption></figure>

<figure><img src="/files/f9HYgB6xkdJk01TUaYCY" alt=""><figcaption><p>Connect</p></figcaption></figure>

You should now see your address and balance information displayed. The webpage may need to be refreshed after connecting.

\*\*\***PLEASE NOTE! AT THIS TIME, SOURCE COIN IS NOT TRADING ANYWHERE NOR DOES IT HAVE A PRICE ASSOCIATED WITH IT. ANY PRICE DISPLAYED ON THE DASHBOARD OR IN KEPLR MAY BE COMING FROM SRCX AND DOES NOT REPRESENT SOURCE COIN OR THE SOURCE BLOCKCHAIN. THIS WILL BE UPDATED SOON!**\*\*\*

<figure><img src="/files/u8iWm0LjZQFyqKXaRrsW" alt=""><figcaption><p>Dashboard Display</p></figcaption></figure>

Delegations to Validators can now be made.

<figure><img src="/files/n5Gd2ysZm8E8ykM5zLQG" alt=""><figcaption><p>Delegate to Validators</p></figcaption></figure>

If for any reason you are having issues connecting or completing transactions, you may change the API provider at the top of the screen.

<figure><img src="/files/ulL3awvdWcYoPsQRKjUY" alt=""><figcaption><p>Change Node Connection</p></figcaption></figure>

If you are a Validator and wish to join the Source Blockchain. Be sure to follow the guide [here](https://docs.sourceprotocol.io/nodes-and-validators/joining-mainnet) and join the official [Source Discord Channel](https://discord.com/invite/zj8xxUCeZQ).


# How to IBC Transfer

The following is a guide on how to IBC transfer SOURCE tokens to the OSMO network and also how to send "SOURCE on OSMO" back to "SOURCE on SOURCE."

**For the savvy:** \
Source(channel-0, 07-tendermint-0) <-> Osmosis(channel-8945, 07-tendermint-3035)\
\
**For the not as savvy but still savvy:**\
\- When IBC from SOURCE to OSMO use Destination Chain (Osmosis-Channel 0)\
\- When IBC from OSMO to SOURCE use Destination Chain (Source-Channel 8945)\
\
**For the becoming savvy:**

1. Be sure your Keplr wallet has Developer Mode enabled, or the IBC transfer won't appear. Go to "Settings", "Advanced", enable Developer Mode.\
   \
   ![](/files/HN0oT6uqUFfkXKbF5QdH)<br>
2. We will be doing an IBC transfer from SOURCE to OSMO. Copy your OSMO receive address as we will need it for the transfer. In Keplr just hover over OSMO and click "copy" icon ![](/files/G7ai75R4QRBPZMzaOBF2)<br>
3. Scroll to the bottom of Keplr wallet and click "Transfer" next to Advanced IBC Transfer.\
   ![](/files/nFz7qcOu5lowuw8aD5eY)<br>
4. You will now be on the "Select Asset" tab. This is the chain you are going from so you want to find SOURCE and select it.\
   ![](/files/Gn0fnKDPpie0SwZgTpo3)<br>
5. On the next tab, under Destination Chain select "New IBC Transfer Channel"\
   ![](/files/qKp1jdm2DFg5nKmK9kOL)<br>
6. Destination Chain: Osmosis\
   Source Channel Id: 0\
   Click, "Save"\
   ![](/files/Gw9JJmSAhseI6RxK8iN4)
7. You can now set the Destination Chain to "Osmosis (channel-0)"\
   \
   Under "Wallet Address or ICNS" paste your OSMO receive address \
   \
   ![](/files/6efRKD6JobuVy3rQlLtm)<br>
8. Enter the quantity of SOURCE you want to transfer. Click Next\
   \
   ![](/files/Kp0icUtWEOnMbHCDuaeu)<br>
9. Approve the IBC Transfer\
   \
   ![](/files/meZ8fGU38tL3wCcGQu7V)<br>
10. After success and the transfer has been added to the blockchain you will now see "SOURCE on Osmosis" with a token balance.\
    \
    You can now interact with SOURCE on the OSMOSIS application.\
    \
    ![](/files/Yu2GEnqBkRgLbhfrqJmr) <br>
11. Reverse the process when moving "SOURCE on OSMO" to "SOURCE on SOURCE"\
    Use Destination Chain "Source (channel-8945)"\
    Enter quantity to transfer and approve the transaction.\
    \
    ![](/files/xmj9UWzlPjf4wJDF4l2A)

HOORAY! You now know how to execute IBC Transfers and move native tokens from blockchain to blockchain across the Cosmos Ecosystem!


# Community

Powering Web 3.0 and Beyond

Source Chain SOURCE will be a highly utilized, transacted and scalable global Web 3.0 network. The genesis distribution model is designed to “jump start” the network by inviting and incentivizing users and contributors to join the SOURCE ecosystem. Source Protocol's development team has many features and tools being built and tested that will have a significant impact on the network.

The SOURCE testnet can be joined by clicking [HERE](https://source-swap-dev.web.app/). All are invited to contribute and provide feedback to the foundation of this revolutionary Web 3.0 ecosystem.

#### Developers click [HERE](broken://pages/bXkfPc7iDYiQauk7caSQ) to dive into SOURCE CHAIN DOCUMENTATION

### Links

{% embed url="<https://www.sourceprotocol.io/>" %}

{% embed url="<https://t.me/SOURCEprotocol>" %}

{% embed url="<https://discord.com/invite/zj8xxUCeZQ>" %}


# SourceSwap - On Chain DEX

SourceSwap is the first Decentralized Exchange (DEX) and Automated Market Maker (AMM) on the Source Blockchain. Built with CosmWasm to support Native Tokens, CW20 Tokens, IBC Tokens and more.

With the soft launch of [SourceSwap](https://swap.sourceprotocol.io/) comes three main features:

* Token Swaps
* IBC Transfers
* Liquidity Management&#x20;


# Connect and Deposit

Details for connecting your Source Wallet and Depositing tokens on chain

SourceSwap Currently has Support for KEPLR Wallet. Instructions on how to set up Keplr can be found [here](https://docs.sourceprotocol.io/source-protocol/join-source).

While LEAP Wallet is currently functional, full support for LEAP will be released in the coming weeks. We recommend using KEPLR to connect to the DEX at this time.

## STEP 1: Connect Wallet

With KEPLR installed on your web browser or the mobile app, navigate to [swap.sourceprotocol.io](https://swap.sourceprotocol.io/) and click "Connect" in the top left corner.

<figure><img src="/files/MAUnWR2tZgLmtNHwCLrp" alt="" width="258"><figcaption></figcaption></figure>

Accept any prompts given by KEPLR and you will be connected to the Swap.

<figure><img src="/files/MFPpXs7MCOgki1eiaZZM" alt=""><figcaption></figcaption></figure>

## Deposit Assets

The IBC transfer page acts as a user friendly interface to help facilitate IBC transfers of supported tokens on SourceSwap. It should be noted that tokens are being deposited to the blockchain, not specificcally the DEX itself. IBC transfers can be completed directly in Keplr as normal or with routing applications such as <https://go.skip.build/>

At this time SourceSwap supports:

* SOURCE (native gas and governance token of the Source Blockchain)
* USDC.axl (USDC deposited directly from the Axelar Chain. Source(channel-3, 07-tendermint-17) <-> Axelar(channel-160, 07-tendermint-229))

To use this feature simply click "Deposit" next to the chosen token.

<figure><img src="/files/MdyugMxZlZTP1W6Oeu66" alt=""><figcaption></figcaption></figure>

Chose you amount, hit transfer, and accept the prompt from Keplr.

<figure><img src="/files/dh0YFfUfpJBwGNArGUXU" alt="" width="375"><figcaption></figcaption></figure>

IBC tranfers can sometimes take a few minutes to process. When the transfer has gone through, your tokens will be displayed.

<figure><img src="/files/U7EiiFOkOTfsytkuFHmA" alt=""><figcaption></figcaption></figure>

You have now made your first deposit, follow the next sections to learn about swapping and liquidity management.


# Swap

Swapping Assets

SourceSwap provides an easy to use interface to make swapping tokens easy and seamless.

Simply Navigate to the "Trade" tab. Here you can select which tokens you would like to trade.

<figure><img src="/files/oPyQKb1m7pkc756Ym0SR" alt=""><figcaption></figcaption></figure>

Use the drop downs to select the tokens you wish to trade.

<figure><img src="/files/J7lB5jbnIqP1YgEPxOGI" alt=""><figcaption></figcaption></figure>

Set the amount to be traded and click "SWAP". Accept the prompts from KEPLR.

<figure><img src="/files/hYPBouvoXJibkkjD2uLX" alt=""><figcaption></figcaption></figure>

Wait for the trasnaction to process. You have now completed your first swap.

<figure><img src="/files/8aTOvrsa0F0wtTsuNr3v" alt=""><figcaption></figcaption></figure>


# Manage Liquidity

Add and Remove token liquidity

Providing liquidity on SourceSwap can allow users to earn additional tokens through reward functions. This includes:

* Swap Fees. Collection of swap fees from individuals using the swap function of SourceSwap. Your swap fees are calculated based on the percentage of the liquidity pool that your portion of liquidity represents. For example, if you had $50 in a liquidity pool with a total of $100, your liquidity would represent 50% of the pool. These fees are automatically added to your total liquidity as they are incurred.
* External Liquidity Incentives. External rewards may be added to certain pools in various reward mechanisms. These rewards can be claimed by liquidity providers.

## Provide Liquidity

To become a liquidity provider, first navigate to the "Liquidity Pools" page. Here you will see the available pools. Click the pool you would like to add liquidity to.

<figure><img src="/files/8j6elP2C0pmrnVPvUNko" alt="" width="375"><figcaption></figcaption></figure>

This page will give an overview of the pool and will allow you to manage your liquidity.

<figure><img src="/files/yQ8NQyx9yUwl2Rup9FXG" alt=""><figcaption></figcaption></figure>

To get started, click the "Add Liquidity" button in the first box. Please note that in order to provide liquidity, you must provide both tokens to the pool.

<figure><img src="/files/bDkEXp9IHqMuGaY8yJ2Z" alt="" width="375"><figcaption><p>Add Liquidity and accept wallet prompts.</p></figcaption></figure>

## Bond Liquidity

Now that you have provided liquidity to the pool, you can now begin staking to the pool by bonding your shares to earn rewards. Click "Manage Staking" then choose the amount you wish to bond.

<figure><img src="/files/9hY8OyGH9cEVBCq3AiXm" alt="" width="375"><figcaption><p>Click Bond and accept wallet prompts</p></figcaption></figure>

## Rewards

In addition to swap rewards being automatically added to your liquidity position, external incentives and rewards can now be viewed and claimed.

<figure><img src="/files/p7ukcnNjCa24aLCrb1RA" alt=""><figcaption><p>Claim Rewards</p></figcaption></figure>

## Withdraw Liquidity

To withdraw liquidity, simply follow the above steps in reverse. This should look like:

* "Claim your Rewards" if any are available
* Unbond staked liquidity with "Manage Staking"&#x20;
* Wait for Unbonding. (There is currently no unbonding time and should be instant, this may change for certain pools in the future)
* Withdraw liquidity with "Manage Liquidity"&#x20;

<figure><img src="/files/ZoEKrt98tipOpA4h86Cb" alt="" width="375"><figcaption></figcaption></figure>


# Before Submitting a Proposal

This page is currently a work in progress

### **Introduction**

Governance exists for the community of token holders to decide on key issues involving the blockchain and its development. This is achieved by proposing items of business to be voted on by the token holders.

There are four forms of governance proposal:

* Text proposal - this type of proposal is text only. The outcome is not automatically implemented and may require actions by third parties to implement.
* Community spend - the outcome of this type of proposal will be the transfer of funds from the community pool to the address and for the amount nominated in the proposal.
* Parameter change - the outcome of this proposal will be modified blockchain parameters in accordance with the proposal submission.
* Software upgrade - the outcome of this proposal will be validators and node operators undertaking a coordinated software upgrade at the block height specified in the proposal.

Please refer to the following best practice for developing and submitting governance proposals. This procedure is intended to enable discussion and gauging support for the proposal prior to submitting on-chain.

Please note the following special circumstances before proceeding:

* If the proposal is a parameter change with implications for development or smart contract usage, consider speaking to your friendly neighborhood core dev.
* If the proposal will result in significant engineering effort to implement, definitely ask a member of the core team about what would happen if the proposal passes.

### **Begin the conversation**

Raise your proposal in the [Telegram](https://t.me/sourceprotocol) chat or the #⚖︱governance discord channel. This will give you the opportunity to discuss with other network users and developers and further develop your ideas. Other participants may have some interest in the proposal and offer to further improve your proposal, or you may find that this idea has no support or maybe has already been satisfied in some other way.

Check via the block explorer that there is not already a past or present proposal that already directly deals with your issue.

### **Seek feedback on commonwealth.im**

Once you have a clearly defined proposal idea. Fully draft your proposal text and submit to the Source commonwealth.im project page [here](https://commonwealth.im/source).

To make your proposal easily identifiable, please use the following format for the discussion title:

**PROPOSAL: \<name-of-proposal>**

Please avoid using numbering in your proposal discussion. Should the proposal not go ahead, the numbering of the discussion can become confusing.

It is recommended to **keep your proposal discussion open for at least seven days** prior to formalizing the proposal on-chain.

To get the most exposure for your conversation, advertise the link in the Telegram and Discord. Consider contacting the core devs to advertise the discussion on the official @SourceProtocol\_ Twitter account.

Consider making appropriate changes to your proposal based on feedback from the discussion.

### **Submit your proposal on-chain**

Once you are confident about your proposal, you can submit on-chain for voting. You can find guidance on submitting your proposal on the following page.

Please note that the fee to fully fund a governance deposit is 500 $SOURCE. These funds will be returned to the depositor following completion of the voting period. If there are sufficient NO WITH VETO votes, the depositors will lose their funds. The depositor will also lose their funds if quorum of 33.4% is not reached.

&#x20;

For more information on the governance process, see [the cosmos governance process](https://hub.cosmos.network/main/governance/process.html).


# Submitting a Proposal (CLI)

This page is currently a work in progress

[Governance proposals](https://hub.cosmos.network/main/governance/) target the parameters of specific modules. Go to the [list of modules](https://docs.cosmos.network/master/modules/), and go to the 'parameters' tab for the module you are interested in.

You can query the current setting for that parameter with sourced query params subspace \[module] \[parameter]. For example, to query [the communitytax param in distribution](https://docs.cosmos.network/master/modules/distribution/07_params.html), you would do:

```
sourced query params subspace distribution communitytax
```

NB: if you have not set it in config, you will need to add chain-id: --chain-id sourcechain-testnet

This will return:

```
key: communitytax
subspace: distribution
value: '"0.020000000000000000"'
```

You can query [BaseApp](https://docs.cosmos.network/master/core/baseapp.html) parameters as well:

```
sourced query params subspace baseapp BlockParams
```

This will return:

```
key: BlockParams
subspace: baseapp
value: '{"max_bytes":"22020096","max_gas":"80000000"}'
```

Let's take this BlockParams parameter as an example. Say we want to create a proposal that increases this value.

We can encode the parameter change in a JSON proposal like so:

```
{
  "title": "Governance Proposal to add maximum per block gas",
  "description": "To stop potential attacks against the network via the use of malicious smart contracts, we need to set a max per block gas limit. From testing on the Source Chain testnet, the core team feel this value is a good starting point, and it can be increased in future if necessary.",
  "changes": [{
    "key": "BlockParams",
    "subspace": "baseapp",
    "value": {
      "max_gas": "100000000"
    }
  }],
  "deposit": "10000000usource"
}
```

We can then submit it:

```
sourced tx gov submit-proposal param-change ./max_block_gas_proposal.json --from sourceuser --fees 5000usource --gas auto
```

Other types of proposals include community-pool-spend and software-upgrade/cancel-software-upgrade.


# Introduction

A general introduction Source cli along with a brief description of commands and flags

`sourced` is a command line client for the Source Chain network. Source Chain users can use `sourced` to send transactions to the Source Chain network and query the blockchain data.

{% hint style="info" %}
See [here](https://docs.sourceprotocol.io/nodes-and-validators/sourced-installation-and-setup) for instructions on installing `sourced`.
{% endhint %}

### Working Directory <a href="#working-directory" id="working-directory"></a>

The default working directory for the `sourced` is `$HOME/.source`, which is mainly used to store configuration files and blockchain data. The Source `key` data is saved in the working directory of `sourced`. You can also specify the `sourced` working directory by using the `--home` flag when executing `sourced`.&#x20;

### Connecting to a Full-Node

By default, `sourced` uses `tcp://localhost:26657` as the RPC address to connect to the Source Chain network. This default configuration assumes that the machine executing `sourced` is running as a full-node.

The RPC address can be specified to connect to any full-node with an exposed RPC port by adding the `--node` flag when executing `sourced`

### Global Flags <a href="#global-flags" id="global-flags"></a>

#### GET Commands <a href="#get-commands" id="get-commands"></a>

All GET commands have the following global flags:

| Name, shorthand | Type   | Required | Default Value | Description                          |
| --------------- | ------ | -------- | ------------- | ------------------------------------ |
| --chain-id      | string |          |               | The network Chain ID                 |
| --home          | string |          | $HOME/.source | Directory for config and data        |
| --trace         | string |          |               | Print out full stack trace on errors |
| --log\_format   | string |          | plain         | Logging format (json \| plain)       |

#### POST Commands <a href="#post-commands" id="post-commands"></a>

All POST commands have the following global flags:

| Name, shorthand   | Type   | Required | Default Value          | Description                                                                                                    |
| ----------------- | ------ | -------- | ---------------------- | -------------------------------------------------------------------------------------------------------------- |
| --account-number  | int    |          | 0                      | AccountNumber to sign the tx                                                                                   |
| --broadcast-mode  | string |          | sync                   | Transaction broadcasting mode (sync \| async \| block)                                                         |
| --dry-run         | bool   |          | false                  | Ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it                        |
| --fees            | string |          |                        | Fees to pay along with transaction                                                                             |
| --from            | string |          |                        | Name of private key with which to sign                                                                         |
| --gas             | string |          | 200000                 | Gas limit to set per-transaction; set to "simulate" to calculate required gas automatically                    |
| --gas-adjustment  | float  |          | 1                      | Adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set |
| --gas-prices      | string |          |                        | Gas prices in decimal format to determine the transaction fee                                                  |
| --generate-only   | bool   |          | false                  | Build an unsigned transaction and write it to STDOUT                                                           |
| --help, -h        | string |          |                        | Print help message                                                                                             |
| --keyring-backend | string |          | os                     | Select keyring's backend                                                                                       |
| --ledger          | bool   |          | false                  | Use a connected Ledger device                                                                                  |
| --memo            | string |          |                        | Memo to send along with transaction                                                                            |
| --node            | string |          | tcp\://localhost:26657 | \<host>:\<port> to tendermint rpc interface for this chain                                                     |
| --offline         | string |          |                        | Offline mode (does not allow any online functionality)                                                         |
| --sequence        | int    |          | 0                      | Sequence number to sign the tx                                                                                 |
| --sign-mode       | string |          |                        | Choose sign mode (direct \| amino-json), this is an advanced feature                                           |
| --trust-node      | bool   |          | true                   | Don't verify proofs for responses                                                                              |
| --yes             | bool   |          | true                   | Skip tx broadcasting prompt confirmation                                                                       |
| --chain-id        | string |          |                        | The network Chain ID                                                                                           |
| --home            | string |          | $HOME/.source          | Directory for config and data                                                                                  |
| --trace           | string |          |                        | <p>Print out full stack trace on errors<br></p>                                                                |

### Module Commands <a href="#module-commands" id="module-commands"></a>

| Subcommand                                  | Description                                                   |
| ------------------------------------------- | ------------------------------------------------------------- |
| [bank](broken://pages/-MguEgCgOXmZexQoYZPS) | Bank subcommands for querying accounts and sending coins etc. |
| debug                                       | Debug subcommands                                             |
| distribution                                | Distribution subcommands for rewards management               |
| gov                                         | Governance and voting subcommands                             |
| keys                                        | Keys allows you to manage your local keystore for tendermint  |
| params                                      | Query parameters of modules                                   |
| slashing                                    | Slashing subcommands                                          |
| staking                                     | Staking subcommands for validators and delegators             |
| status                                      | Query remote node for status                                  |
| tendermint                                  | Tendermint state querying subcommands                         |
| tx                                          | Tx subcommands                                                |
| upgrade                                     | Software Upgrade subcommands                                  |
| wasm                                        | Interact with smart contracts                                 |


# Useful CLI Commands

Get standard debug info from the `source` daemon:

```bash
sourced status
```

Check if your node is catching up:

```bash
# Query via the RPC (default port: 26657)
curl http://localhost:26657/status | jq .result.sync_info.catching_up
```

Get your node ID:

```bash
sourced tendermint show-node-id
```

{% hint style="info" %}
Your peer address will be the result of this plus host and port, i.e. `<id>@<host>:26656` if you are using the default port.
{% endhint %}

Check if you are jailed or tombstoned:

```bash
sourced query slashing signing-info $(sourced tendermint show-validator)
```

Set the default chain for commands to use:

```bash
sourced config chain-id source-1
```

Get your `valoper` address:

```bash
sourced keys show <your-key-name> -a --bech val
```

See keys on the current box:

```bash
sourced keys list
```

Import a key from a mnemonic:

```bash
sourced keys add <new-key-name> --recover
```

Export a private key (warning: don't do this unless you know what you're doing!)

```bash
sourced keys export <your-key-name> --unsafe --unarmored-hex
```

Withdraw rewards (including validator commission), where `sourcevaloper1...` is the validator address:

```bash
sourced tx distribution withdraw-rewards <sourcevaloper1...> --from <your-key>  --commission
```

Stake:

```bash
sourced tx staking delegate <sourcevaloper1...> <AMOUNT>usource --from <your-key>
```

Find out what the JSON for a command would be using `--generate-only`:

```bash
sourced tx bank send $(sourced keys show <your-key-name> -a) <recipient addr> <AMOUNT>usource --generate-only
```

Add Funds to Community Pool

```
sourced tx distribution fund-community-pool <AMOUNT>usource --from $(sourced keys show <your-key-name> -a) --chain-id source-1
```

Delegate to Gov proposal

```
sourced query gov deposit <proposal-id> <AMOUNT>usource --from <your-key> --chain-id source-1
```

Vote on Proposal

```
sourced tx gov vote <proposal-id> <Option,yes/no/etc> --from <your-key> --chain-id source-1
```

Query the results of a gov vote that has ended, from a remote RPC (NB - you have to specify a height before the vote ended):

```bash
 sourced q gov votes 1 --height <height-before-vote-ended> --node https://testnet.sourceprotocol.io:26657/
```

Query the validator set (and jailed status) via CLI:

```bash
sourced query staking validators --limit 1000 -o json | jq -r '.validators[] | [.operator_address, (.tokens|tonumber / pow(10; 6)), .description.moniker, .jail, .status] | @csv' | column -t -s"," | sort -k2 -n -r | nl
```

Query Staking Delegations

```
sourced query staking delegations-to <sourcevaloper1...> --chain-id source-1
```

Unjail Validator

```
sourced tx slashing unjail --from=source-user --chain-id=source-1
```

Get contract state:

```bash
sourced q wasm contract-state all <contract-address>
```


# Sourced Local Dev Setup

{% hint style="info" %}
These settings are only for development use of Source Chain on a local machine.
{% endhint %}

Want to use `sourced` locally for development, or to work with smart contracts? You're in the right place. To get started with smart contract development, we recommend running on a laptop until you are ready to deploy to a public testnet.

## Local Source Chain set up with Ignite CLI

### Install Pre-requisites

#### Install Go

Follow the instructions [here](https://golang.org/doc/install) to install Go.

For an Ubuntu LTS, you can probably use:

```bash
ver="1.19" && \
wget "https://golang.org/dl/go$ver.linux-amd64.tar.gz" && \
sudo rm -rf /usr/local/go && \
sudo tar -C /usr/local -xzf "go$ver.linux-amd64.tar.gz" && \
rm "go$ver.linux-amd64.tar.gz" && \
echo "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> $HOME/.bash_profile && \
source $HOME/.bash_profile && \
go version
```

Please install Go v1.19 or later.

#### Install Ignite Cli

Follow the instructions [here](https://docs.ignite.com/guide/install) to install Ignite CLI. (Ignite CLI can also be used in an online Gitpod container [here](https://gitpod.io/#https://github.com/tendermint/starport/tree/master))

```
sudo curl https://get.ignite.com/cli! | sudo bash
```

#### Clone Source Chain Repo

```
git clone https://github.com/Source-Protocol-Cosmos/source.git
```

#### Compile sourced binary and start the local chain

```
cd ~/source
git fetch
git checkout v3.0.0
ignite chain serve
```

Your local chain should now be running in development mode with two funded genesis accounts and a single validator for testing purposes.


# Source Chain Testnet Setup

Instructions for building sourced binary and connecting to the Source Chain Testnet.

## Current Testnet

**\*\*\*At this time, The Testnet can be utilized to deploy Nodes, Validator Nodes and to deploy and test Smart Contracts.**

Below is the list of Source Chain testnets and their current status. You will need to know the version tag for installation of the `sourced` binary.

For details of upgrades on the current testnet, as well as syncing, you can check out the testnets repo.

If you get stuck, please ask on Discord.

| chain-id     | Current Github version tag |
| ------------ | -------------------------- |
| sourcetest-1 | v3.0.1                     |

{% embed url="<https://github.com/Source-Protocol-Cosmos/source>" %}

{% embed url="<https://github.com/Source-Protocol-Cosmos/testnets/tree/master/sourcetest-1>" %}

## Minimum Hardware Requirements

The minimum recommended hardware requirements for running a validator for the Source Chain testnets are:

| Requirements                                                                          |
| ------------------------------------------------------------------------------------- |
| <ul><li>16GB RAM</li><li>200GB of disk space</li><li>2 Cores (modern CPU's)</li></ul> |

{% hint style="warning" %}
These specifications are the minimum recommended. As Source Chain is a smart contract platform, it can at times be very demanding on hardware. Low spec validators WILL get stuck on difficult to process blocks.
{% endhint %}

{% hint style="info" %}
Note that the testnets accumulate data as the blockchain continues. This means that you will need to expand your storage as the blockchain database gets larger with time.
{% endhint %}

## Choose an Operating System

The operating system you use for your node is entirely your personal preference. You will be able to compile the sourced daemon on most modern linux distributions and recent versions of macOS.

{% hint style="info" %}
For the tutorial, it is assumed that you are using an Ubuntu LTS release.

If you have chosen a different operating system, you will need to modify your commands to suit your operating system.
{% endhint %}

## Install pre-requisites

```bash
# update the local package list and install any available upgrades
sudo apt-get update && sudo apt upgrade -y

# install toolchain and ensure accurate time synchronization
sudo apt install curl tar wget clang pkg-config libssl-dev libleveldb-dev jq build-essential bsdmainutils git make ncdu htop screen unzip bc fail2ban htop -y
```

## Install Go

Follow the instructions [here](https://golang.org/doc/install) to install Go.

For an Ubuntu LTS, you can probably use:

```bash
ver="1.19" && \
wget "https://golang.org/dl/go$ver.linux-amd64.tar.gz" && \
sudo rm -rf /usr/local/go && \
sudo tar -C /usr/local -xzf "go$ver.linux-amd64.tar.gz" && \
rm "go$ver.linux-amd64.tar.gz" && \
echo "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> $HOME/.bash_profile && \
source $HOME/.bash_profile && \
go version
```

## Clone Source Chain Repo

```
git clone https://github.com/Source-Protocol-Cosmos/source.git
```

### Compile sourced binary&#x20;

```
cd ~/source
git fetch
git checkout v3.0.1
make build && make install
```

### Initialize the Source directories and create the local genesis file with the correct chain-id:

```
sourced init <moniker-name> --chain-id=sourcetest-1
```

### Create a local key pair (or add existing key):

```
# Create new keypair
sourced keys add <key-name>

# Restore existing source wallet with mnemonic seed phrase.
# You will be prompted to enter mnemonic seed.
sourced keys add <key-name> --recover

# Query the keystore for your public address
sourced keys show <key-name> -a
```

Replace `<key-name>` with a key name of your choosing.

{% hint style="danger" %}
After creating a new key, the key information and seed phrase will be shown. It is essential to write this seed phrase down and keep it in a safe place. The seed phrase is the only way to restore your keys.
{% endhint %}

### Download Genesis File

```
curl -s  https://raw.githubusercontent.com/Source-Protocol-Cosmos/testnets/master/sourcetest-1/genesis.json > ~/.source/config/genesis.json
```

[Testnet Genesis Repository and Contributions](https://github.com/Source-Protocol-Cosmos/testnets)

### **Genesis sha256**

```
sha256sum ~/.source/config/genesis.json
```

**This should return:**

```
# c8b8e28f1cc2c6bb708d963146842da9e367874267d90ab99a13a6bd736d5682
```

### Seed nodes to add to config.toml

```
nano ~/.source/config/config.toml
```

Find the appropriate section and add:

```
# Comma separated list of nodes to keep persistent connections to persistent_peers = 
"ace839c852739d1ea6e3675d30380fe085c1c23a@52.26.226.21:26656,8145d4d13511e7f89dbd257f51ed5d076941f12f@164.92.98.12:26656"
```

### Set Minimum Gas Price

```
nano ~/.source/config/app.toml

0.25usource
```

### Start the chain

```
sourced start
```

It will take some time to catch up and sync to the network. Check your status with:

```
sourced status
```

### Running in production

Create a systemd file for your Source service:

```
sudo nano /etc/systemd/system/sourced.service
```

Copy and paste the following and update:

```
Description=Source daemon
After=network-online.target

[Service]
User=<YOUR_USERNAME>
ExecStart=/home/<YOUR-USERNAME>/go/bin/sourced start --home /home/<YOUR-USERNAME>/.source
Restart=on-failure
RestartSec=3
LimitNOFILE=4096

[Install]
WantedBy=multi-user.target
```

This assumes $HOME/.source to be your directory for config and data. Your actual directory locations may vary.

Enable and start the new service:

```
sudo systemctl enable sourced
```

```
sudo systemctl start sourced
```

Check status:

```
sourced status
```

Check logs:

```
journalctl -u sourced -f
```

### **Get some testnet tokens**

Testnet tokens can be requested from the `#faucet` channel on [Discord](https://discord.com/invite/zj8xxUCeZQ).

To request tokens type `$request <your-public-address>` in the message field and press enter.

## Setup cosmovisor

Follow [these](https://docs.sourceprotocol.io/nodes-and-validators/setting-up-cosmovisor) instructions to setup cosmovisor and start the node.

## Upgrade to a validator

To upgrade the node to a validator, you will need to submit a `create-validator` transaction:

```bash
sourced tx staking create-validator \
--amount 1000000000usource \
--commission-max-change-rate "0.1" \
--commission-max-rate "0.20" \
--commission-rate "0.1" \
--min-self-delegation "1" \
--details "validators write bios too" \
--pubkey=$(sourced tendermint show-validator) \
--moniker “<key-name>” \
--chain-id sourcechain-testnet \
--gas-prices 0.025usource \
--from <key-name>
```

## Backup critical files

There are certain files that you need to backup to be able to restore your validator if, for some reason, it damaged or lost in some way. Please make a secure backup of the following files located in `~/.source/config/`:

* `priv_validator_key.json`
* `node_key.json`

It is recommended that you encrypt the backup of these files.


# Testnet Links

Helpful Links for connecting and using the Source Testnet

## Github

{% embed url="<https://github.com/Source-Protocol-Cosmos/source/tree/testnet>" %}

## Testnet Genesis

{% embed url="<https://github.com/Source-Protocol-Cosmos/testnets>" %}

## Testnet Block Explorer

{% embed url="<https://explorer.nodestake.top/source-testnet>" %}

{% embed url="<https://explorer.sr20de.xyz/Source-testnet>" %}

{% embed url="<https://explorer.stavr.tech/Source>" %}

## RPC API and ENDPOINTS

{% embed url="<https://testnet.sourceprotocol.io:1317/>" %}

{% embed url="<https://testnet.sourceprotocol.io:26657/>" %}

## Testnet Faucet

The Testnet faucet is available on the official Source Protocol Discord.

{% embed url="<https://discord.com/invite/zj8xxUCeZQ>" %}

\*\* If you are interested in running a full Validator Node on Testnet, please use the #validators channel in discord to contact us\*\*

## Resources

{% embed url="<https://stavr-team.gitbook.io/nodes-guides/testnets/source/statesync-snapshot>" %}

{% embed url="<https://itrocket.net/services/testnet/source/>" %}

{% embed url="<https://services.stake-town.com/home/testnet/source/sync>" %}

## Building and Deploying Smart Contracts with COSMWASM

{% embed url="<https://docs.cosmwasm.com/docs/1.0/>" %}

{% embed url="<https://github.com/CosmWasm/cw-plus>" %}

{% embed url="<https://github.com/CosmWasm/cw-tokens>" %}

{% embed url="<https://github.com/InterWasm/cw-contracts>" %}

{% embed url="<https://github.com/InterWasm/cw-awesome>" %}

## Sourceswap

Coming Soon

![](/files/7pddJ36MNHfxo6jlHUo9)


# Smart Contracts with COSMWASM

SOURCE utilizes the CosmWasm Engine for Smart Contract development and Interchain applications. Here you will find documentation to write, build, and deploy Smart Contracts with CosmWasm on Source.

{% embed url="<https://cosmwasm.com/>" %}

{% embed url="<https://docs.rs/cosmwasm-std/latest/cosmwasm_std/>" %}

{% embed url="<https://github.com/CosmWasm/cw-plus/tree/main/contracts/cw20-base>" %}

### Sylvia Framework

{% embed url="<https://cosmwasm.github.io/sylvia-book/index.html>" %}

### Create CosmWasm Apps with Cosmology

{% embed url="<https://cosmology.zone/products/create-cosmos-app>" %}


# CW-20/ERC-20 Tutorial

Create your own CW-20 Token

This will take you through uploading your own CW-20/ERC-20 to the Source Chain testnet.

It uses the examples in the `contracts/erc20` folder of the [cosmwasm-examples](https://github.com/CosmWasm/cosmwasm-examples) repo.

There are four steps involved in working with a smart contract.

1. Write the smart contract (already done here!)
2. Store the smart contract on chain
3. Instantiate the smart contract (configure and initialise it)
4. Execute commands provided by the smart contract

We will go through all of these in this tutorial.


# Installation

Follow the steps to set up a local development chain or connect to the Source Chain Testnet before continuing.

## Rust

Assuming you have never worked with rust, you will first need to install some tooling. The standard approach is to use `rustup` to maintain dependencies and handle updating multiple versions of `cargo` and `rustc`, which you will be using.

### Installing Rust in Linux and Mac

First, [install rustup (opens new window)](https://rustup.rs/). Once installed, make sure you have the wasm32 target:

```
rustup default stable
cargo version
# If this is lower than 1.49.0+, update
rustup update stable

rustup target list --installed
rustup target add wasm32-unknown-unknown
```


# Download, Compile, Store

Now we will download a contract, compile it, and upload it to the Source chain.

## Download

We're going to grab the `cosmwasm-examples` repo and compile our chosen contract.

```bash
# get the code
git clone https://github.com/CosmWasm/cosmwasm-examples
cd cosmwasm-examples
git fetch
git checkout 44d6a256cd99e66849e550185c98671d4109d78b # current at time of writing, should be cw 1.0.0-beta
cd contracts/erc20
```

## Compile

We can compile our contract like so:

```
# compile the wasm contract with stable toolchain
rustup default stable
cargo wasm
```

However, we want to create an optimised version to limit gas usage, so we're going to run:

```bash
sudo docker run --rm -v "$(pwd)":/code \
    --mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target \
    --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \
    cosmwasm/rust-optimizer:0.12.6
```

This will result in an artifact called `cw_erc20.wasm` being created in the `artifacts` directory.

## Uploading

You can now upload, or 'store' this to the chain via your local node.

```bash
cd artifacts
sourced tx wasm store cw_erc20.wasm  --from <your-key> --chain-id=<chain-id> \
  --gas-prices 0.1usource --gas auto --gas-adjustment 1.3 -b block -y
```

{% hint style="info" %}
You will need to look in the output for this command for the code ID of the contract. In the JSON, it will look like `{"key":"code_id","value":"6"}` in the output.
{% endhint %}

Alternatively, you can capture the output of the command run above, by doing these steps instead, and use the `jq` tool installed earlier to get the `code_id` value:

```bash
cd artifacts
TX=$(sourced tx wasm store cw_erc20.wasm  --from <your-key> --chain-id=<chain-id> --gas-prices 0.1usource --gas auto --gas-adjustment 1.3 -b block --output json -y | jq -r '.txhash')
CODE_ID=$(sourced query tx $TX --output json | jq -r '.logs[0].events[-1].attributes[0].value')
```

You can now see this value with:

```bash
echo $CODE_ID
```


# Initialize the Contract

Configure and get the contract up-and-running.

Now we've uploaded the contract, now we need to initialise it.

We're using the Poodle Coin example here - `$POOD` was the first meme coin deployed to a Source Chain testnet.

{% hint style="info" %}
Choose another name rather than Poodle Coin/POOD, as this is likely already taken on the testnet.
{% endhint %}

## Generate JSON with arguments

To generate the JSON, you can use `jq`, or, if you're more familiar with JS/node, write a hash and encode it using the node CLI.

This example uses the `node` REPL. If you have `node` installed, just type `node` in the terminal and hit enter to access it.

```javascript
> const initHash = {
  name: "Poodle Coin",
  symbol: "POOD",
  decimals: 6,
  initial_balances: [
    { address: "<validator-self-delegate-address>", amount: "12345678000"},
  ]
};
< undefined
> JSON.stringify(initHash);
< '{"name":"Poodle Coin","symbol":"POOD","decimals":6,"initial_balances":[{"address":"<validator-self-delegate-address>","amount":"12345678000"}]}'
```

## Instantiate the contract

{% hint style="info" %}
Note that if you use rich types like CosmWasm's `Uint128` then they will be strings from the point of view of JSONSchema. If you have an int, you do not need quotes, e.g. `1` - but for a `Uint128` you will need them, e.g. "`1"`.
{% endhint %}

Note also that the `--amount` is used to initialize the new account associated with the contract.

In the example below, `6` is the value of `$CODE_ID`.

```bash
sourced tx wasm instantiate 6 \
    '{"name":"Poodle Coin","symbol":"POOD","decimals":6,"initial_balances":[{"address":"<validator-self-delegate-address>","amount":"12345678000"}]}' \
    --amount 50000usource  --label "Poodlecoin erc20" --from <your-key> --chain-id <chain-id> --gas-prices 0.1usource --gas auto --gas-adjustment 1.3 -b block -y
```

If you have set `$CODE_ID` in your shell, you can instead run:

```bash
sourced tx wasm instantiate $CODE_ID \
    '{"name":"Poodle Coin","symbol":"POOD","decimals":6,"initial_balances":[{"address":"<validator-self-delegate-address>","amount":"12345678000"}]}' \
    --amount 50000usource  --label "Poodlecoin erc20" --from <your-key> --chain-id <chain-id> --gas-prices 0.1usource --gas auto --gas-adjustment 1.3 -b block -y
```

If this succeeds, look in the output and get contract address from output e.g `source1a2b....` or run:

```bash
CONTRACT_ADDR=$(sourced query wasm list-contract-by-code $CODE_ID --output json | jq -r '.contracts[0]')
```

This will allow you to query using the value of `$CONTRACT_ADDR`

```bash
sourced query wasm contract $CONTRACT_ADDR
```

{% hint style="danger" %}
Note that although we omit `--admin` when instantiating, in almost all production situations you will want to specify an admin address for the contract. if you do not do this, you will not be able to migrate the contract in future.
{% endhint %}


# Query and run commands

Query and execute commands on your new contract

Now you can check that the contract has assigned the right amount to the self-delegate address:

```bash
sourced query wasm contract-state smart <contract-address> '{"balance":{"address":"<validator-self-delegate-address>"}}' -b block 
```

From the example above, it will return:

```
data:
  balance: "12345678000"
```

Using the commands supported by `execute` work the same way. The incantation for executing commands on a contract via the CLI is:

```bash
sourced tx wasm execute [contract_addr_bech32] [json_encoded_send_args] --amount [coins,optional] [flags]
```

You can omit `--amount` if not needed for `execute` calls.

{% hint style="info" %}
You will likely need to add additional flags depending on your local node's gas settings. If in doubt, `--gas-prices 0.1usource --gas auto --gas-adjustment 1.3` will work. If you also add `-b block`, then the tx will block until complete or failed, rather than executing asynchronously.
{% endhint %}

In this case, your command will look something like:

```
sourced tx wasm execute <contract-addr> '{"transfer":{"amount":"200","owner":"<validator-self-delegate-address>","recipient":"<recipient-address>"}}' --from <your-key> --chain-id <chain-id>
```

## Passing arguments

As before, you can encode whatever JSON arguments you need via the node CLI (or another tool of your choice). But how do you know what arguments to use?

Every contract specifies the arguments that can be used for each action exposed to `execute`. Their types are also specified.

This specification, or spec, for short, can be found in the schema for the contract.

In the folder `contracts/erc20` within `cosmwasm-examples`, for example, you can see the schemas:

```bash
tree schema

schema
├── allowance_response.json
├── balance_response.json
├── constants.json
├── execute_msg.json
├── instantiate_msg.json
└── query_msg.json
```

Each of the JSON files above is a JSON schema, specifying the correct shape of JSON that it accepts.

Even though it is your job as a developer to provide documentation to your users, at a bare minimum, the schema will enforce argument correctness and provide basic documentation to others.


# CW1 Tutorial

This tutorial will take you through compiling, storing and interacting with the CW1 subkeys contract in the[ cosmwasm-plus](https://github.com/CosmWasm/cosmwasm-plus) repo.

`cosmwasm-plus` contains production-grade contracts, whereas `cosmwasm-examples`, which we used in the previous tutorial, is optimised for readability and for those new to CosmWasm and/or smart contracts in general.

As before, this will take four steps. Unlike before, we have more options for executing commands once instantiated:

1. Write the contract (already done)
2. Store the contract on-chain
3. Instantiate the contract
4. Execute commands using the contract:
   1. As the admin key (A), set an allowance for a key (B)
   2. As the key with an allowance, send tokens to key (C)
   3. See tokens arrive at key (C)
   4. See allowance decrease for key (B)


# Installation

The installation steps for this will be similar to the CW-20/ERC-20 tutorial.

Follow the steps to set up a local development chain or connect to the Source Chain Testnet before continuing.

## Rust

Assuming you have never worked with rust, you will first need to install some tooling. The standard approach is to use `rustup` to maintain dependencies and handle updating multiple versions of `cargo` and `rustc`, which you will be using.

### Installing Rust in Linux and Mac

First, [install rustup (opens new window)](https://rustup.rs/). Once installed, make sure you have the wasm32 target:

```
rustup default stable
cargo version
# If this is lower than 1.49.0+, update
rustup update stable

rustup target list --installed
rustup target add wasm32-unknown-unknown
```


# Download, Compile, Store

First, we need to download the code from [cosmwasm-plus](https://github.com/CosmWasm/cosmwasm-plus).

### Download

Run the following to download the correct tag and extract it. `ls` should show you the folder is present once it's unpacked. You can also use `git` instead of `wget` if you prefer.

```bash
git clone https://github.com/CosmWasm/cw-plus.git

git fetch --tags

git checkout v0.13.4

cd contracts/cw1-subkeys
```

### Compile

Unlike before, where we compiled just the one contract, we'll compile all of them, since we may want to experiment with others. Run this at the root of the `cosmwasm-plus` folder:

```bash
sudo docker run --rm -v "$(pwd)":/code \
  --mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target \
  --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \
  cosmwasm/workspace-optimizer:0.12.6
```

### Store

When compiling is complete (it will take a while) `cd` into the `artifacts` directory. `ls` should show you binaries for each of the contracts have been created. The one we care about is `cw1_subkeys.wasm`.

To store this on-chain, we use a similar command to last time:

```bash
sourced tx wasm store cw1_subkeys.wasm  --from <your-key> --chain-id <chain-id> \
  --gas-prices 0.1usource --gas auto --gas-adjustment 1.3 -b block -y
```

Also like last time, look in the JSON output for the `code_id` value. If you would prefer to capture this as a shell variable, for the previous step you can instead do:

```bash
cd artifacts
TX=$(sourced tx wasm store cw1_subkeys.wasm  --from <your-key> --chain-id=<chain-id> --gas auto --output json -y | jq -r '.txhash')
CODE_ID=$(sourced query tx $TX --output json | jq -r '.logs[0].events[-1].attributes[0].value')
```


# Initialize the Contract

{% hint style="danger" %}
We don't specify it here, but in almost all cases you should provide an `--admin` address when instantiating a contract. If you do not, you will not be able to migrate the contract later.
{% endhint %}

CosmWasm Smart Contracts take their arguments as serialized JSON. This can be created a number of ways, but as we showed in the previous examples, it may well be easiest to use the `node` command line, if that is available to you.

{% hint style="info" %}
There is a Typescript helpers file for most contracts, and extensions for CosmJS, but at the time of writing, they are broken. This will no doubt be fixed soon, providing an alternative way of interacting with contracts other than the CLI.
{% endhint %}

To use the node REPL, type `node` in the terminal.

```javascript
const initobj = {
  admins: ["<your-validator-self-delegate-key>"],
  mutable: false
};

< undefined

JSON.stringify(initobj);

< '{"admins":["<your-validator-self-delegate-key>"],"mutable":false}'
```

With these encoded arguments, you can now instantiate the contract, using the `code_id` from the previous step.

```bash
sourced tx wasm instantiate <code-id> '{"admins":["<your-validator-self-delegate-key>"],"mutable":false}' --amount 50000usource --label "CW1 example contract" --from <your-key> --chain-id <chain-id> \
  --gas-prices 0.1usource --gas auto --gas-adjustment 1.3 -b block -y
```

Once the contract is instantiated, you can find out its contract address:

```bash
sourced query wasm list-contract-by-code <code-id>
```

You will need this to interact with the contract.


# Query commands

Some useful commands for querying contract state

### Useful Commands

The CW1 subkeys contract has several useful commands available.

You can query a specific address, to see if it has an allowance:

```bash
sourced query wasm contract-state smart <contract-addr> '{"allowance":{"spender":"<address>"}}' --chain-id <chain-id>
```

You can query to see which keys are admins:

```bash
sourced query wasm contract-state smart <contract-addr> '{"admin_list":{}}' --chain-id <chain-id>
```

Or query to see all allowances:

```bash
sourced query wasm contract-state smart <contract-addr> '{"all_allowances":{}}' --chain-id <chain-id>
```


# Execute commands

Now we complete the task - sending some tokens that have been delegated to a key

## Running commands

As mentioned in the introduction, now we want to:

1. As the admin key (**A**)†, set an allowance for a key (**B**)
2. As the key with an allowance, send tokens from key (**B**) to key (**C**)
3. See tokens arrive at key (**C**)
4. See allowance decrease for key (**B**)

† this is the key that you used to instantiate, and set as an admin. If you are running a validator in the testnet, then it is probably your self-delegate key.

### 1. Add allowance for key B

Using `node`, you can again encode the following arguments:

```javascript
{
  increase_allowance: {
    spender: '<key-B>',
    amount: {
      denom: "usource",
      amount: "2000000"
    }
  }
}
```

Then, as the admin key (**A**), increase key (**B**)'s allowance:

```bash
sourced tx wasm execute <contract-addr> \
  '{"increase_allowance":{"spender":"<key-B>","amount":{"denom":"usource","amount":"2000000"}}}' \
  --from <admin-key-A> \
  --chain-id <chain-id> \
  --gas-prices 0.1usource --gas auto --gas-adjustment 1.3 -b block
```

If you query its allowance, you should see a value of `2000000`:

```bash
sourced query wasm contract-state smart <contract-addr> '{"allowance":{"spender":"<key-B>"}}' --chain-id <chain-id>
```

Should return:

```bash
data:
  balance:
  - amount: "2000000"
    denom: usource
  expires:
    never: {}
```

### 2. Send tokens from key B to key C

First, query the balance of another key, that we did not allocate any tokens to (**C**):

```bash
sourced q bank balances <key-C>
```

Let's say it already has a balance of `500usource` - the command will return:

```bash
balances:
- amount: "500"
  denom: usource
pagination:
  next_key: null
  total: "0"
```

Then, we again need to encode some arguments to JSON for the send:

```javascript
{
  execute: {
    msgs: [{
      bank: {
        send: {
          to_address: "<key-C>",
          amount: [{
            denom: "usource",
            amount: "500"
          }]
        }
      }
    }]
  }
};
```

Once we have the JSON, we can shape an `execute` command:

```bash
sourced tx wasm execute <contract-addr> \
  '{"execute":{"msgs":[{"bank":{"send":{"to_address":"<key-C>","amount":[{"denom":"usource","amount":"500"}]}}}]}}' \
  --from <key-B> \
  --chain-id <chain-id> \
  --gas-prices 0.1usource --gas auto --gas-adjustment 1.3 -b block
```

Note that the `--from` flag is now signing this from the key (**B**) that the admin key (**A**) gave a token balance to. This CW1 Subkeys contract will only work with the native token of the chain, in this case `usource`.

### 3. Check balance of key C

If we query balance again:

```bash
sourced q bank balances <key-C>
```

We expect to see the balance incremented by `500usource`:

```bash
balances:
- amount: "1000"
  denom: usource
pagination:
  next_key: null
  total: "0"
```

### 4. See allowance decrease for key B

Now, if we query the allowance for key B, we should see it has decreased by `500usource`:

```bash
sourced query wasm contract-state smart <contract-addr> '{"allowance":{"spender":"<key-B>"}}' --chain-id <chain-id>
```

```bash
data:
  balance:
  - amount: "1999500"
    denom: usource
  expires:
    never: {}
```

We're done!

Play around some more with increasing and decreasing allowances, or even adding expiries to allowances, to get a better feel for how this works.


# Mainnet: Sourced Installation and Setup

Instruction to install the sourced binary on the Source Mainnet

## Current Mainnet

Below is the Source Chain mainnet and its current status. You will need to know the version tag for installation of the `sourced` binary.

Additional resources, guides, snapshots, and explorers can be found further down at: [Mainnet Resources](https://docs.sourceprotocol.io/nodes-and-validators/mainnet-resources)

For details of upgrades on the current mainnet, as well as syncing, you can check out the Mainnet Repo.

{% embed url="<https://github.com/Source-Protocol-Cosmos/source>" %}

If you get stuck, please ask on [Discord.](https://discord.gg/zj8xxUCeZQ)

| chain-id | Current Github version tag |
| -------- | -------------------------- |
| source-1 | v3.0.1                     |

{% embed url="<https://github.com/Source-Protocol-Cosmos/source>" %}

{% embed url="<https://github.com/Source-Protocol-Cosmos/mainnet>" %}

## Minimum Hardware Requirements

The minimum recommended hardware requirements for running a validator for the Source Chain testnets are:

| Requirements                                                                          |
| ------------------------------------------------------------------------------------- |
| <ul><li>16GB RAM</li><li>200GB of disk space</li><li>2 Cores (modern CPU's)</li></ul> |

{% hint style="warning" %}
These specifications are the minimum recommended. As Source Chain is a smart contract platform, it can at times be very demanding on hardware. Low spec validators WILL get stuck on difficult to process blocks.
{% endhint %}

{% hint style="info" %}
Note that the blockchain accumulate data as the blockchain continues. This means that you will need to expand your storage as the blockchain database gets larger with time.
{% endhint %}

## Choose an Operating System

The operating system you use for your node is entirely your personal preference. You will be able to compile the sourced daemon on most modern linux distributions and recent versions of macOS.

{% hint style="info" %}
For the tutorial, it is assumed that you are using an Ubuntu LTS release.

If you have chosen a different operating system, you will need to modify your commands to suit your operating system.
{% endhint %}

## Install pre-requisites

```bash
# update the local package list and install any available upgrades
sudo apt-get update && sudo apt upgrade -y

# install toolchain and ensure accurate time synchronization
sudo apt install curl tar wget clang pkg-config libssl-dev libleveldb-dev jq build-essential bsdmainutils git make ncdu htop screen unzip bc fail2ban htop -y
```

## Install Go

Follow the instructions [here](https://golang.org/doc/install) to install Go.

For an Ubuntu LTS, you can probably use:

```bash
ver="1.19" && \
wget "https://golang.org/dl/go$ver.linux-amd64.tar.gz" && \
sudo rm -rf /usr/local/go && \
sudo tar -C /usr/local -xzf "go$ver.linux-amd64.tar.gz" && \
rm "go$ver.linux-amd64.tar.gz" && \
echo "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> $HOME/.bash_profile && \
source $HOME/.bash_profile && \
go version
```

## Clone Source Chain Repo

```
git clone https://github.com/Source-Protocol-Cosmos/source.git
```

### Compile sourced binary&#x20;

```
cd ~/source
git fetch
git checkout v3.0.1
make build && make install
```

### Initialize the Source directories and create the local genesis file with the correct chain-id:

```
sourced init <moniker-name> --chain-id=source-1
```

### Create a local key pair (or add existing key):

```
# Create new keypair
sourced keys add <key-name>

# Restore existing source wallet with mnemonic seed phrase.
# You will be prompted to enter mnemonic seed.
sourced keys add <key-name> --recover

# Query the keystore for your public address
sourced keys show <key-name> -a
```

Replace `<key-name>` with a key name of your choosing.

{% hint style="danger" %}
After creating a new key, the key information and seed phrase will be shown. It is essential to write this seed phrase down and keep it in a safe place. The seed phrase is the only way to restore your keys.
{% endhint %}

### Download Genesis File

```
curl -s  https://raw.githubusercontent.com/Source-Protocol-Cosmos/mainnet/master/source-1/genesis.json > ~/.source/config/genesis.json
```

### **Genesis sha256**

```
sha256sum ~/.source/config/genesis.json
```

**This should return:**

```
# ba2261082818227073bd8b49717a9781bf5c440c8e34e21ec72fb15806f047cc
```

### Seed nodes to add to config.toml

```
nano ~/.source/config/config.toml
```

Find the appropriate section and add:

```
# Comma separated list of nodes to keep persistent connections to persistent_peers = 
"96d63849a529a15f037a28c276ea6e3ac2449695@34.222.1.252:26656,0107ac60e43f3b3d395fea706cb54877a3241d21@35.87.85.162:26656"
```

### Set Minimum Gas Price

```
nano ~/.source/config/app.toml

0.25usource
```

### Start the chain

```
sourced start
```

It will take some time to catch up and sync to the network. Check your status with:

```
sourced status
```

### Running in production

Create a systemd file for your Source service:

```
sudo nano /etc/systemd/system/sourced.service
```

Copy and paste the following and update:

```
Description=Source daemon
After=network-online.target

[Service]
User=<YOUR_USERNAME>
ExecStart=/home/<YOUR-USERNAME>/go/bin/sourced start --home /home/<YOUR-USERNAME>/.source
Restart=on-failure
RestartSec=3
LimitNOFILE=4096

[Install]
WantedBy=multi-user.target
```

This assumes $HOME/.source to be your directory for config and data. Your actual directory locations may vary.

Enable and start the new service:

```
sudo systemctl enable sourced
```

```
sudo systemctl start sourced
```

Check status:

```
sourced status
```

Check logs:

```
journalctl -u sourced -f
```

## Setup cosmovisor

Follow [these](https://docs.sourceprotocol.io/nodes-and-validators/setting-up-cosmovisor) instructions to setup cosmovisor and start the node.

## Upgrade to a validator

To upgrade the node to a validator, you will need to submit a `create-validator` transaction:

```bash
sourced tx staking create-validator \
--amount 1000000000usource \
--commission-max-change-rate "0.1" \
--commission-max-rate "0.20" \
--commission-rate "0.1" \
--min-self-delegation "1" \
--details "validators write bios too" \
--pubkey=$(sourced tendermint show-validator) \
--moniker “<key-name>” \
--chain-id sourcechain-testnet \
--gas-prices 0.025usource \
--from <key-name>
```

## Backup critical files

There are certain files that you need to backup to be able to restore your validator if, for some reason, it damaged or lost in some way. Please make a secure backup of the following files located in `~/.source/config/`:

* `priv_validator_key.json`
* `node_key.json`

It is recommended that you encrypt the backup of these files.


# Setting up Cosmovisor

For mainnet, it's recommended to use Cosmovisor to run your node. If you've not used it before, then run it during a testnet to check you can get it set up correctly.

Setting up Cosmovisor is relatively straightforward. However, it does expect certain environment variables and folder structure to be set.

Cosmovisor allows you to download binaries ahead of time for chain upgrades, meaning that you can do zero (or close to zero) downtime chain upgrades. It's also useful if your local timezone means that a chain upgrade will fall at a bad time.

Rather than having to do stressful ops tasks late at night, it's always better if you can automate them away, and that's what Cosmovisor tries to do.

## Install

First, go and get cosmovisor (recommended approach):

```bash
go get github.com/cosmos/cosmos-sdk/cosmovisor/cmd/cosmovisor

# or, with go >= 1.15 you can do
go install github.com/cosmos/cosmos-sdk/cosmovisor/cmd/cosmovisor@latest

# to target a specific version:
go install github.com/cosmos/cosmos-sdk/cosmovisor/cmd/cosmovisor@v1.0.0
```

{% hint style="danger" %}
When using cosmovisor, make sure that you do not have auto download of binaries on.
{% endhint %}

Your installation can be confirmed with:

```bash
which cosmovisor
```

This will return something like:

```bash
/home/<your-user>/go/bin/cosmovisor
```

{% hint style="info" %}
Building from source allows you to target a specific version of Cosmovisor, in case you do not want to run 1.0.0 yet.
{% endhint %}

You can also build from source; cosmovisor is in the main `cosmos-sdk` repo on Github, so you can use Git tags to target a specific version. This example uses a tag, `v0.42.7` that refers to the Cosmos SDK, as Cosmovisor-specific tags did not exist before August 2021. The first of these was `cosmovisor/v0.1.0`, and the second is the current release, `cosmovisor/v1.0.0`.

```bash
git clone https://github.com/cosmos/cosmos-sdk
cd cosmos-sdk
git checkout v0.42.7
make cosmovisor
cp cosmovisor/cosmovisor $GOPATH/bin/cosmovisor
cd $HOME
```

## Add environment variables to your shell

In the `.profile` file, usually located at `~/.profile`, add:

```bash
export DAEMON_NAME=sourced
export DAEMON_HOME=$HOME/.source
```

Then source your profile to have access to these variables:

```bash
source ~/.profile
```

You can confirm success like so:

```
echo $DAEMON_NAME
```

It should return `sourced`.

## Set up folder structure

Cosmovisor expects a certain folder structure:

```bash
.
├── current -> genesis or upgrades/<name>
├── genesis
│   └── bin
│       └── $DAEMON_NAME
└── upgrades
    └── <name>
        └── bin
            └── $DAEMON_NAME
```

Don't worry about `current` - that is simply a symlink used by Cosmovisor. The other folders will need setting up, but this is easy:

```bash
mkdir -p $DAEMON_HOME/cosmovisor/genesis/bin
mkdir -p $DAEMON_HOME/cosmovisor/upgrades
```

## Set up genesis binary

Cosmovisor needs to know which binary to use at genesis. We put this in `$DAEMON_HOME/cosmovisor/genesis/bin`.

First, find the location of the binary you want to use:

```bash
which sourced
```

Then use the path returned to copy it to the directory Cosmovisor expects. Let's assume the previous command returned `/home/your-user/go/bin/sourced`:

```bash
cp /home/<your-user>/go/bin/sourced $DAEMON_HOME/cosmovisor/genesis/bin
```

Once you're done, check the folder structure looks correct using a tool like `tree`.

## Set up service

Commands sent to Cosmovisor are sent to the underlying binary. For example, `cosmovisor version` is the same as typing `sourced version`.

Nevertheless, just as we would manage `sourced` using a process manager, we would like to make sure Cosmovisor is automatically restarted if something happens, for example an error or reboot.

First, create the service file:

```bash
sudo nano /etc/systemd/system/cosmovisor.service
```

Change the contents of the below to match your setup - `cosmovisor` is likely at `~/go/bin/cosmovisor` regardless of which installation path you took above, but it's worth checking.

```
[Unit]
Description=cosmovisor
After=network-online.target

[Service]
User=<your-user>
ExecStart=/home/<your-user>/go/bin/cosmovisor start
Restart=always
RestartSec=3
LimitNOFILE=4096
Environment="DAEMON_NAME=sourced"
Environment="DAEMON_HOME=/home/<your-user>/.source"
Environment="DAEMON_ALLOW_DOWNLOAD_BINARIES=false"
Environment="DAEMON_RESTART_AFTER_UPGRADE=true"
Environment="DAEMON_LOG_BUFFER_SIZE=512"

[Install]
WantedBy=multi-user.target
```

{% hint style="info" %}
A description of what the environment variables do can be found [here](https://docs.cosmos.network/master/run-node/cosmovisor.html). Change them depending on your setup.
{% endhint %}

Note also that we set buffer size explicitly because of a [live bug in Cosmovisor](https://github.com/cosmos/cosmos-sdk/pull/8590) before version `v1.0.0`. If you are using `v1.0.0`, you may omit that line.

In addition, the same issue can be fixed by reducing the log via env variable. If you are unsure, ask on Discord.

## Start Cosmovisor

{% hint style="warning" %}
If syncing from a snapshot, do not start Cosmovisor yet.
{% endhint %}

Finally, enable the service and start it.

```bash
sudo -S systemctl daemon-reload
sudo -S systemctl enable cosmovisor
sudo systemctl start cosmovisor
```

Check it is running using:

```
sudo systemctl status cosmovisor
```

If you need to monitor the service after launch, you can view the logs using:

```bash
journalctl -u cosmovisor -f
```


# Mainnet Setup and Tooling

Preparing for Mainnet

Preparing your validator for mainnet involves a few extra considerations. They are detailed below, but a sensible checklist is:

* How will you handle chain upgrades?
  * consider: **Cosmovisor**
* How will you know your node is up?
  * consider: **Monitoring and alerts**
* How will you mitigate DDOS attacks?
  * consider: **Sentry Nodes**
* How much storage will you need?

Answering these questions can be daunting, so there is some advice below.

### Chain upgrades

In order to streamline chain upgrades and minimise downtime, you may want to set up [cosmovisor](https://docs.cosmos.network/master/run-node/cosmovisor.html) to manage your node. A [guide for this is provided](broken://pages/-MeaB5lqZybb3TZSg7HL) in the Source docs.

### Backups

Backups of chain state are possible using the commands specified [here](https://hub.cosmos.network/main/gaia-tutorials/join-mainnet.html#export-state). If you are using a recent version of Cosmovisor, then the default configuration is that a state backup will be created before upgrades are applied. [This can be turned off using environment flags](https://docs.cosmos.network/master/run-node/cosmovisor.html#command-line-arguments-and-environment-variables).

### Alerting and monitoring

Alerting and monitoring is desirable as well - you are encouraged to explore solutions and find one that works for your setup. Prometheus is available out-of-the box, and there are a variety of open-source tools. Recommended reading:

**Alerting:**

* Tenderduty: <https://github.com/blockpane/tenderduty>
* PANIC: <https://github.com/SimplyVC/panic_cosmos>

**Monitoring:**

* \*\*\*\*<https://medium.com/solar-labs-team/cosmos-how-to-monitoring-your-validator-892a46298722>
* <https://medium.com/simply-vc/cosmos-monitoring-and-alerting-for-validators-8e3f016c9567>
* <https://chainflow.io/cosmos-validator-mission-control/>
* <https://medium.com/cypher-core/cosmos-how-to-set-up-your-own-network-monitoring-dashboard-fe49c63a8271>

#### Simple setup using Grafana Cloud

Using only the raw metrics endpoint provided by `sourced` you can get a working dashboard and alerting setup using Grafana Cloud. This means you don't have to run Grafana on the instance.

1. First, in `config.toml` enable Prometheus. The default metrics port will be `26660`
2. Download Prometheus - this is needed to ship logs to Grafana Cloud.
3. Create a `prometheus.yml` file with your [Grafana Cloud credentials](https://grafana.com/docs/grafana-cloud/reference/create-api-key/) in the Prometheus folder. You can get these via the Grafana UI. Click 'details' on the Prometheus card:

```
global:
  scrape_interval: 15s

scrape_configs:
  - job_name: cosmops
    static_configs:
    - targets: ['localhost:26660']
      labels:
        group: 'cosmops'

remote_write:
  - url: https://your-grafana-cloud-endpoint/api/prom/push
    basic_auth:
      username: ID_HERE
      password: "API KEY HERE"
```

3\. Set up a service file, with `sudo nano /etc/systemd/system/prometheus.service`, replacing `<your-user>` and `<prometheus-folder>` with the location of Prometheus. This sets the Prometheus port to `6666`

```
[Unit]
Description=prometheus
After=network-online.target

[Service]
User=<your-user>
ExecStart=/home/<your-user>/<prometheus-folder>/prometheus --config.file=/home/<your-user>/<prometheus-folder>/prometheus.yml --web.listen-address=:6666 --storage.tsdb.path=/home/<your-user>/<prometheus-folder>/data
Restart=always
RestartSec=3
LimitNOFILE=4096

[Install]
WantedBy=multi-user.target
/etc/systemd/system/prometheus.service
```

4\. Enable and start the service.

```
sudo -S systemctl daemon-reload
sudo -S systemctl enable prometheus
sudo systemctl start prometheus
```

5\. Import a dashboard to your Grafana. Search for 'Cosmos Validator' to find several options. You should see logs arriving in the dashboard after a couple of minutes.

![A simple node dashboard example](/files/RK7lx1Ygm6oq69QcHuZb)

For more info:

* <https://grafana.com/docs/grafana-cloud/quickstart/noagent_linuxnode/>
* <https://forum.cosmos.network/t/monitoring-alerting-for-your-validator/446/28>

### Avoiding DDOS attacks

{% hint style="info" %}
If you are comfortable with server ops, you might want to build out a [Sentry Node Architecture](https://docs.tendermint.com/master/nodes/validators.html) validator to protect against DDOS attacks.
{% endhint %}

The current best practice for running mainnet nodes is a Sentry Node Architecture. There are various approaches, as [detailed here](https://medium.com/@kidinamoto/tech-choices-for-cosmos-validators-27c7242061ea). Some validators advocate co-locating all three nodes in virtual partitions on a single box, using Docker or other virtualisation tools. However, if in doubt, just run each node on a different server.

Bear in mind that Sentries can have pruning turned on, as outlined [here](https://hub.cosmos.network/main/gaia-tutorials/join-mainnet.html#pruning-of-state). It is desirable, but not essential, to have pruning disabled on the validator node itself.

### Managing storage

{% hint style="info" %}
If you are using a cloud services provider, you may want to mount `$HOME` on an externally mountable storage volume, as you may need to shuffle the data onto a larger storage device later. You can specify the `home` directory in most commands, or just use symlinks.
{% endhint %}

Disk space is likely to fill up, so having a plan for managing storage is key.

If you are running sentry nodes:

* 1TB storage for the full node will give you a lot of runway
* 200GB *each* for the sentries with pruning should be sufficient

Managing backups is outside the scope of this documentation, but several validators keep public snapshots and backups.

It is anticipated that state-sync will soon work for wasm chains, although it does not currettly.

### Ballpark costs

To give you an idea of cost, on AWS EBS (other cloud providers are available, or you can run your own hardware), with two backups a day, this runs to roughly:

* $150 for 1TB
* $35 for 200GB
* Total cost: $220

What approach you take for this will depend on whether you are running on physical hardware co-located with you, running in a data centre, or running on virtualised hardware.


# Joining Mainnet

General instructions to join the Source Chain mainnet after network genesis.

## Current Mainnet

Below is the Source Chain mainnet and its current status. You will need to know the version tag for installation of the `sourced` binary.

For details of upgrades on the current mainnet, as well as syncing, you can check out the mainnet repo.

If you get stuck, please ask on Discord.

| chain-id | Current Github version tag |
| -------- | -------------------------- |
| source-1 | v3.0.1                     |

## Minimum Hardware Requirements

The minimum recommended hardware requirements for running a validator for the Source Chain testnets are:

| Requirements                                                                          |
| ------------------------------------------------------------------------------------- |
| <ul><li>16GB RAM</li><li>200GB of disk space</li><li>2 Cores (modern CPU's)</li></ul> |

{% hint style="warning" %}
These specifications are the minimum recommended. As Source Chain is a smart contract platform, it can at times be very demanding on hardware. Low spec validators WILL get stuck on difficult to process blocks.
{% endhint %}

{% hint style="info" %}
Note that the blockchain accumulate data as the blockchain continues. This means that you will need to expand your storage as the blockchain database gets larger with time.
{% endhint %}

## Choose an Operating System

The operating system you use for your node is entirely your personal preference. You will be able to compile the sourced daemon on most modern linux distributions and recent versions of macOS.

{% hint style="info" %}
For the tutorial, it is assumed that you are using an Ubuntu LTS release.

If you have chosen a different operating system, you will need to modify your commands to suit your operating system.
{% endhint %}

## Install pre-requisites

```bash
# update the local package list and install any available upgrades
sudo apt-get update && sudo apt upgrade -y

# install toolchain and ensure accurate time synchronization
sudo apt install curl tar wget clang pkg-config libssl-dev libleveldb-dev jq build-essential bsdmainutils git make ncdu htop screen unzip bc fail2ban htop -y
```

## Install Go

Follow the instructions [here](https://golang.org/doc/install) to install Go.

For an Ubuntu LTS, you can probably use:

```bash
ver="1.19" && \
wget "https://golang.org/dl/go$ver.linux-amd64.tar.gz" && \
sudo rm -rf /usr/local/go && \
sudo tar -C /usr/local -xzf "go$ver.linux-amd64.tar.gz" && \
rm "go$ver.linux-amd64.tar.gz" && \
echo "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> $HOME/.bash_profile && \
source $HOME/.bash_profile && \
go version
```

## Clone Source Chain Repo

```
git clone https://github.com/Source-Protocol-Cosmos/source.git
```

### Compile sourced binary&#x20;

```
cd ~/source
git fetch
git checkout v3.0.1
make build && make install
```

### Initialize the Source directories and create the local genesis file with the correct chain-id:

```
sourced init <moniker-name> --chain-id=source-1
```

### Create a local key pair (or add existing key):

```
# Create new keypair
sourced keys add <key-name>

# Restore existing source wallet with mnemonic seed phrase.
# You will be prompted to enter mnemonic seed.
sourced keys add <key-name> --recover

# Query the keystore for your public address
sourced keys show <key-name> -a
```

Replace `<key-name>` with a key name of your choosing.

{% hint style="danger" %}
After creating a new key, the key information and seed phrase will be shown. It is essential to write this seed phrase down and keep it in a safe place. The seed phrase is the only way to restore your keys.
{% endhint %}

### Download Genesis File

```
curl -s  https://raw.githubusercontent.com/Source-Protocol-Cosmos/mainnet/master/source-1/genesis.json > ~/.source/config/genesis.json
```

[Testnet Genesis Repository and Contributions](https://github.com/Source-Protocol-Cosmos/mainnet)

### **Genesis sha256**

```
sha256sum ~/.source/config/genesis.json
```

**This should return:**

```
# ba2261082818227073bd8b49717a9781bf5c440c8e34e21ec72fb15806f047cc
```

### Seed nodes to add to config.toml

```
nano ~/.source/config/config.toml
```

Find the appropriate section and add:

```
# Comma separated list of nodes to keep persistent connections to persistent_peers = 
"96d63849a529a15f037a28c276ea6e3ac2449695@34.222.1.252:26656,0107ac60e43f3b3d395fea706cb54877a3241d21@35.87.85.162:26656"
```

### Set Minimum Gas Price

```
nano ~/.source/config/app.toml

0.25usource
```

### Start the chain

```
sourced start
```

It will take some time to catch up and sync to the network. Check your status with:

```
sourced status
```

### Running in production

Create a systemd file for your Source service:

```
sudo nano /etc/systemd/system/sourced.service
```

Copy and paste the following and update:

```
Description=Source daemon
After=network-online.target

[Service]
User=<YOUR_USERNAME>
ExecStart=/home/<YOUR-USERNAME>/go/bin/sourced start --home /home/<YOUR-USERNAME>/.source
Restart=on-failure
RestartSec=3
LimitNOFILE=4096

[Install]
WantedBy=multi-user.target
```

This assumes $HOME/.source to be your directory for config and data. Your actual directory locations may vary.

Enable and start the new service:

```
sudo systemctl enable sourced
```

```
sudo systemctl start sourced
```

Check status:

```
sourced status
```

Check logs:

```
journalctl -u sourced -f
```

## Setup cosmovisor

Follow [these](https://docs.sourceprotocol.io/nodes-and-validators/setting-up-cosmovisor) instructions to setup cosmovisor and start the node.

## Upgrade to a validator

To upgrade the node to a validator, you will need to submit a `create-validator` transaction:

```bash
sourced tx staking create-validator \
--amount 1000000000usource \
--commission-max-change-rate "0.1" \
--commission-max-rate "0.20" \
--commission-rate "0.1" \
--min-self-delegation "1" \
--details "validators write bios too" \
--pubkey=$(sourced tendermint show-validator) \
--moniker “<key-name>” \
--chain-id sourcechain-testnet \
--gas-prices 0.025usource \
--from <key-name>
```

## Backup critical files

There are certain files that you need to backup to be able to restore your validator if, for some reason, it damaged or lost in some way. Please make a secure backup of the following files located in `~/.source/config/`:

* `priv_validator_key.json`
* `node_key.json`

It is recommended that you encrypt the backup of these files.


# Mainnet Upgrades

Details of mainnet upgrades

{% hint style="info" %}
Release procedures for validators and node operators are explained here. The `RELEASES.md` file in Source's GitHub repo is the canonical source of truth for release processes.
{% endhint %}

The Source Chain  mainnet is regularly upgraded to provide the latest security patches, Cosmos SDK module integrations and performance improvements.

Some upgrades are able to be undertaken automatically with Cosmovisor while other upgrades need to be manually installed at specified block heights. Others can be installed at any time after their predecessor.

## Upgrade types

There are two types of upgrades that happen on Source Chain. They are:&#x20;

1. **Planned** feature upgrades or planned patches&#x20;
2. **Unplanned** security upgrades.

### Planned upgrade (via governance)

Planned upgrades, as the name suggests, are upgrades that are developed and proposed via governance. If approved by the community, these upgrades are undertaken by the chain automatically halting at the planned upgrade height.&#x20;

Node operators are then required to swap the binary for the planned upgrade binary. After all node operators have upgraded and started their nodes the network will continue in the upgraded state.

### Unplanned upgrade

Where emergency security patches are required, node operators are notified via the official discord validator channels. Node operators will be required to halt their nodes manually at the required upgrade height, swap the patched binary and restart the nodes. After all node operators have upgraded and started their nodes the network will continue in the upgraded state.


# Mainnet Resources

Below you may find resources for Server Hosting, Snapshots, Installation scripts,  Public RPC/GRPC/API Nodes, and Explorers

### Source Github Links

{% embed url="<https://github.com/Source-Protocol-Cosmos/source>" %}

{% embed url="<https://github.com/Source-Protocol-Cosmos/mainnet>" %}

### Automated Server Deployment and Hosting on Akash

{% embed url="<https://deploy.cloudmos.io/templates/akash-network-cosmos-omnibus-source>" %}

### Snapshots, Installation scripts, and Public RPC/GRPC/API Nodes

{% embed url="<https://polkachu.com/networks/source>" %}

{% embed url="<https://app.kaon.kyve.network/#/sources/source-1>" %}

{% embed url="<https://stavr-team.gitbook.io/nodes-guides/mainnets/source>" %}

{% embed url="<https://nodestake.top/source>" %}

{% embed url="<https://services.declab.pro/blockchains-lab/mainnets/source-protocol>" %}

{% embed url="<https://services.stake-town.com/home/mainnet/source>" %}

{% embed url="<https://sr20de.xyz/services/source-mainnet/>" %}

{% embed url="<https://services.kjnodes.com/mainnet/source/>" %}

{% embed url="<https://anode.team/Source/>" %}

{% embed url="<https://services.stakeangle.com/mainnets/source-protocol>" %}

{% embed url="<https://www.skynodejs.net/mainnet/source>" %}

{% embed url="<https://itrocket.net/services/mainnet/source/>" %}

{% embed url="<https://nodeist.net/Source/>" %}

{% embed url="<https://www.synergynodes.com/service/source>" %}

{% embed url="<https://autostake.com/networks/source/#services>" %}

{% embed url="<https://github.com/nexusecurus/cosmosnodeman>" %}

{% embed url="<https://github.com/molla202/Source-mainnet/blob/main/Snapshot.md>" %}

{% embed url="<https://services.moonbridge.team/mainnet/source/install/>" %}

{% embed url="<https://indonode.net/services/mainnet/source>" %}

{% embed url="<https://insights.validatus.com/docs/networks/source-protocol>" %}

{% embed url="<https://nodesrun.com/source-mainnet/>" %}

{% embed url="<https://github.com/molla202/Source-mainnet>" %}
Turkish Guide
{% endembed %}

{% embed url="<https://teletype.in/@lesnik13utsa/eXxigINtA7B>" %}
Russian Guide
{% endembed %}

### Explorers

Please Do Your Research Before Connecting Your Wallet To Any 3rd Party Website Or Application. No One Should Ever Ask You For Your Private Keys/Seed Phrase!&#x20;

{% embed url="<https://ping.pub/source>" %}

{% embed url="<https://explorer.tcnetwork.io/source>" %}

{% embed url="<https://restake.app/source>" %}

{% embed url="<https://explorer.nodestake.top/source/staking>" %}

{% embed url="<https://staking-explorer.com/staking/source>" %}

{% embed url="<https://explorer.posthuman.digital/source>" %}

{% embed url="<https://explorer.stavr.tech/Source-Mainnet/staking>" %}

{% embed url="<https://explorer.declab.pro/Source>" %}

{% embed url="<https://explorer.ist/source>" %}

{% embed url="<https://explorer.moonbridge.team/source>" %}

{% embed url="<https://mainnet.itrocket.net/source/staking>" %}

{% embed url="<https://explorer.nodeshub.online/source/staking/>" %}

{% embed url="<https://explorer.corenodehq.com/source>" %}

{% embed url="<https://explorer.tendermint.roomit.xyz/source-mainnet>" %}

{% embed url="<https://dashboard.oneiricts.com/>" %}

### Registries

{% embed url="<https://cosmos.directory/source>" %}

{% embed url="<https://github.com/cosmos/chain-registry/tree/master/source>" %}

{% embed url="<https://github.com/chainapsis/keplr-chain-registry/blob/main/cosmos/source.json>" %}

{% embed url="<https://github.com/cosmostation/chainlist/tree/main/chain/source>" %}


# Block, Height & State-Sync Source with KSYNC

{% embed url="<https://app.kaon.kyve.network/#/sources/source-1>" %}
<https://app.kaon.kyve.network/#/sources/source-1>
{% endembed %}

The following doc covers a step by step guide on how to sync sourced nodes with validated block data stored with KYVE and how to apply the validated state-sync snapshots at any historical height with KSYNC. This allows Source node operators to sync from genesis to live height without the need of relying on peers and furthermore allows sourced node operators and developers to sync to any historical height within minutes.

For further information about the KYVE Protocol architecture, please take a look at the [documentation](https://docs.kyve.network/protocol_devs/overview).&#x20;

* Block data pool: <https://app.kaon.kyve.network/#/pools/24>
* Snapshot data pool: <https://app.kaon.kyve.network/#/pools/25> (contains state-sync snapshots at a 3,000 block interval)

## Install KSYNC

Install the latest KSYNC version v1.4.5 with&#x20;

```
go install github.com/KYVENetwork/ksync/cmd/ksync@latest
```

Verify the installation with

```
ksync version
```

More information about KSYNC can be found here: <https://docs.kyve.network/ksync>

## Install sourced

If sourced is not installed yet install sourced with

```
git clone 
https://github.com/Source-Protocol-Cosmos/source.git

cd source
git checkout v3.0.1
make build

./sourced version
```

Init source with

```
./sourced init <moniker> –chain-id source-1

curl -s  https://raw.githubusercontent.com/Source-Protocol-Cosmos/mainnet/master/source-1/genesis.json > ~/.source/config/genesis.json
```

## Example 1: Block-Sync from genesis:

Now that everything is installed you can block-sync with KSYNC with the following command:

```
ksync block-sync --binary="/path/to/sourced" --chain-id=kaon-1 --source=source
```

KSYNC will now rapidly sync all blocks until it hits the last block stored by the data pool.

## State-Sync to height 6,000

In order to state-sync to live height simply execute the following command (96,000 is in the time of writing the newest snapshot, if the pool runs for a few more weeks it would be at live height)

```
ksync state-sync --binary="/path/to/sourced" --chain-id=kaon-1 --source=source --target-height=6000 -r
```

After the state-sync is completed you can start syncing blocks from the network normally

```
./sourced start --p2p.seeds=7347b05f140e4ed5d3da7b26c754a486dc1d2ecd@source-mainnet-seed.itrocket.net:32656
```

## Height-Sync to height 9,496

In order to rapidly sync to any historical height within minutes KSYNC uses both state and block-sync to reach the target height as quickly as possible:

```
ksync height-sync --binary="/path/to/sourced" --chain-id=kaon-1 --source=source --target-height=9496 -r
```

After the target height was reached you can inspect the state at this height in order for example to checkout account balances at this specific height.

<br>


# Bridging SRCX from BNB Chain to SOURCE Chain

Bridging SRCX from BNB to SOURCE with DeltaSwap (Planq Network) and IBC

## Disclaimer&#x20;

These instructions are intended for those with and understanding of how transaction work on the blockchain. While Source uses IBC to securely make cross chain transactions to other IBC blockchains, BNB Chain does not use IBC. Therefor a bridge is required to make transactions between BNB Chain and the Cosmos Ecosystem.

Please be sure to follow and understand all the proceeding steps prior to making these transactions. If you send tokens to the wrong address it may be impossible to retrieve them and they may be lost forever.&#x20;

Source Protocol and the partnering bridges can take no responsibility for any errors made or lost tokens as a result. **Continue at your own risk.**

## Prerequisites&#x20;

* [Metamask](https://metamask.io/download/) Browser Extension with an [SRCX](https://docs.sourceprotocol.io/defi/srcx-how-to-purchase) balance on the [BNB Chain](https://chainlist.org/chain/56) as well as a [Planq](https://docs.planq.network/for-users/metamask) Balance on [Planq Network](https://chainlist.org/chain/7070) to pay for fees.
* Cosmos Wallet extension that supports the Source Network such as [KEPLR](https://www.keplr.app/download) or [LEAP](https://leapwallet.io/).

## Introduction

SRCX is a Smart Contract ERC20 token that was initially deployed on the BNB Chain. In order to transfer SRCX to the SOURCE Blockchain and further to the Osmosis DEX, there are a few steps that need to be followed:

* Bridge SRCX ERC20 from BNB to PLANQ Network with DeltaSwap
* Convert SRCX from and ERC20 token to and IBC Token with DeltaSwap Convert
* IBC transfer SRCX from PLANQ to the Source Blockchain
* (Optional) IBC transfer SRCX from SOURCE to OSMOSIS

To summarize SRCX will travel on this path between networks:

BNB<>PLANQ<>SOURCE<>OSMOSIS

## Step 1. DeltaSwap Bridge

DeltaSwap is Bridge between the BNB Chain and the Cosmos Ecosystem through the Planq Network. Additional documentation and guides for DeltaSwap can be found [HERE](https://docs.planq.network/for-users/bridge/deltaswap).

Users should have Metamask installed and connected to both the BNB Chain and Planq Networks.

Go to <https://swap.deltaswap.io/#/transfer> and connect your wallet.&#x20;

<figure><img src="/files/avFi7eDK5LSerOefEzj7" alt=""><figcaption><p>DeltaSwap</p></figcaption></figure>

Set the Source Chain to Binance and the Target Chain to Planq.&#x20;

Under Tokens, select SRCX and choose the amount you want to transfer.

<figure><img src="/files/YnncgvIJ6ywvo7CkvGPG" alt=""><figcaption><p>SRCX/Amount</p></figcaption></figure>

Now fill out the additional fields and prepare to make the trasaction. Double Check every prompt and accept when correct.

<figure><img src="/files/pYIDDXp0vxwPS02TKCKs" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/1oDGEPBj31hYv7qnEq3D" alt="" width="188"><figcaption></figcaption></figure>

Once ready, its time to make your transfer.

<figure><img src="/files/kHeYvBqJk1paL6fYPcSL" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/CjvFXZ7S0n0CeAHqiZII" alt="" width="188"><figcaption></figcaption></figure>

The tokens will transfer to the bridge.

Now you MUST redeem your tokens! Failure to do so could result in a loss of tokens!

<figure><img src="/files/OmR1PtSdcugrnfPQhGlB" alt=""><figcaption></figcaption></figure>

Be sure to add SRCX to Metamask on the Destination chain.

<figure><img src="/files/g9UIvpPHH8N5VMuMyB0V" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/u970V66pdA4INbLq8ksF" alt="" width="178"><figcaption></figcaption></figure>

Congratulations, you have sent SRCX from the BNB Chain and have now recieved them on the Planq Network

## Step 2. DeltaSwap Convert

Now that your SRCX is on the Planq Network, we must convert SRCX from ERC20 (Metamask) to and IBC Token (Keplr/Leap)

For this step, you must transfer or use the same wallet mnemonic from Metamask to Keplr or Leap.

To do this you will:

* Go to your Metamask wallet>Click the 3 dots in the top right corner>click Account Details> Click Show Private Keys> copy private keys
* Go to Keplr or Leap and click the icon in the top right corner then click "Add Account" > Import Existing Account> then paste your private keys from Metamask.

**Disclaimer: Do this at your own risk! Your private keys are your keys to your wallets! These should never be shared and never be imported anywhere else!**

With Keplr or Leap extension open head to <https://deltaswap.io/convert>

Your Wallet should connect to the Convert page and your SRCX balance will be displayed under ERC20. Click Convert and Convert your SRCX to IBC.

<figure><img src="/files/46uOtn3ebQ6Gc5irB5gu" alt=""><figcaption></figcaption></figure>

Now SRCX will display under IBC.

<figure><img src="/files/iV2gwg1Ta07ZwgEgZhqx" alt=""><figcaption></figcaption></figure>

Now we can send SRCX from the Planq Network to the Source Blockchain by clicking the "Send" Icon next to your balance.

Enter your SOURCE address and click send and approve the transaction.

<figure><img src="/files/FvnemI3JiC5OSforvmO3" alt="" width="188"><figcaption></figcaption></figure>

SRCX will now pass through IBC and will arrive to your address on the Source Network.

<figure><img src="/files/lv88Yy8bsXHQzf1IOF1j" alt="" width="375"><figcaption><p>SRCX Shown In Leap Wallet on SOURCE</p></figcaption></figure>

SRCX currently Displays properly in LEAP and on Osmosis. If using Keplr, ERC20 based tokens are not fully supported and may display with the token contract and with out the decimal place.&#x20;

In Keplr SRCX may display as: erc20/0x091F9A57A3F58d758b6572E9d41675918EAC7F09

SRCX has an exponent of 9 decimal places. 1 SRCX may display as 1,000,000,000 erc20/0x091F9A57A3F58d758b6572E9d41675918EAC7F09 as seen below.

<figure><img src="/files/kPqDO4DNriXJ4VnnmARZ" alt="" width="180"><figcaption><p>SRCX in KEPLR on SOURCE and OSMOSIS</p></figcaption></figure>

IBC Transfer SRCX Between The SOURCE Blockchain and OSMOSIS

Now that SRCX is on the Source Blockchain. Regular IBC transfers between SOURCE and OSMOSIS can take place. You can do this manually in your wallet as described [here](https://docs.sourceprotocol.io/source-chain/how-to-ibc-transfer) or you can do this directly on OSMOSIS by using the Deposit and Withdraw features on the Assets page to transfer the token between networks.

<figure><img src="/files/46NbCJqeQ5ePQUpYNHzu" alt=""><figcaption><p>SRCX on OSMOSIS</p></figcaption></figure>


# Source Market

A web3 application native to the SOURCE blockchain network for peer-to-peer lending, borrowing, and staking digital assets

## Background

Outside of a small portion of stablecoins and market protocols such as UST, DAI and USDC, the top 200 coins by market cap do not have their own liquidity backing and are rooted in easily manipulated and speculative psychological valuations. For that reason, these protocols and applications are completely reliant upon daily transaction volume, the support of centralized exchanges and market participation, leaving them vulnerable to market instability, skepticism, slower adoption, volatile price fluctuations, and more.

With this in mind, the Source team has architected a robust peer-to-peer web3.0 application that prioritizes solvency, ease of use, and automation. The concepts and functions have been in development since 2017 and the application will serve as the foundation for white label blockchain solutions. This will set SOURCE beyond the crippling speculative valuation of legacy digital assets. While speculation has its place in creating market volatility, a truly solvent protocol will continue to drive growth and valuation that is no longer purely speculative alone. **The solvency of SOURCE Market in conjunction with enterprise-grade white labelled applications will ignite a path toward mass adoption.**

## What is Source Market?

**Source Market is an interoperable and decentralized peer-to-peer application for lending, borrowing and staking crypto assets**, and eventually other assets like NFTs, virtual real estate, synthetic stocks, etc. Built on the SOURCE network, Source Market is being developed to be capable of supporting a variety of traditionally-siloed blockchains and audited crypto assets. Equipped with automated proprietary protocols designed to achieve solvency and self-sustainability, Source Market will be a safe and secure environment for retail and institutional users, but more importantly, it will provide the foundation for white-labeled blockchain solutions that will be seamlessly integrated into enterprise-grade applications.

Source Market will support blue chip crypto assets such as Bitcoin, Ethereum, XRP, Cardano, BNB, and various stable coins like USDC, DAI, TUSD, BUSD, USDT, and as mentioned above, has plans to support a variety of assets from several chains in the future. The total supplied market asset value is what determines the market's TVL (Total Value Locked). The TVL is what supports the backing of SOURCE’s native and decentralized stablecoin, Source USX (USX). ​

Market participants can lend and borrow against their collateralized digital assets and earn APY, or mint USX by-the-block within the marketplace. When assets are lent to the APY smart contract position, there is no time term or lockup period. The contract remains in interest gaining APY position as long as the user deems to acquire APY for their lent assets. Each digital asset has a specific collateralization ratio based on risk and volatility, which typically ranges up to 80%. Value can be collateralized by any user's smart contract asset position at an interest rate with no term requirements. If and when the amount borrowed extends beyond the specific collateralization ratio, the loan will begin to accrue higher interest and can be liquidated by the liquidation engine. Source Market allows access to instant on-demand liquidity and allows users to always retain custody of their funds.

Source Market utilizes the SOURCE native governance and reward token, a stable-coin named SourceUSX (USX), and in the future, a merchant processing token named PROCXSS (PRSX), to support its various service offerings and functionality.

![Source Marketplace UI Teaser](/files/B7ZJHUb7LwGPOrqEKw6b)

## **Source USX (USX)**

USX is Source Protocol’s Native Stablecoin. It is backed by a basket of crypto assets that are supplied by SRCX’s DCLP function and also by the assets supplied by Source Marketplace users. With our unique asset-backing mechanisms, USX will be a trusted and solvent stablecoin and hedge, not just for Source Marketplace, but the crypto ecosystem at large. USX is burned and minted to stabilize its valuation to the Total Value Locked (TVL) within Source One.

## **​Procxss (PRSX)**

PRSX is a utility token linked to Source One that will be developed as an integrative solution for merchant processing and credit card payments. We plan on implementing a mobile dApp that allows fiat onboarding capabilities, as well as P2P payments within fiat and crypto. Procxss will enable crypto and non-crypto users to utilize blockchain transaction capabilities in and out of Source Marketplace and various protocols.&#x20;

## Governance

SOURCE native tokens are used for controlling governance over the Source Market. Holders of SOURCE tokens can vote on proposals that make changes to variables and parameters that control how the Market application functions, add new S Tokens to the application, delegate protocol reserve distribution schedules, and adjust variable and fixed interest rates for assets and stablecoins. They are open to vote on for a period of 3 days after which they either pass or fail. If a proposal is passed successfully, the development team begins implementing the changes into the protocol which takes approximately 1 to 2 weeks. SOURCE tokens can also be delegated to active governance participants to vote on their behalf.&#x20;

## sTokens

The Source One Market uses "sTokens" to represent a user's supplied collateral of a Binance Smart Chain asset. These tokens are smart contracts that act as a receipt of collateral that the user receives after executing a "supply" contract. They can be redeemed at a 1:1 value of their underlying asset in the marketplace protocol at any time by the user. These tokens are only redeemable in the underlying asset they represent. Therefore, sBNB can only be used to redeem BNB, sETH can only be used to redeem ETH, sADA can only be used to redeem ADA, etc.

For example, Bob supplies 1.5 BNB (smart chain network) to the marketplace protocol by approving and executing the BNB "supply" contract function with his Binance smart chain wallet. In return he will receive 1.5 sBNB that can be used at any time to redeem the original 1.5 BNB. When Bob is ready to claim his original BNB he can approve and execute the "withdraw" contract function. Once the withdraw contract is executed, Bob's 1.5 BNB is returned to him in exchange for his 1.5 sBNB that is simultaneously returned to the market and burned.

## Suppliers

Source One Market suppliers are incentivized to supply their Binance Smart Chain digital assets to the protocol so they can earn APY. Suppliers receive sTokens as mentioned above in exchange for positioning their assets as collateral into the protocol. The value of collateral supplied is used to determine how much value the participant can then borrow. Supplied digital assets also earn APY at variable rates that are determined by market utilization.

## Borrowers

Once a market participant has supplied digital assets as collateral, he/she will have the ability to borrow against that collateral. Collateralization ratios typically range up to 80% and are particular to each digital asset. The average collateralization ratio is 60%. So if Alice supplies $100,000 of digital assets to the marketplace protocol, she will typically be able to borrow up to $60,000 at an interest rate that is set by the protocol based on market utilization.

## Risk & Liquidation

If a participant's borrow limit exceeds their collateralization ratio due to market volatility of their underlying assets, they are at risk of liquidation. For example, if Alice borrows 100% of her borrow limit of $60,000 and then her supplied collateral value drops to $95,000, a liquidation event will occur and use her supplied collateral to bring her collateral ratio back to 60%. Alice will also only be able to withdraw her supplied collateral when her loan is paid back.

## Interest Rates

Source Market uses compounding interest rates to incentivize supplying and borrowing on the protocol. The interest rates are variable based on an asset's market utilization. When a supplied asset is under-utilized, its interest rate will increase to incentivize suppliers to earn a higher APY. When a supplied asset is over-utilized, the APY for supplying will be reduced. In contrast, when a borrowed asset is under-utilized, its interest rate will decrease to incentivize borrowers to borrow at lower rates. When a borrowed asset is over-utilized, its interest rate will increase as a way to incentivize borrowers to pay off their loans.


# Introduction

Getting Started

## Introduction

These docs are a comprehensive guide to the Source Market, based on the Source Whitepaper. The protocol codebase is hosted on Github, and will be maintained by the team and the community.

Please join the Source Community [Telegram](https://t.me/sourceprotocol) and [Discord](https://discord.com/invite/zj8xxUCeZQ). Your questions help us improve, so please don't hesitate to ask if you can't find what you are looking for here.

## Protocol Math

The Source One Market contracts use a system of exponential math,Exponential.sol, in order to represent fractional quantities with sufficient precision.

Most numbers are represented as a mantissa, an unsigned integer scaled by 1 \* 10 ^ 18, in order to perform basic math at a high level of precision.

## sToken and Underlying Decimals

Prices and exchange rates are scaled by the decimals unique to each asset; sTokens are BEP-20 tokens with 8 decimals, while their underlying tokens vary, and have a public member named decimals.

| sToken | sToken Decimals | Underlying | Underlying Decimals |
| ------ | --------------- | ---------- | ------------------- |
| sBNB   | 8               | BNB        | 18                  |
| sBUSD  | 8               | BUSD       | 18                  |
| sUSDC  | 8               | USDC       | 18                  |
| sUSDT  | 8               | USDT       | 18                  |
| sSRCX  | 8               | SRCX       | 9                   |

## Interpreting Exchange Rates

The sToken Exchange Rates is scaled by the difference in decimals between the sToken and the underlying asset.

```javascript
onesTokenInUnderlying = exchangeRateCurrent / (1  *  10  ^  (18  + underlyingDecimals - sTokenDecimals)
```

Here is an example of finding the value of 1 sBUSD in BUSD with Web3.js JavaScript.

```javascript
const sTokenDecimals = 8; // all sTokens have 8 decimal places
const underlying = new web3.eth.Contract(bep20Abi, busdAddress);
const sToken = new web3.eth.Contract(sTokenAbi, sBusdAddress);
const underlyingDecimals = await underlying.methods.decimals().call();
const exchangeRateCurrent = await sToken.methods.exchangeRateCurrent().call();
const mantissa = 18 + parseInt(underlyingDecimals) - sTokenDecimals;
const onesTokenInUnderlying = exchangeRateCurrent / Math.pow(10, mantissa);
console.log('1 sBUSD can be redeemed for', oneSTokenInUnderlying, 'BUSD');
```

There is no underlying contract for BNB, so to do this with sBNB, set underlyingDecimals to 18.

To find the number of underlying tokens that can be redeemed for sTokens, divide the number of sTokens by the above value oneSTokenInUnderlying.

```javascript
underlyingTokens = sTokenAmount * oneSTokenInUnderlying
```

## Calculating Accrued Interest

Interest rates for each market update on any block in which the ratio of borrowed assets to supplied assets in the market has changed. The amount interest rates are changed depends on the interest rate model smart contract implemented for the market, and the amount of change in the ratio of borrowed assets to supplied assets in the market.

See the interest rate data visualization notebook on Observable to visualize which interest rate model is currently applied to each market.

Historical interest rates can be retrieved from the MarketHistoryServiceAPI.

Interest accrues to all suppliers and borrowers in a market when any BSC address interacts with the market’s sToken contract, calling one of these functions: mint, redeem, borrow, or repay. Successful execution of one of these functions triggers the accrueInterest method, which causes interest to be added to the underlying balance of every supplier and borrower in the market. Interest accrues for the current block, as well as each prior block in which the accrueInterest method was not triggered (no user interacted with the sToken contract). Interest Source One only during blocks in which the sToken contract has one of the aforementioned methods invoked.

Here is an example of supply interest accrual:

Alice supplies 1 BNB to the Source One Market At the time of supply, the supplyRatePerBlock is 37893605 Wei, or 0.000000000037893605 BNB per block. No one interacts with the sBNB contract for 3 BSC blocks. On the subsequent 4th block, Bob borrows some BNB. Alice’s underlying balance is now 1.000000000151574420 BNB (which is 37893605 Wei times 4 blocks, plus the original 1 BNB). Alice’s underlying BNB balance in subsequent blocks will have interest accrued based on the new value of 1.000000000151574420 BNB instead of the initial 1 BNB. Note that the supplyRatePerBlock value may change at any time.

## Calculating the APY Using Rate Per Block

The Annual Percentage Yield (APY) for supplying or borrowing in each market can be calculated using the value of supplyRatePerBlock (for supply APY) or borrowRatePerBlock (for borrow APY) in this formula:

```javascript
Rate = sToken.supplyRatePerBlock(); // Integer
Rate = 37893566
BNB Mantissa = 1 * 10 ^ 18 (BNB has 18 decimal places)
Blocks Per Day = 20 * 60 * 24 (based on 20 blocks occurring every minute)
Days Per Year = 365

APY = ((((Rate / BNB Mantissa * Blocks Per Day + 1) ^ Days Per Year - 1)) - 1) * 100
```

Here is an example of calculating the supply and borrow APY with Web3.js JavaScript:

```javascript
const ethMantissa = 1e18;
const blocksPerDay = 20 * 60 * 24;
const daysPerYear = 365;

const sToken = new web3.eth.Contract(sBnbAbi, sBnbAddress);
const supplyRatePerBlock = await sToken.methods.supplyRatePerBlock().call();
const borrowRatePerBlock = await sToken.methods.borrowRatePerBlock().call();
const supplyApy = (((Math.pow((supplyRatePerBlock / bnbMantissa * blocksPerDay) + 1,
const borrowApy = (((Math.pow((borrowRatePerBlock / bnbMantissa * blocksPerDay) + 1,
console.log(`Supply APY for BNB ${supplyApy} %`);
console.log(`Borrow APY for BNB ${borrowApy} %`);
```

## Gas Costs

The gas usage of the protocol functions may fluctuate by market and user. External calls, such as to underlying BEP-20 tokens, may use an arbitrary amount of gas. Any calculations that involve checking account liquidity , have gas costs that increase with the number of entered markets. Thus, while it can be difficult to provide any guarantees about costs, we provide the table below for guidance:

| Function         | Typical Gas Cost                     |
| ---------------- | ------------------------------------ |
| Mint             | < 200K, sDAI < 300k                  |
| Redeem, Transfer | < 200K if borrowing, otherwise < 90K |
| Borrow           | < 300K                               |
| Repay Borrow     | < 90K                                |
| Liquidate Borrow | < 400K                               |


# sTokens

## Introduction

Each asset supported by the Source One Market is integrated through a sToken contract, which is an EIP-20 compliant representation of balances supplied to the protocol. By minting sTokens, users (1) earn interest through the sToken's exchange rate, which increases in value relative to the underlying asset, and (2) gain the ability to use sTokens as collateral.

sTokens are the primary means of interacting with the Source One Market; when a user mints, redeems, borrows, repays a borrow, liquidates a borrow, or transfers sTokens, she will do so using the sToken contract.

There are currently two types of sTokens: SBep20 and SBnb. Though both types expose the EIP-20 interface, SBep20 wraps an underlying BEP-20 asset, while SBnb simply wraps BNB itself. As such, the core functions which involve transferring an asset into the protocol have slightly different interfaces depending on the type, each of which is shown below.

## Mint

The mint function transfers an asset into the protocol, which begins accumulating interest based on the current Supply Rate for the user receives a quantity of sTokens equal to the underlying tokens tokens supplied, divided by the current Exchange Rate.

#### SBep20

```javascript
function mint(uint mintAmount) returns (uint)
```

* msg.sender: The account which shall supply the asset, and own the minted sTokens.
* mintAmount: The amount of the asset to be supplied, in units of the underlying asset.
* RETURN: 0 on success, otherwise an Error code

Before supplying an asset, users must first [approve](https://eips.ethereum.org/EIPS/eip-20#approve) the sToken to access their token balance.

#### SBnb

```javascript
function mint() payable
```

* msg.value: payable The amount of ether to be supplied, in wei.&#x20;
* msg.sender: The account which shall supply the bnb, and own the minted sTokens.&#x20;
* RETURN: No return, reverts on error.

#### Solidity

```javascript
Bep20 underlying = Bep20(0xToken...);     // get a handle for the underlying asset
SBep20 sToken = SBep20(0x3FDA...);        // get a handle for the corresponding vToken Contract
underlying.approve(address(sToken), 100); // approve the transfer
assert(sToken.mint(100) == 0);            // mint the sTokens and assert there is no error
```

#### Web3 1.0

```javascript
const sToken = SBep20.at(0x3FDB...);
await sToken.methods.mint().send({from: myAccount, value: 50});
```

## Redeem

The redeem function converts a specified quantity of sTokens into the underlying asset, and returns them to the user. The amount of underlying tokens received is equal to the quantity of sTokens redeemed, multiplied by the current Exchange Rate. The amount redeemed must be less than the user's Account Liquidity and the market's available liquidity.

#### SBep20 / SBnb

```javascript
function redeem(uint redeemTokens) returns (uint)
```

* msg.value: The account to which redeemed funds shall be transferred.
* redeemTokens: The number of sTokens to be redeemed.
* RETURN: 0 on success, otherwise an Error code

#### Solidity

```javascript
SBnb sToken = SBnb(0x3FDB...);
require(sToken.redeem(7) == 0, "something went wrong");
```

#### Web3 1.0

```javascript
const sToken = SBep20.at(0x3FDA...);
sToken.methods.redeem(1).send({from: ...});
```

## Redeem Underlying

The redeem underlying function converts sTokens into a specified quantity of the underlying asset, and returns them to the user. The amount of sTokens redeemed is equal to the quantity of underlying tokens received, divided by the current Exchange Rate. The amount redeemed must be less than the user's Account Liquidity and the market's available liquidity.

SBep20 / SBnb

```javascript
function redeemUnderlying(uint redeemAmount) returns (uint)
```

* msg.sender: The account to which redeemed funds shall be transferred.
* redeemAmount: The amount of underlying to be redeemed.
* RETURN: 0 on success, otherwise an Error code

#### Solidity

```
SBnb sToken = SBnb(0x3FDB...);
require(sToken.redeemUnderlying(50) == 0, "something went wrong");
```

#### Web3 1.0

```javascript
const sToken = SBep20.at(0x3FDA...);
sToken.methods.redeemUnderlying(10).send({from: ...});

```

## Borrow

The borrow function transfers an asset from the protocol to the user, and creates a borrow balance which begins accumulating interest based on the Borrow Rate for the asset. The amount borrowed must be less than the user's Account Liquidity and the market's available liquidity.To borrow Ether, the borrower must be 'payable' (solidity).

#### SBep20 / SBnb

```javascript
function borrow(uint borrowAmount) returns (uint)

```

* msg.sender: The account to which redeemed funds shall be transferred.
* redeemAmount: The amount of underlying to be redeemed.
* RETURN: 0 on success, otherwise an Error code

#### Solidity

```javascript
SBnb sToken = SBnb(0x3FDB...);
require(sToken.borrow(100) == 0, "got collateral?");
```

#### Web3 1.0

```javascript
const sToken = SBep20.at(0x3FDA...);
await sToken.methods.borrow(50).send({from: 0xMyAccount});

```

## Repay Borrow

The repay function transfers an asset into the protocol, reducing the user's borrow balance.

#### SBep20

```javascript
function repayBorrow(uint repayAmount) returns (uint)
```

* msg.sender: The account which borrowed the asset, and shall repay the borrow.
* borrowAmount: The amount of the underlying borrowed asset to be repaid. A value of -1 (i.e. 2256 - 1) can be used to repay the full amount.
* RETURN: 0 on success, otherwise an Error code

Before repaying an asset, users must first [approve](https://eips.ethereum.org/EIPS/eip-20#approve) the sToken to access their token balance.

#### SBnb

```javascript
function repayBorrow() payable
```

* msg.value: payable The amount of ether to be repaid, in wei.&#x20;
* msg.sender: The amount which borrowed the asset, and shall repay the borrow&#x20;
* RETURN: No return, reverts on error

#### Solidity

```javascript
SBnb sToken = SBnb(0x3FDB...);
require(sToken.repayBorrow.value(100)() == 0, "transfer approved?");
```

#### Web3 1.0

```javascript
const sToken = SBep20.at(0x3FDA...);
sToken.methods.repayBorrow(10000).send({from: ...});

```

## Repay Borrow Behalf

The repay function transfers an asset into the protocol, reducing the target user's borrow balance.

#### SBep20

```javascript
1function repayBorrowBehalf(address borrower, uint repayAmount) returns (uint)
```

* msg.sender: The account which shall repay the borrow.
* borrower: The account which borrowed the asset to be repaid.
* repayAmount: The amount of the underlying borrowed asset to be repaid. A value of -1 (i.e. 2256 - 1) can be used to repay the full amount.
* RETURN: 0 on success, otherwise an Error code

Before repaying an asset, users must first [approve](https://eips.ethereum.org/EIPS/eip-20#approve) the sToken to access their token balance.

#### SBnb

```javascript
1function repayBorrowBehalf(address borrower) payable
```

* msg.value: payable The amount of ether to be repaid, in wei.&#x20;
* msg.sender: The account which shall repay the borrow&#x20;
* borrower: The account which borrowed the asset to be repaid&#x20;
* RETURN: No return, reverts on error

Solidity

```javascript
SBnb sToken = SBnb(0x3FDB...);
require(sToken.repayBorrowBehalf.value(100)(0xBorrower) == 0, "transfer approved?");
```

Web3 1.0

```javascript
const sToken = SBep20.at(0x3FDA...);
await sToken.methods.repayBorrowBehalf(0xBorrower, 10000).send({from: 0xPayer});

```

## Liquidate Borrow

A user who has negative account liquidity is subject to liquidation by other users of the protocol to return his/her account liquidity back to positive (i.e. above the collateral requirement). When a liquidation occurs, a liquidator may repay some or all of an outstanding borrow on behalf of a borrower and in return receive a discounted amount of collateral held by the borrower; this discount is defined as the liquidation incentive.

A liquidator may close up to a certain fixed percentage (i.e. close factor) of any individual outstanding borrow of the underwater account. Unlike in v1, liquidators must interact with each sToken contract in which they wish to repay a borrow and seize another asset as collateral. When collateral is seized, the liquidator is transferred sTokens, which they may redeem the same as if they had supplied the asset themselves. Users must approve each sToken contract before calling liquidate (i.e. on the borrowed asset which they are repaying), as they are transferring funds into the contract.

#### SBep20

```javascript
function liquidateBorrow(address borrower, uint amount, address collateral) returns (uint)
```

* msg.sender: The account which shall liquidate the borrower by repaying their debt and seizing their collateral.
* borrower: The account with negative account liquidity that shall be liquidated.
* repayAmount: The amount of the borrowed asset to be repaid and converted into collateral, specified in units of the underlying borrowed asset.
* sTokenCollateral: The address of the sToken currently held as collateral by a borrower, that the liquidator shall seize.
* RETURN: 0 on success, otherwise an Error code

Before repaying an asset, users must first approve the sToken to access their token balance.

#### SBnb

```javascript
function liquidateBorrow(address borrower, address sTokenCollateral) payable
```

* msg.value: payable The amount of ether to be repaid and converted into collateral, in wei.
* msg.sender: The account which shall liquidate the borrower by repaying their debt and seizing their collateral.&#x20;
* borrower: The account with negative account liquidity that shall be liquidated.&#x20;
* sTokenCollateral: The address of the sToken currently held as collateral by a borrower, that the liquidator shall seize.&#x20;
* RETURN: No return, reverts on error

#### Solidity

```javascript
SBnb sToken = SBnb(0x3FDB...);
SBep20 sTokenCollateral = SBep20(0x3FDA...);
require(sToken.liquidateBorrow.value(100)(0xBorrower, sTokenCollateral) == 0, "borrower underwater??");
```

#### Web3 1.0

```javascript
const sToken = SBep20.at(0x3FDA...);
const sTokenCollateral = SBnb.at(0x3FDB...);
await sToken.methods.liquidateBorrow(0xBorrower, 33, sTokenCollateral).send({from: 0xLiquidator});
```

## Key Events

| Function                                                                                                            | Description                                            |
| ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------ |
| Mint(address minter, uint mintAmount, uint mintTokens)                                                              | <p>Emitted upon a successful Mint.<br></p>             |
| Redeem(address redeemer, uint redeemAmount, uint redeemTokens)                                                      | <p>Emitted upon a successful Redeem.<br></p>           |
| Borrow(address borrower, uint borrowAmount, uint accountBorrows, uint totalBorrows)                                 | <p>Emitted upon a successful Borrow.<br></p>           |
| RepayBorrow(address payer, address borrower, uint repayAmount, uint accountBorrows, uint totalBorrows)              | <p>Emitted upon a successful Repay Borrow.<br></p>     |
| LiquidateBorrow(address liquidator, address borrower, uint repayAmount, address sTokenCollateral, uint seizeTokens) | <p>Emitted upon a successful Liquidate Borrow.<br></p> |

## Error Codes

<table><thead><tr><th width="150">Code</th><th width="337">Name</th><th>Description</th></tr></thead><tbody><tr><td>0</td><td>NO_ERROR</td><td>Not a failure.</td></tr><tr><td>1</td><td>UNAUTHORIZED</td><td>The sender is not authorized to perform this action.</td></tr><tr><td>2</td><td>BAD_INPUT</td><td>An invalid argument was supplied by the caller.</td></tr><tr><td>3</td><td>PRSXTROLLER_REJECTION</td><td>The action would violate the PRSXtroller policy.</td></tr><tr><td>4</td><td>PRSXTROLLER_CALCULATION_ERROR</td><td>An internal calculation has failed in the PRSXtroller.</td></tr><tr><td>5</td><td>INTEREST_RATE_MODEL_ERROR</td><td>The interest rate model returned an invalid value.</td></tr><tr><td>6</td><td>INVALID_ACCOUNT_PAIR</td><td>The specified combination of accounts is invalid.</td></tr><tr><td>7</td><td>INVALID_CLOSE_AMOUNT_REQUESTED</td><td>The amount to liquidate is invalid.</td></tr><tr><td>8</td><td>INVALID_COLLATERAL_FACTOR</td><td>The collateral factor is invalid.</td></tr><tr><td>9</td><td>MATH_ERROR</td><td>A math calculation error occurred.</td></tr><tr><td>10</td><td>MARKET_NOT_FRESH</td><td>Interest has not been properly accrued.</td></tr><tr><td>11</td><td>MARKET_NOT_LISTED</td><td>The market is not currently listed by its unitroller.</td></tr><tr><td>12</td><td>TOKEN_INSUFICIENT_ALLOWANCE</td><td>BEP-20 contract must allow Money Market contract to call transferFrom. The current allowance is either 0 or less than the requested supply, repayBorrow or liquidate amount.</td></tr><tr><td>13</td><td>TOKEN_INSUFFICIENT_BALANCE</td><td>Caller does not have sufficient balance in the BEP-20 contract to complete the desired action.</td></tr><tr><td>14</td><td>TOKEN_INSUFFICIENT_CASH</td><td>The market does not have a sufficient cash balance to complete the transaction. You may attempt this transaction again later.</td></tr><tr><td>15</td><td>TOKEN_TRANSFER_IN_FAILED</td><td>Failure in BEP-20 when transfering token into the market.</td></tr><tr><td>16</td><td>TOKEN_TRANSFER_OUT_FAILED</td><td>Failure in BEP-20 when transfering token out of the market.</td></tr></tbody></table>

## Failure Info

| Code | Name                                                              |
| ---- | ----------------------------------------------------------------- |
| 0    | ACCEPT\_ADMIN\_PENDING\_ADMIN\_CHECK                              |
| 1    | ACCRUE\_INTEREST\_ACCUMULATED\_INTEREST\_CALCULATION\_FAILED      |
| 2    | ACCRUE\_INTEREST\_BORROW\_RATE\_CALCULATION\_FAILED               |
| 3    | ACCRUE\_INTEREST\_NEW\_BORROW\_INDEX\_CALCULATION\_FAILED         |
| 4    | ACCRUE\_INTEREST\_NEW\_TOTAL\_BORROWS\_CALCULATION\_FAILED        |
| 5    | ACCRUE\_INTEREST\_NEW\_TOTAL\_RESERVES\_CALCULATION\_FAILED       |
| 6    | ACCRUE\_INTEREST\_SIMPLE\_INTEREST\_FACTOR\_CALCULATION\_FAILED   |
| 7    | BORROW\_ACCUMULATED\_BALANCE\_CALCULATION\_FAILED                 |
| 8    | BORROW\_ACCRUE\_INTEREST\_FAILED                                  |
| 9    | BORROW\_CASH\_NOT\_AVAILABLE                                      |
| 10   | BORROW\_FRESHNESS\_CHECK                                          |
| 11   | BORROW\_NEW\_TOTAL\_BALANCE\_CALCULATION\_FAILED                  |
| 12   | BORROW\_NEW\_ACCOUNT\_BORROW\_BALANCE\_CALCULATION\_FAILED        |
| 13   | BORROW\_MARKET\_NOT\_LISTED                                       |
| 14   | BORROW\_UNITROLLER\_REJECTION                                     |
| 15   | LIQUIDATE\_ACCRUE\_BORROW\_INTEREST\_FAILED                       |
| 16   | LIQUIDATE\_ACCRUE\_COLLATERAL\_INTEREST\_FAILED                   |
| 17   | LIQUIDATE\_COLLATERAL\_FRESHNESS\_CHECK                           |
| 18   | LIQUIDATE\_UNITROLLER\_REJECTION                                  |
| 19   | LIQUIDATE\_UNITROLLER\_CALCULATE\_AMOUNT\_SEIZE\_FAILED           |
| 20   | LIQUIDATE\_CLOSE\_AMOUNT\_IS\_UINT\_MAX                           |
| 21   | LIQUIDATE\_CLOSE\_AMOUNT\_IS\_ZERO                                |
| 22   | LIQUIDATE\_FRESHNESS\_CHECK                                       |
| 23   | LIQUIDATE\_LIQUIDATOR\_IS\_BORROWER                               |
| 24   | LIQUIDATE\_REPAY\_BORROW\_FRESH\_FAILED                           |
| 25   | LIQUIDATE\_SEIZE\_BALANCE\_INCREMENT\_FAILED                      |
| 26   | LIQUIDATE\_SEIZE\_BALANCE\_DECREMENT\_FAILED                      |
| 27   | LIQUIDATE\_SEIZE\_UNITROLLER\_REJECTION                           |
| 28   | LIQUIDATE\_SEIZE\_LIQUIDATOR\_IS\_BORROWER                        |
| 29   | LIQUIDATE\_SEIZE\_TOO\_MUCH                                       |
| 30   | MINT\_ACCRUE\_INTEREST\_FAILED                                    |
| 31   | MINT\_UNITROLLER\_REJECTION                                       |
| 32   | MINT\_EXCHANGE\_CALCULATION\_FAILED                               |
| 33   | MINT\_EXCHANGE\_RATE\_READ\_FAILED                                |
| 34   | MINT\_FRESHNESS\_CHECK                                            |
| 35   | MINT\_NEW\_ACCOUNT\_BALANCE\_CALCULATION\_FAILED                  |
| 36   | MINT\_NEW\_TOTAL\_SUPPLY\_CALCULATION\_FAILED                     |
| 37   | MINT\_TRANSFER\_IN\_FAILED                                        |
| 38   | MINT\_TRANSFER\_IN\_NOT\_POSSIBLE                                 |
| 39   | REDEEM\_ACCRUE\_INTEREST\_FAILED                                  |
| 40   | REDEEM\_UNITROLLER\_REJECTION                                     |
| 41   | REDEEM\_EXCHANGE\_TOKENS\_CALCULATION\_FAILED                     |
| 42   | REDEEM\_EXCHANGE\_AMOUNT\_CALCULATION\_FAILED                     |
| 43   | REDEEM\_EXCHANGE\_RATE\_READ\_FAILED                              |
| 44   | REDEEM\_FRESHNESS\_CHECK                                          |
| 45   | REDEEM\_NEW\_ACCOUNT\_BALANCE\_CALCULATION\_FAILED                |
| 46   | REDEEM\_NEW\_TOTAL\_SUPPLY\_CALCULATION\_FAILED                   |
| 47   | REDEEM\_TRANSFER\_OUT\_NOT\_POSSIBLE                              |
| 48   | REDUCE\_RESERVES\_ACCRUE\_INTEREST\_FAILED                        |
| 49   | REDUCE\_RESERVES\_ADMIN\_CHECK                                    |
| 50   | REDUCE\_RESERVES\_CASH\_NOT\_AVAILABLE                            |
| 51   | REDUCE\_RESERVES\_FRESH\_CHECK                                    |
| 52   | REDUCE\_RESERVES\_VALIDATION                                      |
| 53   | REPAY\_BEHALF\_ACCRUE\_INTEREST\_FAILED                           |
| 54   | REPAY\_BORROW\_ACCRUE\_INTEREST\_FAILED                           |
| 55   | REPAY\_BORROW\_ACCUMULATED\_BALANCE\_CALCULATION\_FAILED          |
| 56   | REPAY\_BORROW\_UNITROLLER\_REJECTION                              |
| 57   | REPAY\_BORROW\_FRESHNESS\_CHECK                                   |
| 58   | REPAY\_BORROW\_NEW\_ACCOUNT\_BORROW\_BALANCE\_CALCULATION\_FAILED |
| 59   | REPAY\_BORROW\_NEW\_TOTAL\_BALANCE\_CALCULATION\_FAILED           |
| 60   | REPAY\_BORROW\_TRANSFER\_IN\_NOT\_POSSIBLE                        |
| 61   | SET\_COLLATERAL\_FACTOR\_OWNER\_CHECK                             |
| 62   | SET\_COLLATERAL\_FACTOR\_VALIDATION                               |
| 63   | SET\_UNITROLLER\_OWNER\_CHECK                                     |
| 64   | SET\_INTEREST\_RATE\_MODEL\_ACCRUE\_INTEREST\_FAILED              |
| 65   | SET\_INTEREST\_RATE\_MODEL\_FRESH\_CHECK                          |
| 66   | SET\_INTEREST\_RATE\_MODEL\_OWNER\_CHECK                          |
| 67   | SET\_MAX\_ASSETS\_OWNER\_CHECK                                    |
| 68   | SET\_ORACLE\_MARKET\_NOT\_LISTED                                  |
| 69   | SET\_PENDING\_ADMIN\_OWNER\_CHECK                                 |
| 70   | SET\_RESERVE\_FACTOR\_ACCRUE\_INTEREST\_FAILED                    |
| 71   | SET\_RESERVE\_FACTOR\_ADMIN\_CHECK                                |
| 72   | SET\_RESERVE\_FACTOR\_FRESH\_CHECK                                |
| 73   | SET\_RESERVE\_FACTOR\_BOUNDS\_CHECK                               |
| 74   | TRANSFER\_UNITROLLER\_REJECTION                                   |
| 75   | TRANSFER\_NOT\_ALLOWED                                            |
| 76   | TRANSFER\_NOT\_ENOUGH                                             |
| 77   | TRANSFER\_TOO\_MUCH                                               |

## Exchange Rate

Each sToken is convertible into an ever increasing quantity of the underlying asset, as interest accrues in the market. The exchange rate between a sToken and the underlying asset is equal to:

```javascript
exchangeRate = (getCash() + totalBorrows() - totalReserves()) / totalSupply()
```

#### SBep20 / SBnb

```javascript
function exchangeRateCurrent() returns (uint)
```

RETURN: The current exchange rate as an unsigned integer, scaled by 1e18.

#### Solidity

```javascript
SBep20 sToken = SToken(0x3FDA...);
uint exchangeRateMantissa = sToken.exchangeRateCurrent();
```

#### Web3 1.0

```javascript
const sToken = SBnb.at(0x3FDB...);
const exchangeRate = (await sToken.methods.exchangeRateCurrent().call()) / 1e18;
```

Tip: note the use of call vs. send to invoke the function from off-chain without incurring gas costs.

## Get Cash

Cash is the amount of underlying balance owned by this sToken contract. One may query the total amount of cash currently available to this market.

#### SBep20 / SBnb

```javascript
function getCash() returns (uint)
```

RETURN: The quantity of underlying asset owned by the contract.

#### Solidity

```javascript
SBep20 sToken = SToken(0x3FDA...);
uint cash = sToken.getCash();
```

#### Web3 1.0

```javascript
const sToken = sBnb.at(0x3FDB...);
const cash = (await sToken.methods.getCash().call());
```

## Total Borrow

A user who borrows assets from the protocol is subject to accumulated interest based on the current borrow rate. Interest is accumulated every block and integrations may use this function to obtain the current value of a user's borrow balance with interest.

#### SBep20 / SBnb

```javascript
function totalBorrowsCurrent() returns (uint)
```

RETURN: The quantity of underlying asset owned by the contract.

#### Solidity

```javascript
SBep20 sToken = SToken(0x3FDA...);
uint borrows = sToken.totalBorrowsCurrent();
```

#### Web3 1.0

```javascript
const sToken = SBnb.at(0x3FDB...);
const borrows = (await sToken.methods.totalBorrowsCurrent().call());

```

## Borrow Balance

A user who borrows assets from the protocol is subject to accumulated interest based on the current borrow rate. Interest is accumulated every block and integrations may use this function to obtain the current value of a user's borrow balance with interest.

#### SBep20 / SBnb

```javascript
function borrowBalanceCurrent(address account) returns (uint)
```

* account: The account which borrowed the assets.&#x20;
* RETURN: The user's current borrow balance (with interest) in units of the underlying asset.

#### Solidity

```javascript
SBep20 sToken = SToken(0x3FDA...);
uint borrows = sToken.borrowBalanceCurrent(msg.caller);
```

#### Web3 1.0

```javascript
const sToken = SBnb.at(0x3FDB...);
const borrows = await sToken.methods.borrowBalanceCurrent(account).call();
```

## Borrow Rate

At any point in time one may query the contract to get the current borrow rate per block.

SBep20 / SBnb

```javascript
function borrowRatePerBlock() returns (uint)
```

RETURN: The current borrow rate as an unsigned integer, scaled by 1e18.

#### Solidity

```javascript
SBep20 sToken = SToken(0x3FDA...);
uint borrowRateMantissa = sToken.borrowRatePerBlock();
```

#### Web3 1.0

```javascript
const sToken = SBnb.at(0x3FDB...);
const borrowRate = (await sToken.methods.borrowRatePerBlock().call()) / 1e18;
```

## Total Supply

Total Supply is the number of tokens currently in circulation in this sToken market. It is part of the EIP-20 interface of the sToken contract.

#### SBep20 / SBnb

```javascript
function totalSupply() returns (uint)
```

RETURN: The total number of tokens in circulation for the market.

#### Solidity

```javascript
SBep20 sToken = SToken(0x3FDA...);
uint tokens = sToken.totalSupply();
```

#### Web3 1.0

```javascript
const sToken = SBnb.at(0x3FDB...);
const tokens = (await sToken.methods.totalSupply().call());
```

## Underlying Balance

The user's underlying balance, representing their assets in the protocol, is equal to the user's sToken balance multiplied by the Exchange Rate.

#### SBep20 / SBnb

```javascript
function balanceOfUnderlying(address account) returns (uint)
```

* account: The account to get the underlying balance of.&#x20;
* RETURN: The amount of underlying currently owned by the account.

#### Solidity

```javascript
SBep20 sToken = SToken(0x3FDA...);
uint tokens = sToken.balanceOfUnderlying(msg.caller);
```

#### Web3 1.0

```javascript
const sToken = SBnb.at(0x3FDB...);
const tokens = await sToken.methods.balanceOfUnderlying(account).call();
```

## Supply Rate

At any point in time one may query the contract to get the current supply rate per block. The supply rate is derived from the borrow rate, reserve factor and the amount of total borrows.

#### SBep20 / SBnb

```javascript
function supplyRatePerBlock() returns (uint)
```

RETURN: The current supply rate as an unsigned integer, scaled by 1e18.

#### Solidity

```javascript
SBep20 sToken = SToken(0x3FDA...);
uint supplyRateMantissa = sToken.supplyRatePerBlock();
```

#### Web3 1.0

```javascript
const sToken = SBnb.at(0x3FDB...);
const supplyRate = (await sToken.methods.supplyRatePerBlock().call()) / 1e18;
```

## Total Reserves

Reserves are an accounting entry in each sToken contract that represents a portion of historical interest set aside as cash which can be withdrawn or transferred through the protocol's governance. A small portion of borrower interest accrues into the protocol, determined by the reserve factor.

#### SBep20 / SBnb

```javascript
function totalReserves() returns (uint)
```

RETURN: The total amount of reserves held in the market.

#### Solidity

```javascript
SBep20 sToken = SToken(0x3FDA...);
uint reserves = sToken.totalReserves();
```

#### Web3 1.0

```javascript
const sToken = SBnb.at(0x3FDB...);
const reserves = (await sToken.methods.totalReserves().call());
```

## Reserve Factor

The reserve factor defines the portion of borrower interest that is converted into reserves.

#### SBep20 / SBnb

```javascript
function reserveFactorMantissa() returns (uint)
```

RETURN: The current reserve factor as an unsigned integer, scaled by 1e18.

#### Solidity

```javascript
SBep20 sToken = SToken(0x3FDA...);
uint reserveFactorMantissa = sToken.reserveFactorMantissa();
```

#### Web3 1.0

```javascript
const sToken = SBnb.at(0x3FDB...);
const reserveFactor = (await sToken.methods.reserveFactorMantissa().call()) / 1e18;
```

\ <br>


# Unitroller

## Introduction

The Unitroller is the risk management layer of the Source One Market; it determines how much collateral a user is required to maintain, and whether (and by now much) a user can be liquidated. Each time a user interacts with sToken, the Unitroller is asked to approve or deny the transaction.The Unitroller maps user balanes to price (via the Price Oracle) to risk weights (Called Collateral Factors) to make itsdeterminations. Users explicitly list which assets they would like included in their risk scoring, by calling Enter Markets and ExitMarket.

## Architecture&#x20;

The Unitroller is implemented as an upgradeable proxy. The Unitroller proxies all logic to the Unitroller implementation, but storage values are set on the Unitroller. To call Unitroller functions, use the Unitroller ABI on the Unitroller address.&#x20;

## Enter Markets&#x20;

Enter into a list of markets - it is not an error to enter the same market more than once. In order to supply collateral or borrow in a market, it must be entered first.

#### Unitroller

```javascript
function enterMarkets(address[] calldata sTokens) returns (uint[] memory)
```

* msg.sender: The account which shall enter the given markets.
* sTokens: The addresses of the sToken markets to enter.
* RETURN: For each market, returns an error code indicating whether or not it was entered. Each is 0 on success, otherwise an Error code

#### Solidity

```javascript
Unitroller troll = Unitroller(0xABCD...);
sToken[] memory sTokens = new sToken[](2);
sTokens[0] = CErc20(0x3FDA...);
sTokens[1] = CEther(0x3FDB...);
uint[] memory errors = troll.enterMarkets(sTokens);
```

#### Web3 1.0

```javascript
const troll = Unitroller.at(0xABCD...);
const sTokens = [CErc20.at(0x3FDA...), CEther.at(0x3FDB...)];
const errors = await troll.methods.enterMarkets(sTokens).send({from: ...});
```

## Exit Market

Exit a market - it is not an error to exit a market which is not currently entered. Exited markets will not count towards account liquidity calculations.

Unitroller

```javascript
function exitMarket(address sToken) returns (uint)
```

* msg.sender: The account which shall exit the given market.
* sTokens: The addresses of the sToken market to exit.
* RETURN: 0 on success, otherwise an Error code

#### Solidity

```javascript
Unitroller troll = Unitroller(0xABCD...);
sToken[] memory sTokens = new sToken[](2);
sTokens[0] = CErc20(0x3FDA...);
sTokens[1] = CEther(0x3FDB...);
uint[] memory errors = troll.enterMarkets(sTokens);
```

#### Web3 1.0

```javascript
const troll = Unitroller.at(0xABCD...);
const sTokens = [CErc20.at(0x3FDA...), CEther.at(0x3FDB...)];
const errors = await troll.methods.enterMarkets(sTokens).send({from: ...});
```

## Get Assets In

Get the list of markets an account is currently entered into. In order to supply collateral or borrow in a market, it must be entered first. Entered markets count towards account liquidity calculations.

Unitroller

```javascript
function getAssetsIn(address account) view returns (address[] memory)
```

* account: The account whose list of entered markets shall be queried.&#x20;
* RETURN: The address of each market which is currently entered into.

#### Solidity

```javascript
Unitroller troll = Unitroller(0xABCD...);
address[] memory markets = troll.getAssetsIn(0xMyAccount);
```

#### Web3 1.0

```javascript
const troll = Unitroller.at(0xABCD...);
const markets = await troll.methods.getAssetsIn(sTokens).call();
```

## Collateral Factor

A sToken's collateral factor can range from 0-90%, and represents the proportionate increase in liquidity (borrow limit) that an account receives by minting the sToken.&#x20;

Generally, large or liquid assets have high collateral factors, while small or illiquid assets have low collateral factors. If an asset has a 0% collateral factor, it can't be used as collateral (or seized in liquidation), though it can still be borrowed.&#x20;

{% hint style="info" %}
Collateral factors can be increased (or decreased) through Venus Governance, as market conditions change.
{% endhint %}

Unitroller

```javascript
function markets(address vTokenAddress) view returns (bool, uint, bool)
```

* sTokenAddress: The address of the sToken to check if listed and get the collateral factor for.&#x20;
* RETURN: Tuple of values (isListed, collateralFactorMantissa, isSrc1ed); isListed represents whether the unitroller recognizes this sToken; collateralFactorMantissa, scaled by 1e18, is multiplied by a supply balance to determine how much value can be borrowed. The isSrc1ed boolean indicates whether or not suppliers and borrowers are distributed SRC1 tokens.

#### Solidity

```javascript
Unitroller troll = Unitroller(0xABCD...);
(bool isListed, uint collateralFactorMantissa, bool isSrc1ed) = troll.markets(0x3FDA...);
```

#### Web3 1.0

```javascript
const troll = Unitroller.at(0xABCD...);
const result = await troll.methods.markets(0x3FDA...).call();
const {0: isListed, 1: collateralFactorMantissa, 2: isSrc1ed} = result;
```

## Get Account Liquidity

Account Liquidity represents the USD value borrowable by a user, before it reaches liquidation. Users with a shortfall (negative liquidity) are subject to liquidation, and can’t withdraw or borrow assets until Account Liquidity is positive again.

For each market the user has entered into, their supplied balance is multiplied by the market’s collateral factor, and summed; borrow balances are then subtracted, to equal Account Liquidity. Borrowing an asset reduces Account Liquidity for each USD borrowed; withdrawing an asset reduces Account Liquidity by the asset’s collateral factor times each USD withdrawn.

Because the Source One Market exclusively uses unsigned integers, Account Liquidity returns either a surplus or shortfall.

#### Unitroller

```javascript
function getAccountLiquidity(address account) view returns (uint, uint, uint)
```

* account: The account whose liquidity shall be calculated.
* RETURN: Tuple of values (error, liquidity, shortfall). The error shall be 0 on success, otherwise an Error code. A non-zero liquidity value indicates the account has available account liquidity. A non-zero shortfall value indicates the account is currently below his/her collateral requirement and is subject to liquidation. At most one of liquidity or shortfall shall be non-zero.

#### Solidity

```javascript
Unitroller troll = Unitroller(0xABCD...);
(uint error, uint liquidity, uint shortfall) = troll.getAccountLiquidity(msg.caller);
require(error == 0, "join the Discord");
require(shortfall == 0, "account underwater");
require(liquidity > 0, "account has excess collateral");
```

#### Web3 1.0

```javascript
const troll = Unitroller.at(0xABCD...);
const result = await troll.methods.getAccountLiquidity(0xBorrower).call();
const {0: error, 1: liquidity, 2: shortfall} = result;
```

## Close Factor

The percent, ranging from 0% to 100%, of a liquidatable account's borrow that can be repaid in a single liquidate transaction. If a user has multiple borrowed assets, the closeFactor applies to any single borrowed asset, not the aggregated value of a user’s outstanding borrowing.

#### Unitroller

```javascript
function closeFactorMantissa() view returns (uint)
```

RETURN: The closeFactor, scaled by 1e18, is multiplied by an outstanding borrow balance to determine how much could be closed.Solidity

```javascript
Unitroller troll = Unitroller(0xABCD...);
uint closeFactor = troll.closeFactorMantissa();
```

#### Web3 1.0

```javascript
const troll = Unitroller.at(0xABCD...);
const closeFactor = await troll.methods.closeFactoreMantissa().call();
```

## Liquidation Incentive

The additional collateral given to liquidators as an incentive to perform liquidation of underwater accounts. For example, if the liquidation incentive is 1.1, liquidators receive an extra 10% of the borrowers collateral for every unit they close.

#### Unitroller

```javascript
function liquidationIncentiveMantissa() view returns (uint)
```

RETURN: The liquidationIncentive, scaled by 1e18, is multiplied by the closed borrow amount from the liquidator to determine how much collateral can be seized.

#### Solidity

```javascript
Unitroller troll = Unitroller(0xABCD...);
uint closeFactor = troll.liquidationIncentiveMantissa();
```

#### Web3 1.0

```javascript
const troll = Unitroller.at(0xABCD...);
const closeFactor = await troll.methods.liquidationIncentiveMantissa().call();
```

## Key Events

| Event                                         | Description                             |
| --------------------------------------------- | --------------------------------------- |
| MarketEntered(sToken sToken, address account) | Emitted upon a successful Enter Market. |
| MarketExited(sToken sToken, address account)  | Emitted upon a successful Exit Market.  |

## Error Codes

<table><thead><tr><th width="150">Code</th><th>Name</th><th>Description</th></tr></thead><tbody><tr><td>0</td><td>NO_ERROR</td><td>Not a failure.</td></tr><tr><td>1</td><td>UNAUTHORIZED</td><td>The sender is not authorized to perform this action.</td></tr><tr><td>2</td><td>SRC1TROLLER_MISMATCH</td><td>Liquidation cannot be performed in markets with different unitrollers.</td></tr><tr><td>3</td><td>INSUFFICIENT_SHORTFALL</td><td>The account does not have sufficient shortfall to perform this action.</td></tr><tr><td>4</td><td>INSUFFICIENT_LIQUIDITY</td><td>The account does not have sufficient liquidity to perform this action.</td></tr><tr><td>5</td><td>INVALID_CLOSE_FACTOR</td><td>The close factor is not valid.</td></tr><tr><td>6</td><td>INVALID_COLLATERAL_FACTOR</td><td>The collateral factor is not valid.</td></tr><tr><td>7</td><td>INVALID_LIQUIDATION_INCENTIVE</td><td>The liquidation incentive is invalid.</td></tr><tr><td>8</td><td>MARKET_NOT_ENTERED</td><td>The market has not been entered by the account.</td></tr><tr><td>9</td><td>MARKET_NOT_LISTED</td><td>The market is not currently listed by the unitroller.</td></tr><tr><td>10</td><td>MARKET_ALREADY_LISTED</td><td>An admin tried to list the same market more than once.</td></tr><tr><td>11</td><td>MATH_ERROR</td><td>A math calculation error occurred.</td></tr><tr><td>12</td><td>NONZERO_BORROW_BALANCE</td><td>The action cannot be performed since the account carries a borrow balance.</td></tr><tr><td>13</td><td>PRICE_ERROR</td><td>The unitroller could not obtain a required price of an asset.</td></tr><tr><td>14</td><td>REJECTION</td><td>The unitroller rejects the action requested by the market.</td></tr><tr><td>15</td><td>SNAPSHOT_ERROR</td><td>The unitroller could not get the account borrows and exchange rate from the market.</td></tr><tr><td>16</td><td>TOO_MANY_ASSETS</td><td>Attempted to enter more markets than are currently supported.</td></tr><tr><td>17</td><td>TOO_MUCH_REPAY</td><td>Attempted to repay more than is allowed by the protocol.</td></tr></tbody></table>

## Failure Info

<table><thead><tr><th width="150">Code</th><th>Name</th></tr></thead><tbody><tr><td>0</td><td>ACCEPT_ADMIN_PENDING_ADMIN_CHECK</td></tr><tr><td>1</td><td>ACCEPT_PENDING_IMPLEMENTATION_ADDRESS_CHECK</td></tr><tr><td>2</td><td>EXIT_MARKET_BALANCE_OWED</td></tr><tr><td>3</td><td>EXIT_MARKET_REJECTION</td></tr><tr><td>4</td><td>SET_CLOSE_FACTOR_OWNER_CHECK</td></tr><tr><td>5</td><td>SET_CLOSE_FACTOR_VALIDATION</td></tr><tr><td>6</td><td>SET_COLLATERAL_FACTOR_OWNER_CHECK</td></tr><tr><td>7</td><td>SET_COLLATERAL_FACTOR_NO_EXISTS</td></tr><tr><td>8</td><td>SET_COLLATERAL_FACTOR_VALIDATION</td></tr><tr><td>9</td><td>SET_COLLATERAL_FACTOR_WITHOUT_PRICE</td></tr><tr><td>10</td><td>SET_IMPLEMENTATION_OWNER_CHECK</td></tr><tr><td>11</td><td>SET_LIQUIDATION_INCENTIVE_OWNER_CHECK</td></tr><tr><td>12</td><td>SET_LIQUIDATION_INCENTIVE_VALIDATION</td></tr><tr><td>13</td><td>SET_MAX_ASSETS_OWNER_CHECK</td></tr><tr><td>14</td><td>SET_PENDING_ADMIN_OWNER_CHECK</td></tr><tr><td>15</td><td>SET_PENDING_IMPLEMENTATION_OWNER_CHECK</td></tr><tr><td>16</td><td>SET_PRICE_ORACLE_OWNER_CHECK</td></tr><tr><td>17</td><td>SUPPORT_MARKET_EXISTS</td></tr><tr><td>18</td><td>SUPPORT_MARKET_OWNER_CHECK</td></tr></tbody></table>

## Source One Distribution Speeds

The “Source One speed” unique to each market is an unsigned integer that specifies the amount of SRC1 that is distributed, per block, to suppliers and borrowers in each market. As market conditions change, Source One speeds are updated to ensure SRC1 is distributed proportional to the utility of each market. Any user can call the Unitroller’s refreshSourceoneSpeeds method at any time in order to update market Source One speeds.

The following is the formula for calculating the rate that SRC1 is distributed to each supported market.

```javascript
utility = sTokenTotalBorrows * assetPrice

utilityFraction = utility / sumOfAllSourceoneedMarketUtilities

marketSourceoneSpeed = sourceoneRate * utilityFraction
```

#### Unitroller

```javascript
function refreshSourceoneSpeeds(address account) public
```

* RETURN: None&#x20;
* events: SourceoneSpeedUpdated - An event is emitted for each sToken with the address of the sToken and the new SRC1 distribution speed per block.

#### Solidity

```javascript
Unitroller troll = Unitroller(0xABCD...);
troll.refreshSourceoneSpeeds();
```

#### Web3 1.0

```javascript
const unitroller = new web3.eth.Contract(unitrollerAbi, unitrollerAddress);
await unitroller.methods.refreshSourceoneSpeeds().send({ from: sender });
```

## SRC1 Distributed Per Block (All Markets)

The Unitroller Storage contract’s sourceoneRate is an unsigned integer that indicates the rate at which the protocol distributes SRC1 to markets’ suppliers or borrowers, every BSC block. The value is the amount of SRC1 (in wei), per block, allocated for the markets. Note that not every market has SRC1 distributed to its participants (see Market Metadata).

The sourceoneRate indicates how much SRC1 goes to the suppliers or borrowers, so doubling this number shows how much SRC1 goes to all suppliers and borrowers combined. The code examples implement reading the amount of SRC1 distributed, per BSC block, to all markets.

#### Unitroller

```javascript
uint public sourceoneRate;
```

#### Solidity

```javascript
Unitroller troll = Unitroller(0xABCD...);

// SRC1 issued per block to suppliers OR borrowers * (1 * 10 ^ 18)
uint sourceoneRate = troll.sourceoneRate();

// Approximate SRC1 issued per day to suppliers OR borrowers * (1 * 10 ^ 18)
uint sourceoneRatePerDay = sourceoneRate * 4 * 60 * 24;

// Approximate SRC1 issued per day to suppliers AND borrowers * (1 * 10 ^ 18)
uint sourceoneRatePerDayTotal = sourceoneRatePerDay * 2;
```

#### Web3 1.0

```javascript
const unitroller = new web3.eth.Contract(unitrollerAbi, unitrollerAddress);

let sourceoneRate = await unitroller.methods.sourceoneRate().call();
sourceoneRate = vsourceoneRate / 1e18;

// SRC1 issued to suppliers OR borrowers
const sourceoneRatePerDay = sourceoneRate * 4 * 60 * 24;

// SRC1 issued to suppliers AND borrowers
const sourceoneRatePerDayTotal = sourceoneRatePerDay * 2;
```

## SRC1 Distributed Per Block (Single Market)

The Unitroller Storage contract has a mapping called sourceoneSpeeds. It maps sToken addresses to an integer of each market’s SRC1 distribution per BSC block. The integer indicates the rate at which the protocol distributes SRC1 to markets’ suppliers or borrowers. The value is the amount of SRC1 (in wei), per block, allocated for the market. Note that not every market has SRC1 distributed to its participants (see Market Metadata).

The speed indicates how much SRC1 goes to the suppliers or the borrowers, so doubling this number shows how much SCR1 goes to market suppliers and borrowers combined. The code examples implement reading the amount of SRC1 distributed, per BSC block, to a single market.

#### Unitroller

```javascript
mapping(address => uint) public sourceoneSpeeds;
```

#### Solidity

```javascript
Unitroller troll = Unitroller(0x123...);
address sToken = 0xabc...;

// SRC1 issued per block to suppliers OR borrowers * (1 * 10 ^ 18)
uint sourceoneSpeed = troll.sourceoneSpeeds(sToken);

// Approximate SRC1 issued per day to suppliers OR borrowers * (1 * 10 ^ 18)
uint sourceoneSpeedPerDay = sourceoneSpeed * 4 * 60 * 24;

// Approximate SRC1 issued per day to suppliers AND borrowers * (1 * 10 ^ 18)
uint sourceoneSpeedPerDayTotal = sourceoneSpeedPerDay * 2;
```

#### Web3 1.0

```javascript
const sTokenAddress = '0xabc...';

const unitroller = new web3.eth.Contract(unitrollerAbi, unitrollerAddress);

let sourceoneSpeed = await unitroller.methods.sourceoneSpeeds(sTokenAddress).call();
sourceoneSpeed = sourceoneSpeed / 1e18;

// SRC1 issued to suppliers OR borrowers
const sourceoneSpeedPerDay = sourceoneSpeed * 4 * 60 * 24;

// SRC1 issued to suppliers AND borrowers
const sourceoneSpeedPerDayTotal = sourceoneSpeedPerDay * 2;
```

## Claim Source One

Every Source One Market user accrues SRC1 for each block they are supplying to or borrowing from the protocol. The protocol automatically transfers accrued SRC1 to a user’s address when the total amount of SRC1 accrued that address (in a market) is greater than the claimSourceoneThreshold, and and the address executes any of the mint, borrow, transfer, liquidateBorrow, repayBorrow, or redeem functions on that market. Separately, users may call the claimSourceone method on any sToken contract at any time for finer grained control over which markets to claim from.

#### Unitroller

```javascript
// Claim all the SRC1 accrued by holder in all markets
function claimSourceone(address holder) public

// Claim all the SRC1 accrued by holder in specific markets
function claimSourceone(address holder, sToken[] memory sTokens) public

// Claim all the SRC1 accrued by specific holders in specific markets for their supplies and/or borrows
function claimSourceone(address[] memory holders, sToken[] memory sTokens, bool borrowers, bool suppliers) public
```

RETURN: The liquidationIncentive, scaled by 1e18, is multiplied by the closed borrow amount from the liquidator to determine how much collateral can be seized.

#### Solidity

```javascript
Unitroller troll = Unitroller(0xABCD...);
troll.claimSourceone(0x1234...);
```

#### Web3 1.0

```javascript
const unitroller = new web3.eth.Contract(unitrollerAbi, unitrollerAddress);
await unitroller.methods.claimSourceone("0x1234...").send({ from: sender });
```

## Market Metadata

The Unitroller contract has an array called allMarkets that contains the addresses of each sToken contract. Each address in the allMarkets array can be used to fetch a metadata struct in the Unitroller’s markets constant. See the Unitroller Storage contract for the Market struct definition.

#### Unitroller

```javascript
sToken[] public allMarkets;
```

#### Solidity

```javascript
Unitroller troll = Unitroller(0xABCD...);
sToken sTokens[] = troll.allMarkets();
```

#### Web3 1.0

```javascript
const unitroller = new web3.eth.Contract(unitrollerAbi, unitrollerAddress);
const sTokens = await unitroller.methods.allMarkets().call();
const sToken = sTokens[0]; // address of a sToken
```

<br>


# USX Controller

## MintUSX

The mintUSX function mints and transfers USX from the protocol to the user, and adds a borrow balance. The amount minted must be less than the user's Account Liquidity and the mint USX limit.

#### USXController

```javascript
function mintUSX(uint mintUSXAmount) returns (uint)
```

* msg.sender: The account to which minted USX shall be transferred.
* mintUSXAmount: The amount of the USX to be minted.
* RETURN: 0 on success, otherwise an Error code

#### Solidity

```javascript
USXController usxController = USXController(0x0040...);
require(sToken.borrow(100) == 0, "got collateral and has usx mint rate?");
```

#### Web3 1.0

```javascript
const usxController = USXController.at(0x0040...);
await usxController.methods.mintUSX(50).send({from: 0xMyAccount});
```

## RepayUSX

The repay function transfers USX into the protocol and burn, reducing the user's borrow balance.

#### USXController

```javascript
function repayUSX(uint repayUSXAmount) returns (uint)
```

* msg.sender: The account which minted the USX, and shall repay the USX.
* borrowAmount: The amount of the USX to be repaid.
* RETURN: 0 on success, otherwise an Error code

Before repaying an asset, users must first approve the USX to access their USX balance.

#### Solidity

```javascript
USXController usxController = USXController(0x0040...);
require(usxController.repayUSX.value(100)() == 0, "transfer approved?");
```

#### Web3 1.0

```javascript
const usxController = USXController.at(0x0040...);
usxController.methods.repayUSX(10000).send({from: ...});
```

## LiquidateUSX

A user who has negative account liquidity is subject to liquidation by other users of the protocol to return his/her account liquidity back to positive (i.e. above the collateral requirement). When a liquidation occurs, a liquidator may repay some or all of an outstanding borrow on behalf of a borrower and in return receive a discounted amount of collateral held by the borrower; this discount is defined as the liquidation incentive.

A liquidator may close up to a certain fixed percentage (i.e. close factor) of any individual outstanding borrow of the underwater account. Liquidators must interact with USXUnitroller contract in which they wish to repay USX and seize another asset as collateral. When collateral is seized, the liquidator is transferred sTokens, which they may redeem the same as if they had supplied the asset themselves. Users must approve USX contract before calling liquidateUSX, as they are transferring funds into the contract.

#### USXController

```javascript
function liquidateUSX(address borrower, uint amount, address collateral) returns (uint)
```

* msg.sender: The account which shall liquidate the borrower by repaying their USX and seizing their collateral.
* borrower: The account with negative account liquidity that shall be liquidated.
* repayAmount: The amount of the minted USX to be repaid and converted into collateral.
* sTokenCollateral: The address of the sToken currently held as collateral by a borrower, that the liquidator shall seize.
* RETURN: 0 on success, otherwise an Error code

Before supplying USX, users must first approve the USXController to access their USX balance.

#### Solidity

```javascript
USXController usxController = USXController(0x0040...);
SBep20 sTokenCollateral = SBep20(0xfD58...);
require(sToken.liquidateUSX(0xBorrower, 100, sTokenCollateral) == 0, "borrower underwater??");
```

#### Web3 1.0

```javascript
const usxController = USXController.at(0x0040...);
const xTokenCollateral = SBep20.at(0xfD58...);
await usxController.methods.liquidateUSX(0xBorrower, 33, sTokenCollateral).send({from: 0xLiquidator})
```

## Key Events

| Event                                                                                                            | Description                             |
| ---------------------------------------------------------------------------------------------------------------- | --------------------------------------- |
| MintUSX(address minter, uint mintUSXAmount)                                                                      | Emitted upon a successful MintUSX.      |
| RepayMAI(address payer, address borrower, uint repayAmount)                                                      | Emitted upon a successful RepayUSX.     |
| LiquidateUSX(address liquidator, address borrower, uint repayAmount, address sTokenCollateral, uint seizeTokens) | Emitted upon a successful LiquidateUSX. |

## Error Codes

| Code | Name                            | Description                                                                          |
| ---- | ------------------------------- | ------------------------------------------------------------------------------------ |
| 0    | NO\_ERROR                       | Not a failure.                                                                       |
| 1    | UNAUTHORIZED                    | The sender is not authorized to perform this action.                                 |
| 2    | REJECTION                       | The action would violate the comptroller, usxcontroller policy.                      |
| 3    | SNAPSHOT\_ERROR                 | The comptroller could not get the account borrows and exchange rate from the market. |
| 4    | PRICE\_ERROR                    | The comptroller could not obtain a required price of an asset.                       |
| 5    | MATH\_ERROR                     | A math calculation error occurred.                                                   |
| 6    | MARKET\_NOT\_FRESH              | Interest has not been properly accrued.                                              |
| 7    | INSUFFICIENT\_BALANCE\_FOR\_USX | Caller does not have sufficient balance to mint USX.                                 |

## Failure Info

<table><thead><tr><th width="206"></th><th>Name</th></tr></thead><tbody><tr><td>0</td><td>SET_PENDING_ADMIN_OWNER_CHECK</td></tr><tr><td>1</td><td>SET_PENDING_IMPLEMENTATION_OWNER_CHECK</td></tr><tr><td>2</td><td>SET_COMPTROLLER_OWNER_CHECK</td></tr><tr><td>3</td><td>ACCEPT_ADMIN_PENDING_ADMIN_CHECK</td></tr><tr><td>4</td><td>ACCEPT_PENDING_IMPLEMENTATION_ADDRESS_CHECK</td></tr><tr><td>5</td><td>USX_MINT_REJECTION</td></tr><tr><td>6</td><td>USX_BURN_REJECTION</td></tr><tr><td>7</td><td>USX_LIQUIDATE_ACCRUE_BORROW_INTEREST_FAILED</td></tr><tr><td>8</td><td>USX_LIQUIDATE_ACCRUE_COLLATERAL_INTEREST_FAILED</td></tr><tr><td>9</td><td>USX_LIQUIDATE_COLLATERAL_FRESHNESS_CHECK</td></tr><tr><td>10</td><td>USX_LIQUIDATE_COMPTROLLER_REJECTION</td></tr><tr><td>11</td><td>USX_LIQUIDATE_COMPTROLLER_CALCULATE_AMOUNT_SEIZE_FAILED</td></tr><tr><td>12</td><td>USX_LIQUIDATE_CLOSE_AMOUNT_IS_UINT_MAX</td></tr><tr><td>13</td><td>USX_LIQUIDATE_CLOSE_AMOUNT_IS_ZERO</td></tr><tr><td>14</td><td>USX_LIQUIDATE_FRESHNESS_CHECK</td></tr><tr><td>15</td><td>USX_LIQUIDATE_LIQUIDATOR_IS_BORROWER</td></tr><tr><td>16</td><td>USX_LIQUIDATE_REPAY_BORROW_FRESH_FAILED</td></tr><tr><td>17</td><td>USX_LIQUIDATE_SEIZE_BALANCE_INCREMENT_FAILED</td></tr><tr><td>18</td><td>USX_LIQUIDATE_SEIZE_BALANCE_DECREMENT_FAILED</td></tr><tr><td>19</td><td>USX_LIQUIDATE_SEIZE_COMPTROLLER_REJECTION</td></tr><tr><td>20</td><td>USX_LIQUIDATE_SEIZE_LIQUIDATOR_IS_BORROWER</td></tr><tr><td>21</td><td>USX_LIQUIDATE_SEIZE_TOO_MUCH</td></tr><tr><td>22</td><td>MINT_FEE_CALCULATION_FAILED</td></tr><tr><td>23</td><td>SET_TREASURY_OWNER_CHECK</td></tr></tbody></table>


# Governance

## Introduction

The Source One Market is governed and upgraded by SRC1 token-holders, using three distinct components; the SRC1 token, governance module (Governor Alpha), and Timelock. Together, these contracts allow the community to propose, vote, and implement changes through the administrative functions of an sToken or the unitroller. Proposals can include changes like adjusting an interest rate model, to adding support for a new asset.

sTokens are the primary means of interacting with the Source One Market; when a user mints, redeems, borrows, repays a borrow, liquidates a borrow, or transfers sTokens, she will do so using the sToken contract.

![](/files/NhudkFFjX3ANRz7W1zMW)

## Source One (SRC1)

SRC1 is an BEP-20 token that allows the owner to delegate voting rights to any address, including their own address. Changes to the owner’s token balance automatically adjust the voting rights of the delegate.

## Delegate

Delegate votes from the sender to the delegatee. Users can delegate to 1 address at a time, and the number of votes added to the delegatee’s vote count is equivalent to the balance of SRC1 in the user’s account. Votes are delegated from the current block and onward, until the sender delegates again, or transfers their SRC1.

#### SRC1

```javascript
function delegate(address delegatee)
```

* delegatee: The address in which the sender wishes to delegate their votes to.&#x20;
* msg.sender: The address of the SRC1 token holder that is attempting to delegate their votes.&#x20;
* RETURN: No return, reverts on error.

#### Solidity

```javascript
SRC1 src1 = SRC1(0x123...); // contract address
src1.delegate(delegateeAddress);
```

Web3 1.2.6

```javascript
const tx = await src1.methods.delegate(delegateeAddress).send({ from: sender });
```

## Delegate By Signature

Delegate votes from the signatory to the delegatee. This method has the same purpose as Delegate but it instead enables offline signatures to participate in Source One governance vote delegation. For more details on how to create an offline signature, review EIP-712.

#### SRC1

```javascript
function delegateBySig(address delegatee, uint nonce, uint expiry, uint8 v, bytes32 r, bytes32 s)
```

* delegatee: The address in which the sender wishes to delegate their votes to.
* nonce: The contract state required to match the signature. This can be retrieved from the contract’s public nonces mapping.
* expiry: The time at which to expire the signature. A block timestamp as seconds since the unix epoch (uint).
* v: The recovery byte of the signature.
* r: Half of the ECDSA signature pair.
* s: Half of the ECDSA signature pair.
* RETURN: No return, reverts on error.

#### Solidity

```javascript
SRC1 src1 = SRC1(0x123...); // contract address
src1.delegateBySig(delegateeAddress, nonce, expiry, v, r, s);
```

#### Web3 1.2.6

```javascript
const tx = await src1.methods.delegateBySig(delegateeAddress, nonce, expiry, v, r, s).send({});
```

## Get Current Votes

Gets the balance of votes for an account as of the current block.

#### SRC1

```javascript
function getCurrentVotes(address account) returns (uint96)
```

* account: Address of the account in which to retrieve the number of votes.&#x20;
* RETURN: The number of votes (integer).

#### Solidity

```javascript
SRC1 src1 = SRC1(0x123...); // contract address
src1.getCurrentVotes(0xabc...);
```

#### Web3 1.2.6

```javascript
const account = '0x123...'; // contract address
const votes = await src1.methods.getCurrentVotes(account).call();
```

## Get Prior Votes

Gets the prior number of votes for an account at a specific block number. The block number passed must be a finalized block or the function will revert.

#### SRC1

```javascript
function getPriorVotes(address account, uint blockNumber) returns (uint96)
```

* account: Address of the account in which to retrieve the number of votes.&#x20;
* blockNumber: The block number at which to retrieve the prior number of votes.&#x20;
* RETURN: The number of prior votes.

#### Solidity

```javascript
SRC1 src1 = SRC1(0x123...); // contract address
src1.getPriorVotes(account, blockNumber);
```

#### Web3 1.2.6

```javascript
const priorVotes = await src1.methods.getPriorVotes(account, blockNumber).call();
```

## Governor Alpha

Governor Alpha is the governance module of the protocol; it allows addresses with more than 300,000 SRC1 to propose changes to the protocol. Addresses that held voting weight, at the start of the proposal, invoked through the getpriorvotes function, can submit their votes during a 3 day voting period. If a majority, and at least 600,000 votes are cast for the proposal, it is queued in the Timelock, and can be implemented after 2 days.

## Quorum Votes

The required minimum number of votes in support of a proposal for it to succeed.

#### Governor Alpha

```javascript
function quorumVotes() public pure returns (uint)
```

RETURN: The minimum number of votes required for a proposal to succeed.

#### Solidity

```javascript
GovernorAlpha gov = GovernorAlpha(0x123...); // contract address
uint quorum = gov.quorumVotes();
```

#### Web3 1.2.6

```javascript
const quorum = await gov.methods.quorumVotes().call();
```

## Proposal Threshold

The minimum number of votes required for an account to create a proposal.

#### Governor Alpha

```javascript
function proposalThreshold() returns (uint)
```

RETURN: The minimum number of votes required for an account to create a proposal.

#### Solidity

```javascript
GovernorAlpha gov = GovernorAlpha(0x123...); // contract address
uint threshold = gov.proposalThreshold();
```

Web3 1.2.6

```javascript
const threshold = await gov.methods.proposalThreshold().call();
```

## Proposal Max Operations

The maximum number of actions that can be included in a proposal. Actions are functions calls that will be made when a proposal succeeds and executes.

#### Governor Alpha

```javascript
function proposalMaxOperations() returns (uint)
```

RETURN: The maximum number of actions that can be included in a proposal.

Solidity

```javascript
GovernorAlpha gov = GovernorAlpha(0x123...); // contract address
uint operations = gov.proposalMaxOperations();
```

#### Web3 1.2.6

```javascript
const operations = await gov.methods.proposalMaxOperations().call();
```

## Voting Delay

The number of BSC blocks to wait before voting on a proposal may begin. This value is added to the current block number when a proposal is created.

#### Governor Alpha

```javascript
function votingDelay() returns (uint)
```

RETURN: Number of blocks to wait before voting on a proposal may begin.

#### Solidity

```javascript
GovernorAlpha gov = GovernorAlpha(0x123...); // contract address
uint blocks = gov.votingDelay();
```

#### Web3 1.2.6

```javascript
const blocks = await gov.methods.votingDelay().call();
```

## Voting Period

The duration of voting on a proposal, in BSC blocks.

#### Governor Alpha

```javascript
function votingPeriod() returns (uint)
```

RETURN: The duration of voting on a proposal, in BSC blocks.

#### Solidity

```javascript
GovernorAlpha gov = GovernorAlpha(0x123...); // contract address
uint blocks = gov.votingPeriod();
```

#### Web3 1.2.6

```javascript
const blocks = await gov.methods.votingPeriod().call();
```

## Propose

Create a Proposal to change the protocol. E.g., A proposal can set a sToken's interest rate model or risk parameters on the Unitroller.

Proposals will be voted on by delegated voters. If there is sufficient support before the voting period ends, the proposal shall be automatically enacted. Enacted proposals are queued and executed in the Source One Timelock contract.

The sender must hold more SRC1 than the current proposal threshold (proposalThreshold()) as of the immediately previous block. If the threshold is 300,000 SRC1, the sender must have been delegated more than 1% of all SRC1 in order to create a proposal. The proposal can have up to 10 actions (based on proposalMaxOperations()).

The proposer cannot create another proposal if they currently have a pending or active proposal. It is not possible to queue two identical actions in the same block (due to a restriction in the Timelock), therefore actions in a single proposal must be unique, and unique proposals that share an identical action must be queued in different blocks.

#### Governor Alpha

```javascript
function propose(address[] memory targets, uint[] memory values, string[] memory signatures, bytes[] memory calldatas, string memory description) returns (uint)
```

* targets: The ordered list of target addresses for calls to be made during proposal execution. This array must be the same length as all other array parameters in this function.
* values: The ordered list of values (i.e. msg.value) to be passed to the calls made during proposal execution. This array must be the same length as all other array parameters in this function.
* signatures: The ordered list of function signatures to be passed during execution. This array must be the same length as all other array parameters in this function.
* calldatas: The ordered list of data to be passed to each individual function call during proposal execution. This array must be the same length as all other array parameters in this function.
* description: A human readable description of the proposal and the changes it will enact.
* RETURN: The ID of the newly created proposal.

#### Solidity

```javascript
GovernorAlpha gov = GovernorAlpha(0x123...); // contract address
uint proposalId = gov.propose(targets, values, signatures, calldatas, description);
```

#### Web3 1.2.6

```javascript
const tx = gov.methods.propose(targets, values, signatures, calldatas, description).send({ from: sender });
```

## Queue

After a proposal has succeeded, any address can call the queue method to move the proposal into the Timelock queue. A proposal can only be queued if it has succeeded.

#### Governor Alpha

```javascript
function queue(uint proposalId)
```

* proposalId: ID of a proposal that has succeeded.&#x20;
* RETURN: No return, reverts on error.

#### Solidity

```javascript
GovernorAlpha gov = GovernorAlpha(0x123...); // contract address
gov.queue(proposalId);
```

#### Web3 1.2.6

```javascript
const tx = gov.methods.queue(proposalId).send({ from: sender });
```

## Execute

After the Timelock delay period, any account may invoke the execute method to apply the changes from the proposal to the target contracts. This will invoke each of the actions described in the proposal.

This function is payable so the Timelock contract can invoke payable functions that were selected in the proposal. E.g., A proposal can add reserves to a market like sBNB, set a sToken's interest rate model, or set risk parameters on the Unitroller.

#### Governor Alpha

```javascript
function execute(uint proposalId) payable returns (uint)
```

* proposalId: ID of a succeeded proposal to execute.&#x20;
* RETURN: No return, reverts on error.

#### Solidity

```javascript
GovernorAlpha gov = GovernorAlpha(0x123...); // contract address
gov.execute(proposalId).value(999).gas(999)();
```

#### Web3 1.2.6

```javascript
const tx = gov.methods.execute(proposalId).send({ from: sender, value: 1 });
```

## Cancel

Cancel a proposal that has not yet been executed. The Guardian is the only one who may execute this unless the proposer does not maintain the delegates required to create a proposal. If the proposer does not have more delegates than the proposal threshold, anyone can cancel the proposal.

#### Governor Alpha

```javascript
function cancel(uint proposalId)
```

* proposalId: ID of a proposal that has succeeded.&#x20;
* RETURN: No return, reverts on error.

#### Solidity

```javascript
GovernorAlpha gov = GovernorAlpha(0x123...); // contract address
gov.cancel(proposalId);
```

#### Web3 1.2.6

```javascript
const tx = gov.methods.cancel(proposalId).send({ from: sender });
```

## Get Actions

Gets the actions of a selected proposal. Pass a proposal ID and get the targets, values, signatures and calldatas of that proposal.

#### Governor Alpha

```javascript
function getActions(uint proposalId) returns (uint proposalId) public view returns (address[] memory targets, uint[] memory values, string[] memory signatures, bytes[] memory calldatas)
```

#### Solidity

```javascript
GovernorAlpha gov = GovernorAlpha(0x123...); // contract address
uint proposalId = 123;
(address[] memory targets, uint[] memory values, string[] memory signatures, bytes[] memory calldatas) = gov.getActions(proposalId);
```

Web3 1.2.6

```javascript
const {0: targets, 1: values, 2: signatures, 3: calldatas} = gov.methods.getActions(proposalId).call();
```

## Get Receipt

Gets a proposal ballot receipt of the indicated voter.

#### Governor Alpha

```javascript
function getReceipt(uint proposalId, address voter) returns (Receipt memory)
```

* proposalId: ID of the proposal in which to get a voter’s ballot receipt.&#x20;
* voter: Address of the account of a proposal voter.&#x20;
* RETURN: Reverts on error. If successful, returns a Receipt struct for the ballot of the voter address.

#### Solidity

```javascript
GovernorAlpha gov = GovernorAlpha(0x123...); // contract address
Receipt ballot = gov.getReceipt(proposalId, voterAddress);
```

#### Web3 1.2.6

```javascript
const proposalId = 11;
const voterAddress = '0x123...';
const result = await gov.methods.getReceipt(proposalId, voterAddress).call();
const { hasVoted, support, votes } = result;
```

## State

Gets the proposal state for the specified proposal. The return value, ProposalState is an enumerated type defined in the Governor Alpha contract.

#### Governor Alpha

```javascript
function state(uint proposalId) returns (ProposalState)
```

* proposalId: ID of a proposal in which to get its state.&#x20;
* RETURN: Enumerated type ProposalState. The types are Pending, Active, Canceled, Defeated, Succeeded, Queued, Expired, and Executed.

#### Solidity

```javascript
GovernorAlpha gov = GovernorAlpha(0x123...); // contract address
GovernorAlpha.ProposalState state = gov.state(123);
```

#### Web3 1.2.6

```javascript
const proposalStates = ['Pending', 'Active', 'Canceled', 'Defeated', 'Succeeded', 'Queued', 'Expired', 'Executed'];
const proposalId = 123;
result = await gov.methods.state(proposalId).call();
const proposalState = proposalStates[result];
```

## Cast Vote

Cast a vote on a proposal. The account's voting weight is determined by the number of votes the account had delegated to it at the time the proposal state became active.

#### Governor Alpha

```javascript
function castVote(uint proposalId, bool support)
```

* proposalId: ID of a proposal in which to cast a vote.&#x20;
* support: A boolean of true for 'yes' or false for 'no' on the proposal vote.&#x20;
* RETURN: No return, reverts on error.

#### Solidity

```javascript
GovernorAlpha gov = GovernorAlpha(0x123...); // contract address
gov.castVote(proposalId, true);
```

#### Web3 1.2.6

```javascript
const tx = gov.methods.castVote(proposalId, false).send({ from: sender });
```

## Cast Vote By Signature

Cast a vote on a proposal. The account's voting weight is determined by the number of votes the account had delegated at the time that proposal state became active. This method has the same purpose as Cast Vote but it instead enables offline signatures to participate in Source One governance voting. For more details on how to create an offline signature, review EIP-712.

#### Governor Alpha

```javascript
function castVoteBySig(uint proposalId, bool support, uint8 v, bytes32 r, bytes32 s)
```

* proposalId: ID of a proposal in which to cast a vote.&#x20;
* support: A boolean of true for 'yes' or false for 'no' on the proposal vote.&#x20;
* v: The recovery byte of the signature.&#x20;
* r: Half of the ECDSA signature pair.&#x20;
* s: Half of the ECDSA signature pair.&#x20;
* RETURN: No return, reverts on error.

#### Solidity

```javascript
GovernorAlpha gov = GovernorAlpha(0x123...); // contract address
gov.castVoteBySig(proposalId, true, v, r, s);
```

#### Web3 1.2.6

```javascript
const tx = await gov.methods.castVoteBySig(proposalId, false, v, r, s).send({});
```

## Timelock

Each sToken contract and the Unitroller contract allow the Timelock address to modify them. The Timelock contract can modify system parameters, logic, and contracts in a 'time-delayed, opt-out' upgrade pattern.

The Timelock has a hard-coded minimum delay of 2 days, which is the least amount of notice possible for a governance action. Each proposed action will be published at a minimum of 2 days in the future from the time of announcement. Major upgrades, such as changing the risk system, may have a 14 day delay.

The Timelock is controlled by the governance module; pending and completed governance actions can be monitored on the Timelock Dashboard.

## Pause Guardian

The Unitroller contract designates a Pause Guardian address capable of disabling protocol functionality. Used only in the event of an unforeseen vulnerability, the Pause Guardian has one and only one ability: to disable a select set of functions: Mint, Borrow, Transfer, and Liquidate. The Pause Guardian cannot unpause an action, nor can it ever prevent users from calling Redeem, or Repay Borrow to close positions and exit the protocol.

SRC1 token-holders designate the Pause Guardian address, which is currently held by Source Protocol.


# Social, Resources & Updates

Where to Find Source Protocol

### Website Homepage

{% embed url="<https://www.sourceprotocol.io>" %}

### Discord

{% embed url="<https://discord.gg/zj8xxUCeZQ>" %}

### Telegram

{% embed url="<https://t.me/sourceprotocol>" %}

### Twitter

{% embed url="<https://www.twitter.com/sourceprotocol>\_" %}

### Blog

{% embed url="<https://www.medium.com/@sourceprotocol>" %}

### YouTube

{% embed url="<https://www.youtube.com/channel/UCYfRiLMNsB81qjrgBC6xDEA>" %}

### LinkedIn

{% embed url="<https://www.linkedin.com/company/source-protocol>" %}


# Branding

### SOURCE LOGO

<figure><img src="/files/VjWDpjhXo6cIVLDYZKBi" alt=""><figcaption><p>200 x 200 transparent bg</p></figcaption></figure>

### Source Blockchain (SOURCE)

{% file src="/files/I6TpKnLU0TWvTYaFtzaO" %}

{% file src="/files/6U0D5ndE0pNYE0w9tcsY" %}

{% file src="/files/jIZve0GYeXHDbkkMVVfF" %}

{% file src="/files/6RXr0Q7VTHXsVsOW0enY" %}

<figure><img src="/files/MhpkOMahl60XWdBkzLmi" alt="" width="375"><figcaption></figcaption></figure>

### SourceWorld™

{% file src="/files/L4PEJoxangRyJyeqIC7i" %}

### MINPIN

<figure><img src="/files/SAouiJ0V19icObDiERGE" alt=""><figcaption><p>200 x 200</p></figcaption></figure>

### Colors

Source Blue - 31A8FA

![](/files/TP4kgIIutCvjl08X7U96)

Source Magenta - D81EFD

![](/files/QHl1xJeALcOj2dbrP2OH)

Black - 000000

![](/files/wfQ8DC0kHy40iM2uSkDT)


# Videos

Educational and Promotional Videos for Source Protocol

## Educational

{% embed url="<https://youtu.be/WwWDXpeWnQE>" %}
What is Source Token (SRCX) and How Does it Work?
{% endembed %}

{% embed url="<https://video.wixstatic.com/video/80368b_c29f3ac00a364789a5e033f13ab7e00e/720p/mp4/file.mp4>" %}
SRCX - Introduction
{% endembed %}

{% embed url="<https://youtu.be/xefYJxzGeBg>" %}
How to Buy Source Token (SRCX) with Trust Wallet (& PancakeSwap)
{% endembed %}

## Demos

{% embed url="<https://youtu.be/Ak6fdiHYM4o>" %}
Source Swap Beta Demo - Decentralized Exchange & AMM
{% endembed %}

{% embed url="<https://youtu.be/6aEykL5h5mE>" %}
Source One Market - Beta Demo Video
{% endembed %}

## Commercials

{% embed url="<https://youtu.be/ehv_xY2dBBo>" %}
Introducing Source Protocol - A Smart Chain Ecosystem Powering Web 3.0
{% endembed %}

## Promotional Clips

{% embed url="<https://video.wixstatic.com/video/80368b_15c836681cb94ad99d9596e64e23195c/480p/mp4/file.mp4>" %}
Promotional Video
{% endembed %}


# How to: MetaMask

Installing and setting up MetaMask wallet

MetaMask can be downloaded on Chrome and Firefox, or on iOS and Android if you’re a mobile user. For the purposes of this tutorial, we’ll use the Firefox version, but the instructions will be more or less the same for every platform.

Firstly, you’ll want to head over to the MetaMask [Download page](https://metamask.io/download.html). From there, select whichever platform you’re using, and follow the steps to install it on your device. Easy!

Next, follow along with the setup specified by the app. Go ahead and click Create a Wallet. Write down the backup [seed phrase](https://academy.binance.com/en/glossary/seed-phrase) somewhere secret (preferably not on an Internet-connected device). Without this phrase, your funds can’t be recovered if your device is damaged or lost. Confirm that you’ve written them down on the next page.

And that’s it! You should now see your wallet, ready to send and receive funds.

<figure><img src="/files/vUwaepOqtRqYTXgOykLc" alt=""><figcaption><p>Fresh MetaMask wallet</p></figcaption></figure>

## Configuring the wallet for BNB Smart Chain <a href="#configuring-the-wallet" id="configuring-the-wallet"></a>

You might notice straight away that we’re still dealing with an [Ethereum](https://academy.binance.com/en/articles/what-is-ethereum) wallet. At best, this won’t work with BNB Smart Chain (BSC) DApps. At worst, **you could lose funds by sending them to addresses you can’t actually use**.

Let’s change that. We want to access the **Settings** to point the wallet towards BNB Smart Chain nodes.

<figure><img src="/files/0bStOfYcbek5j4aJim8B" alt=""><figcaption><p>Select Settings from the dropdown menu</p></figcaption></figure>

On the Settings page, we want to locate the **Networks** menu. Note that MetaMask may update the default Network list to include BNB Smart Chain which would save you from the next step of entering the Network parameters. Be sure to double check your Network parameters either way.

<figure><img src="/files/3hYNQcIhHm5QiLo4qbaz" alt=""><figcaption><p>Networks menu</p></figcaption></figure>

We want to click **Add Network** in the top-right corner to **manually add the BNB Smart Chain** – as it doesn’t come packaged with MetaMask by default. Below are the parameters to add the network.

**Network Name:** Smart Chain

**New RPC URL:** <https://bsc-dataseed.binance.org/>

**ChainID:** 56

**Symbol:** BNB

**Block Explorer URL:** <https://bscscan.com>

Once you **Save** the Network and return to the main view, you’ll notice two things: the network has automatically been set to the one you just entered, and the units are no longer denominated in ETH, but in BNB.

<figure><img src="/files/oXA5XL02d4HN9iF60cMu" alt=""><figcaption><p><em>We’ve connected to the testnet in this image, but you'll be connecting to the mainnet.</em></p></figcaption></figure>

## Importing SRCX as a Custom Token <a href="#making-transactions-on-the-testnet" id="making-transactions-on-the-testnet"></a>

To add SRCX as a custom token on Metamask, begin with copying SRCX's contract address.

**SRCX Contract Address:** 0x454B90716a9435E7161a9AEa5Cf00e0aCBE565aE

Then, click on "Import Tokens." Make sure you are on the "Smart Chain" network.

<figure><img src="/files/FU3xpMC7dA9TtNHXKwKG" alt=""><figcaption></figcaption></figure>

Paste the SRCX Contract Address from above in the "Token Contract Address" field. The "Token Symbol" and "Token Decimal" fields should populate automatically as seen in the example below.

<figure><img src="/files/zkXeF570InWEx5mNGZRg" alt=""><figcaption></figcaption></figure>

Then, click on the "Add custom token" button. This will take you to a new page, which will then prompt you to "Import Tokens." Click the "Import Tokens" button as seen below.

<figure><img src="/files/KKtxx25fmpfrp2hxjv5O" alt=""><figcaption></figcaption></figure>

Voila! You will now see SRCX has been added to your MetaMask wallet under the Binance Smart Chain. Because SRCX is a BEP-20 (a token built on top of Binance Smart Chain), it shares the same wallet receive address as all of your other Smart Chain assets. **You can view your SRCX receive address** by clicking on your SRCX wallet, then clicking on the button with 3 circles in the top right, followed by clicking on "Account Details," as seen in the screenshots below.

<figure><img src="/files/q55q1XJpHCKIDb6y4bvr" alt=""><figcaption></figcaption></figure>

## Making transactions <a href="#making-transactions-on-the-testnet" id="making-transactions-on-the-testnet"></a>

Don’t let the Ethereum logo fool you – we’ve tuned into the BNB Smart Chain. Proceed with transactions as you would with the Ethereum Network.\
\
Always be careful about what web 3.0 websites you approve of and connect your wallet to. Beware of phishing or scam sites that may try and trick you into signing a nefarious transaction.\
\
We recommend using Rango Exchange to safely bridge your Ethereum or ERC-20 assets to the BNB Smart Chain and back.\
\
[CLICK HERE FOR RANGO](https://cutt.ly/vKUeIQ)

## Closing thoughts <a href="#closing-thoughts" id="closing-thoughts"></a>

[MetaMask](https://academy.binance.com/en/articles/how-to-use-metamask) has long been the go-to passport for accessing the sprawling Ethereum landscape. But, with minimal effort, anyone can configure it to point towards BNB Smart Chain. This allows them to enjoy years of development that has been put into making [MetaMask](https://academy.binance.com/en/articles/how-to-use-metamask). It is an indispensable tool for anyone interacting with decentralized applications.

## Next up: How to Keplr Wallet <a href="#closing-thoughts" id="closing-thoughts"></a>

Click next below.

Content Reference: <https://academy.binance.com/en/articles/connecting-metamask-to-binance-smart-chain>


# How to: Keplr

### Keplr Wallet <a href="#closing-thoughts" id="closing-thoughts"></a>

Keplr is a browser extension wallet and smartphone app used for interacting with the COSMOS Ecosystem and will be used for interacting with the upcoming SOURCE Blockchain. You will use the Keplr Wallet to generate a Cosmos Address and later, a Source Blockchain Address.&#x20;

[CLICK HERE FOR KEPLR](https://www.keplr.app/)\
\
Keplr supports Inter Blockchain Communication (IBC) transfer capabilities. This feature allows blockchains to communicate with one another without the use of bridging and is a powerful tool for decentralized applications in the internet of blockchains.

**\*Disclaimer\* Always backup your seed phrases and passwords when creating new wallets with safe practices. Never use cloud storage like Dropbox or Gmail as those are often compromised most easily. Not your Keys, Not your Crypto.  If you lose your private key or seed phrase, YOU WILL NOT BE ABLE TO ACCESS YOUR WALLET!**


# Moochkin's Metarun

Coming Soon!


# Rewards and Tournaments

Coming Soon!


# Disclaimer

SOURCE Coin ("SOURCE"), Source Token ("SRCX"), SOURCE ONE ("SRC1"), was issued and distributed by Source Protocol Ltd, a corporation located in Tortola British Virgin Islands, and is bound by the arbitration agreement located on Sourceprotocol.io/legal SOURCE Coin ("SOURCE"), Source Token ("SRCX"), SOURCE ONE ("SRC1"), are not securities, investments, or investment contracts, nor should they be construed as such. Instead, SOURCE Coin ("SOURCE"), Source Token ("SRCX"), SOURCE ONE ("SRC1"), coin and tokens are a means of accessing discounts within the ecosystem, paying for Source Protocol goods and services, accessing automated DeFi services, invoices, accessing premium services, and voting for community-based programs.

Materials published by Source Protocol Ltd do not constitute the provision of advisory services regarding investment, tax, legal, financial, accounting, consulting, securities offering, or any other related services, no rare they recommendations to buy, sell or purchase any product or service.

Further, materials published by Source Protocol Ltd reflect the information available at the time of publishing and are subject to change without notice.&#x20;

DO NOT purchase SOURCE, SRCX, SOURCE ONE for any speculative purposes and only purchase units of SOURCE, SRCX, SOURCE ONE that you intend to utilize and consume on the Source Protocol ecosystem. Source Protocol will not be liable for any direct or consequential loss arising from the use of this material or its contents.


# Privacy Policy

**Last updated: September 23, 2022** \
\
This Privacy Policy describes Our policies and procedures on the collection, use and disclosure of Your information when You use the Service and tells You about Your privacy rights and how the law protects You. We use Your Personal data to provide and improve the Service. By using the Service, You agree to the collection and use of information in accordance with this Privacy Policy.&#x20;

### **Interpretation and Definitions**

**Interpretation** \
The words of which the initial letter is capitalized have meanings defined under the following conditions. The following definitions shall have the same meaning regardless of whether they appear in singular or in plural. \
\
**Definitions** \
For the purposes of this Privacy Policy: \
\
**Account** means a unique account created for You to access our Service or parts of our Service.\
**Affiliate** means an entity that controls, is controlled by or is under common control with a party, where "control" means ownership of 50% or more of the shares, equity interest or other securities entitled to vote for election of directors or other managing authority. \
**Application** means the software program provided by the Company downloaded by You on any electronic device, named Source Protocol Dashboard \
**Business**, for the purpose of the CCPA (California Consumer Privacy Act), refers to the Company as the legal entity that collects Consumers' personal information and determines the purposes and means of the processing of Consumers' personal information, or on behalf of which such information is collected and that alone, or jointly with others, determines the purposes and means of the processing of consumers' personal information, that does business in the State of California. **Company** (referred to as either "the Company", "We", "Us" or "Our" in this Agreement) refers to Source Protocol Ltd, Sixth (6th) Floor, Water's Edge Building 1, Wickham's Cay II, Road Town, Tortola, VG1110 , British Virgin Islands. For the purpose of the GDPR, the Company is the Data Controller. \
**Consumer**, for the purpose of the CCPA (California Consumer Privacy Act), means a natural person who is a California resident. A resident, as defined in the law, includes (1) every individual who is in the USA for other than a temporary or transitory purpose, and (2) every individual who is domiciled in the USA who is outside the USA for a temporary or transitory purpose. \
**Country** refers to: British Virgin Islands Data Controller, for the purposes of the GDPR (General Data Protection Regulation), refers to the Company as the legal person which alone or jointly with others determines the purposes and means of the processing of Personal Data. \
**Device** means any device that can access the Service such as a computer, a cellphone or a digital tablet. \
**Do Not Track** (DNT) is a concept that has been promoted by US regulatory authorities, in particular the U.S. Federal Trade Commission (FTC), for the Internet industry to develop and implement a mechanism for allowing internet users to control the tracking of their online activities across websites. \
**Personal Data** is any information that relates to an identified or identifiable individual. For the purposes of GDPR, Personal Data means any information relating to You such as a name, an identification number, location data, online identifier or to one or more factors specific to the physical, physiological, genetic, mental, economic, cultural or social identity. For the purposes of the CCPA, Personal Data means any information that identifies, relates to, describes or is capable of being associated with, or could reasonably be linked, directly or indirectly, with You. \
**Sale**, for the purpose of the CCPA (California Consumer Privacy Act), means selling, renting, releasing, disclosing, disseminating, making available, transferring, or otherwise communicating orally, in writing, or by electronic or other means, a Consumer's personal information to another business or a third party for monetary or other valuable consideration. \
**Service** refers to the Application. \
**Service Provider** means any natural or legal person who processes the data on behalf of the Company. It refers to third-party companies or individuals employed by the Company to facilitate the Service, to provide the Service on behalf of the Company, to perform services related to the Service or to assist the Company in analyzing how the Service is used. For the purpose of the GDPR, Service Providers are considered Data Processors. \
**Usage Data** refers to data collected automatically, either generated by the use of the Service or from the Service infrastructure itself (for example, the duration of a page visit). \
**You** means the individual accessing or using the Service, or the company, or other legal entity on behalf of which such individual is accessing or using the Service, as applicable. Under GDPR (General Data Protection Regulation), You can be referred to as the Data Subject or as the User as you are the individual using the Service. <br>

### Collecting and Using Your Personal Data&#x20;

**Types of Data Collected**\
\
**Personal Data** \
While using Our Service, We may ask You to provide Us with certain personally identifiable information that can be used to contact or identify You. Personally identifiable information may include, but is not limited to: Email address, Usage Data \
\
**Usage Data** \
Usage Data is collected automatically when using the Service. \
\
Usage Data may include information such as Your Device's Internet Protocol address (e.g. IP address), browser type, browser version, the pages of our Service that You visit, the time and date of Your visit, the time spent on those pages, unique device identifiers and other diagnostic data.\
\
When You access the Service by or through a mobile device, We may collect certain information automatically, including, but not limited to, the type of mobile device You use, Your mobile device unique ID, the IP address of Your mobile device, Your mobile operating system, the type of mobile Internet browser You use, unique device identifiers and other diagnostic data. \
\
We may also collect information that Your browser sends whenever You visit our Service or when You access the Service by or through a mobile device. \
\
**Use of Your Personal Data** \
The Company may use Personal Data for the following purposes: \
**To provide and maintain our Service,** including to monitor the usage of our Service. \
**To manage Your Account:** to manage Your registration as a user of the Service. The Personal Data You provide can give You access to different functionalities of the Service that are available to You as a registered user. \
**For the performance of a contract:** the development, compliance and undertaking of the purchase contract for the products, items or services You have purchased or of any other contract with Us through the Service. \
**To contact You:** To contact You by email, telephone calls, SMS, or other equivalent forms of electronic communication, such as a mobile application's push notifications regarding updates or informative communications related to the functionalities, products or contracted services, including the security updates, when necessary or reasonable for their implementation. \
**To provide You** with news, special offers and general information about other goods, services and events which we offer that are similar to those that you have already purchased or enquired about unless You have opted not to receive such information. \
**To manage Your requests:** To attend and manage Your requests to Us. \
**For business transfers:** We may use Your information to evaluate or conduct a merger, divestiture, restructuring, reorganization, dissolution, or other sale or transfer of some or all of Our assets, whether as a going concern or as part of bankruptcy, liquidation, or similar proceeding, in which Personal Data held by Us about our Service users is among the assets transferred. \
**For other purposes:** We may use Your information for other purposes, such as data analysis, identifying usage trends, determining the effectiveness of our promotional campaigns and to evaluate and improve our Service, products, services, marketing and your experience.&#x20;

#### &#x20;We may share Your personal information in the following situations:&#x20;

**With Service Providers:** We may share Your personal information with Service Providers to monitor and analyze the use of our Service, for payment processing, to contact You. \
**For business transfers:** We may share or transfer Your personal information in connection with, or during negotiations of, any merger, sale of Company assets, financing, or acquisition of all or a portion of Our business to another company. \
**With Affiliates:** We may share Your information with Our affiliates, in which case we will require those affiliates to honor this Privacy Policy. Affiliates include Our parent company and any other subsidiaries, joint venture partners or other companies that We control or that are under common control with Us. \
**With business partners:** We may share Your information with Our business partners to offer You certain products, services or promotions. \
**With other users:** when You share personal information or otherwise interact in the public areas with other users, such information may be viewed by all users and may be publicly distributed outside. \
**With Your consent:** We may disclose Your personal information for any other purpose with Your consent.&#x20;

#### **Retention of Your Personal Data**

The Company will retain Your Personal Data only for as long as is necessary for the purposes set out in this Privacy Policy. We will retain and use Your Personal Data to the extent necessary to comply with our legal obligations (for example, if we are required to retain your data to comply with applicable laws), resolve disputes, and enforce our legal agreements and policies.&#x20;

The Company will also retain Usage Data for internal analysis purposes. Usage Data is generally retained for a shorter period of time, except when this data is used to strengthen the security or to improve the functionality of Our Service, or We are legally obligated to retain this data for longer time periods.&#x20;

#### Transfer of Your Personal Data

Your information, including Personal Data, is processed at the Company's operating offices and in any other places where the parties involved in the processing are located. It means that this information may be transferred to — and maintained on — computers located outside of Your state, province, country or other governmental jurisdiction where the data protection laws may differ than those from Your jurisdiction.&#x20;

Your consent to this Privacy Policy followed by Your submission of such information represents Your agreement to that transfer.&#x20;

The Company will take all steps reasonably necessary to ensure that Your data is treated securely and in accordance with this Privacy Policy and no transfer of Your Personal Data will take place to an organization or a country unless there are adequate controls in place including the security of Your data and other personal information.&#x20;

#### Delete Your Personal Data&#x20;

You have the right to delete or request that We assist in deleting the Personal Data that We have collected about You.&#x20;

Our Service may give You the ability to delete certain information about You from within the Service.&#x20;

You may update, amend, or delete Your information at any time by signing in to Your Account, if you have one, and visiting the account settings section that allows you to manage Your personal information. You may also contact Us to request access to, correct, or delete any personal information that You have provided to Us.&#x20;

Please note, however, that We may need to retain certain information when we have a legal obligation or lawful basis to do so.&#x20;

#### Disclosure of Your Personal Data&#x20;

**Business Transactions** \
If the Company is involved in a merger, acquisition or asset sale, Your Personal Data may be transferred. We will provide notice before Your Personal Data is transferred and becomes subject to a different Privacy Policy. \
\
**Law enforcement** \
Under certain circumstances, the Company may be required to disclose Your Personal Data if required to do so by law or in response to valid requests by public authorities (e.g. a court or a government agency).&#x20;

**Other legal requirements** \
The Company may disclose Your Personal Data in the good faith belief that such action is necessary to:&#x20;

* Comply with a legal obligation
* Protect and defend the rights or property of the Company
* Prevent or investigate possible wrongdoing in connection with the Service&#x20;
* Protect the personal safety of Users of the Service or the public&#x20;
* Protect against legal liability&#x20;

#### Security of Your Personal Data&#x20;

The security of Your Personal Data is important to Us, but remember that no method of transmission over the Internet, or method of electronic storage is 100% secure. While We strive to use commercially acceptable means to protect Your Personal Data, We cannot guarantee its absolute security.&#x20;

### Detailed Information on the Processing of Your Personal Data&#x20;

The Service Providers We use may have access to Your Personal Data. These third-party vendors collect, store, use, process and transfer information about Your activity on Our Service in accordance with their Privacy Policies.&#x20;

**Analytics** \
We may use third-party Service providers to monitor and analyze the use of our Service. \
\
**Google Analytics** \
Google Analytics is a web analytics service offered by Google that tracks and reports website traffic. Google uses the data collected to track and monitor the use of our Service. This data is shared with other Google services. Google may use the collected data to contextualize and personalize the ads of its own advertising network. You may opt-out of certain Google Analytics features through your mobile device settings, such as your device advertising settings or by following the instructions provided by Google in their Privacy Policy: <https://policies.google.com/privacy> For more information on the privacy practices of Google, please visit the Google Privacy & Terms web page: <https://policies.google.com/privacy> <br>

**Email Marketing** \
We may use Your Personal Data to contact You with newsletters, marketing or promotional materials and other information that may be of interest to You. You may opt-out of receiving any, or all, of these communications from Us by following the unsubscribe link or instructions provided in any email We send or by contacting Us.&#x20;

We may use Email Marketing Service Providers to manage and send emails to You. \
\
**Mailchimp** \
Mailchimp is an email marketing sending service provided by The Rocket Science Group LLC. For more information on the privacy practices of Mailchimp, please visit their Privacy policy: <https://mailchimp.com/legal/privacy/&#x20>;

**Payments** \
We may provide paid products and/or services within the Service. In that case, we may use third-party services for payment processing (e.g. payment processors).&#x20;

We will not store or collect Your payment card details. That information is provided directly to Our third-party payment processors whose use of Your personal information is governed by their Privacy Policy. These payment processors adhere to the standards set by PCI-DSS as managed by the PCI Security Standards Council, which is a joint effort of brands like Visa, Mastercard, American Express and Discover. PCI-DSS requirements help ensure the secure handling of payment information.&#x20;

**PayPal** \
Their Privacy Policy can be viewed at <https://www.paypal.com/webapps/mpp/ua/privacy-full&#x20>;

### GDPR Privacy&#x20;

#### Legal Basis for Processing Personal Data under GDPR&#x20;

We may process Personal Data under the following conditions:

* **Consent:** You have given Your consent for processing Personal Data for one or more specific purposes.&#x20;
* **Performance of a contract:** Provision of Personal Data is necessary for the performance of an agreement with You and/or for any pre-contractual obligations thereof.&#x20;
* **Legal obligations:** Processing Personal Data is necessary for compliance with a legal obligation to which the Company is subject.
* **Vital interests:** Processing Personal Data is necessary in order to protect Your vital interests or of another natural person.&#x20;
* **Public interests:** Processing Personal Data is related to a task that is carried out in the public interest or in the exercise of official authority vested in the Company.&#x20;
* **Legitimate interests:** Processing Personal Data is necessary for the purposes of the legitimate interests pursued by the Company.&#x20;

In any case, the Company will gladly help to clarify the specific legal basis that applies to the processing, and in particular whether the provision of Personal Data is a statutory or contractual requirement, or a requirement necessary to enter into a contract.&#x20;

#### Your Rights under the GDPR&#x20;

The Company undertakes to respect the confidentiality of Your Personal Data and to guarantee You can exercise Your rights.&#x20;

You have the right under this Privacy Policy, and by law if You are within the EU, to:&#x20;

* **Request access to Your Personal Data.** The right to access, update or delete the information We have on You. Whenever made possible, you can access, update or request deletion of Your Personal Data directly within Your account settings section. If you are unable to perform these actions yourself, please contact Us to assist You. This also enables You to receive a copy of the Personal Data We hold about You.&#x20;
* **Request correction of the Personal Data that We hold about You.** You have the right to have any incomplete or inaccurate information We hold about You corrected.&#x20;
* **Object to processing of Your Personal Data.** This right exists where We are relying on a legitimate interest as the legal basis for Our processing and there is something about Your particular situation, which makes You want to object to our processing of Your Personal Data on this ground. You also have the right to object where We are processing Your Personal Data for direct marketing purposes.&#x20;
* **Request erasure of Your Personal Data.** You have the right to ask Us to delete or remove Personal Data when there is no good reason for Us to continue processing it.&#x20;
* **Request the transfer of Your Personal Data.** We will provide to You, or to a third-party You have chosen, Your Personal Data in a structured, commonly used, machine-readable format. Please note that this right only applies to automated information which You initially provided consent for Us to use or where We used the information to perform a contract with You.&#x20;
* **Withdraw Your consent.** You have the right to withdraw Your consent on using your Personal Data. If You withdraw Your consent, We may not be able to provide You with access to certain specific functionalities of the Service.&#x20;

#### Exercising of Your GDPR Data Protection Rights&#x20;

You may exercise Your rights of access, rectification, cancellation and opposition by contacting Us. Please note that we may ask You to verify Your identity before responding to such requests. If You make a request, We will try our best to respond to You as soon as possible.&#x20;

You have the right to complain to a Data Protection Authority about Our collection and use of Your Personal Data. For more information, if You are in the European Economic Area (EEA), please contact Your local data protection authority in the EEA. '

### CCPA Privacy&#x20;

This privacy notice section for California residents supplements the information contained in Our Privacy Policy and it applies solely to all visitors, users, and others who reside in the State of California.&#x20;

#### Categories of Personal Information Collected&#x20;

We collect information that identifies, relates to, describes, references, is capable of being associated with, or could reasonably be linked, directly or indirectly, with a particular Consumer or Device. The following is a list of categories of personal information which we may collect or may have been collected from California residents within the last twelve (12) months.&#x20;

Please note that the categories and examples provided in the list below are those defined in the CCPA. This does not mean that all examples of that category of personal information were in fact collected by Us, but reflects our good faith belief to the best of our knowledge that some of that information from the applicable category may be and may have been collected. For example, certain categories of personal information would only be collected if You provided such personal information directly to Us.&#x20;

**Category A: Identifiers.** \
Examples: A real name, alias, postal address, unique personal identifier, online identifier, Internet Protocol address, email address, account name, driver's license number, passport number, or other similar identifiers. Collected: Yes. \
**Category B: Personal information categories listed in the California Customer Records statute (Cal. Civ. Code § 1798.80(e)).**\
Examples: A name, signature, Social Security number, physical characteristics or description, address, telephone number, passport number, driver's license or state identification card number, insurance policy number, education, employment, employment history, bank account number, credit card number, debit card number, or any other financial information, medical information, or health insurance information. Some personal information included in this category may overlap with other categories. Collected: Yes. \
**Category C: Protected classification characteristics under California or federal law.** \
Examples: Age (40 years or older), race, color, ancestry, national origin, citizenship, religion or creed, marital status, medical condition, physical or mental disability, sex (including gender, gender identity, gender expression, pregnancy or childbirth and related medical conditions), sexual orientation, veteran or military status, genetic information (including familial genetic information). Collected: No. \
**Category D: Commercial information.** Examples: Records and history of products or services purchased or considered. Collected: Yes. \
**Category E: Biometric information.** Examples: Genetic, physiological, behavioral, and biological characteristics, or activity patterns used to extract a template or other identifier or identifying information, such as, fingerprints, faceprints, and voiceprints, iris or retina scans, keystroke, gait, or other physical patterns, and sleep, health, or exercise data. Collected: No. \
**Category F: Internet or other similar network activity.** Examples: Interaction with our Service or advertisement. Collected: Yes. \
**Category G:** Geolocation data. Examples: Approximate physical location. Collected: No. \
**Category H:** Sensory data. Examples: Audio, electronic, visual, thermal, olfactory, or similar information. Collected: No. \
**Category I:** Professional or employment-related information. Examples: Current or past job history or performance evaluations. Collected: No. \
**Category J:** Non-public education information (per the Family Educational Rights and Privacy Act (20 U.S.C. Section 1232g, 34 C.F.R. Part 99)). Examples: Education records directly related to a student maintained by an educational institution or party acting on its behalf, such as grades, transcripts, class lists, student schedules, student identification codes, student financial information, or student disciplinary records. Collected: No. \
**Category K:** Inferences drawn from other personal information. Examples: Profile reflecting a person's preferences, characteristics, psychological trends, predispositions, behavior, attitudes, intelligence, abilities, and aptitudes. Collected: No.&#x20;

Under CCPA, personal information does not include:&#x20;

* Publicly available information from government records&#x20;
* Deidentified or aggregated consumer information&#x20;
* Information excluded from the CCPA's scope, such as: \
  \- Health or medical information covered by the Health Insurance Portability and Accountability Act of 1996 (HIPAA) and the California Confidentiality of Medical Information Act (CMIA) or clinical trial data \
  \- Personal Information covered by certain sector-specific privacy laws, including the Fair Credit Reporting Act (FRCA), the Gramm-Leach-Bliley Act (GLBA) or California Financial Information Privacy Act (FIPA), and the Driver's Privacy Protection Act of 1994&#x20;

#### Sources of Personal Information&#x20;

We obtain the categories of personal information listed above from the following categories of sources: Directly from You. For example, from the forms You complete on our Service, preferences You express or provide through our Service, or from Your purchases on our Service. Indirectly from You. For example, from observing Your activity on our Service. Automatically from You. For example, through cookies We or our Service Providers set on Your Device as You navigate through our Service. From Service Providers. For example, third-party vendors to monitor and analyze the use of our Service, third-party vendors for payment processing, or other third-party vendors that We use to provide the Service to You.&#x20;

#### Use of Personal Information for Business Purposes or Commercial Purposes&#x20;

We may use or disclose personal information We collect for "business purposes" or "commercial purposes" (as defined under the CCPA), which may include the following examples: To operate our Service and provide You with our Service. To provide You with support and to respond to Your inquiries, including to investigate and address Your concerns and monitor and improve our Service. To fulfill or meet the reason You provided the information. For example, if You share Your contact information to ask a question about our Service, We will use that personal information to respond to Your inquiry. If You provide Your personal information to purchase a product or service, We will use that information to process Your payment and facilitate delivery. To respond to law enforcement requests and as required by applicable law, court order, or governmental regulations. As described to You when collecting Your personal information or as otherwise set forth in the CCPA. For internal administrative and auditing purposes. To detect security incidents and protect against malicious, deceptive, fraudulent or illegal activity, including, when necessary, to prosecute those responsible for such activities.&#x20;

Please note that the examples provided above are illustrative and not intended to be exhaustive. For more details on how we use this information, please refer to the "Use of Your Personal Data" section.&#x20;

If We decide to collect additional categories of personal information or use the personal information We collected for materially different, unrelated, or incompatible purposes We will update this Privacy Policy.&#x20;

#### Disclosure of Personal Information for Business Purposes or Commercial Purposes&#x20;

We may use or disclose and may have used or disclosed in the last twelve (12) months the following categories of personal information for business or commercial purposes: Category A: Identifiers Category B: Personal information categories listed in the California Customer Records statute (Cal. Civ. Code § 1798.80(e)) Category D: Commercial information Category F: Internet or other similar network activity Please note that the categories listed above are those defined in the CCPA. This does not mean that all examples of that category of personal information were in fact disclosed, but reflects our good faith belief to the best of our knowledge that some of that information from the applicable category may be and may have been disclosed. When We disclose personal information for a business purpose or a commercial purpose, We enter a contract that describes the purpose and requires the recipient to both keep that personal information confidential and not use it for any purpose except performing the contract.&#x20;

#### Sale of Personal Information&#x20;

As defined in the CCPA, "sell" and "sale" mean selling, renting, releasing, disclosing, disseminating, making available, transferring, or otherwise communicating orally, in writing, or by electronic or other means, a consumer's personal information by the business to a third party for valuable consideration. This means that We may have received some kind of benefit in return for sharing personal information, but not necessarily a monetary benefit. Please note that the categories listed below are those defined in the CCPA. This does not mean that all examples of that category of personal information were in fact sold, but reflects our good faith belief to the best of our knowledge that some of that information from the applicable category may be and may have been shared for value in return. We may sell and may have sold in the last twelve (12) months the following categories of personal information: Category A: Identifiers Category B: Personal information categories listed in the California Customer Records statute (Cal. Civ. Code § 1798.80(e)) Category D: Commercial information Category F: Internet or other similar network activity&#x20;

#### Share of Personal Information&#x20;

We may share Your personal information identified in the above categories with the following categories of third parties: Service Providers Payment processors Our affiliates Our business partners Third party vendors to whom You or Your agents authorize Us to disclose Your personal information in connection with products or services We provide to You&#x20;

#### Sale of Personal Information of Minors Under 16 Years of Age&#x20;

We do not knowingly collect personal information from minors under the age of 16 through our Service, although certain third party websites that we link to may do so. These third-party websites have their own terms of use and privacy policies and we encourage parents and legal guardians to monitor their children's Internet usage and instruct their children to never provide information on other websites without their permission. We do not sell the personal information of Consumers We actually know are less than 16 years of age, unless We receive affirmative authorization (the "right to opt-in") from either the Consumer who is between 13 and 16 years of age, or the parent or guardian of a Consumer less than 13 years of age. Consumers who opt-in to the sale of personal information may opt-out of future sales at any time. To exercise the right to opt-out, You (or Your authorized representative) may submit a request to Us by contacting Us. If You have reason to believe that a child under the age of 13 (or 16) has provided Us with personal information, please contact Us with sufficient detail to enable Us to delete that information.&#x20;

#### Your Rights under the CCPA

The CCPA provides California residents with specific rights regarding their personal information. If You are a resident of California, You have the following rights: The right to notice. You have the right to be notified which categories of Personal Data are being collected and the purposes for which the Personal Data is being used. The right to request. Under CCPA, You have the right to request that We disclose information to You about Our collection, use, sale, disclosure for business purposes and share of personal information. Once We receive and confirm Your request, We will disclose to You: The categories of personal information We collected about You The categories of sources for the personal information We collected about You Our business or commercial purpose for collecting or selling that personal information The categories of third parties with whom We share that personal information The specific pieces of personal information We collected about You If we sold Your personal information or disclosed Your personal information for a business purpose, We will disclose to You: The categories of personal information categories sold The categories of personal information categories disclosed The right to say no to the sale of Personal Data (opt-out). You have the right to direct Us to not sell Your personal information. To submit an opt-out request please contact Us. The right to delete Personal Data. You have the right to request the deletion of Your Personal Data, subject to certain exceptions. Once We receive and confirm Your request, We will delete (and direct Our Service Providers to delete) Your personal information from our records, unless an exception applies. We may deny Your deletion request if retaining the information is necessary for Us or Our Service Providers to: Complete the transaction for which We collected the personal information, provide a good or service that You requested, take actions reasonably anticipated within the context of our ongoing business relationship with You, or otherwise perform our contract with You. Detect security incidents, protect against malicious, deceptive, fraudulent, or illegal activity, or prosecute those responsible for such activities. Debug products to identify and repair errors that impair existing intended functionality. Exercise free speech, ensure the right of another consumer to exercise their free speech rights, or exercise another right provided for by law. Comply with the California Electronic Communications Privacy Act (Cal. Penal Code § 1546 et. seq.). Engage in public or peer-reviewed scientific, historical, or statistical research in the public interest that adheres to all other applicable ethics and privacy laws, when the information's deletion may likely render impossible or seriously impair the research's achievement, if You previously provided informed consent. Enable solely internal uses that are reasonably aligned with consumer expectations based on Your relationship with Us. Comply with a legal obligation. Make other internal and lawful uses of that information that are compatible with the context in which You provided it. The right not to be discriminated against. You have the right not to be discriminated against for exercising any of Your consumer's rights, including by: Denying goods or services to You Charging different prices or rates for goods or services, including the use of discounts or other benefits or imposing penalties Providing a different level or quality of goods or services to You Suggesting that You will receive a different price or rate for goods or services or a different level or quality of goods or services&#x20;

#### Exercising Your CCPA Data Protection Rights&#x20;

In order to exercise any of Your rights under the CCPA, and if You are a California resident, You can contact Us: By email: <info@sourceprotocol.io> Only You, or a person registered with the California Secretary of State that You authorize to act on Your behalf, may make a verifiable request related to Your personal information. Your request to Us must: Provide sufficient information that allows Us to reasonably verify You are the person about whom We collected personal information or an authorized representative Describe Your request with sufficient detail that allows Us to properly understand, evaluate, and respond to it We cannot respond to Your request or provide You with the required information if We cannot: Verify Your identity or authority to make the request And confirm that the personal information relates to You We will disclose and deliver the required information free of charge within 45 days of receiving Your verifiable request. The time period to provide the required information may be extended once by an additional 45 days when reasonably necessary and with prior notice. Any disclosures We provide will only cover the 12-month period preceding the verifiable request's receipt. For data portability requests, We will select a format to provide Your personal information that is readily usable and should allow You to transmit the information from one entity to another entity without hindrance.&#x20;

#### Do Not Sell My Personal Information&#x20;

You have the right to opt-out of the sale of Your personal information. Once We receive and confirm a verifiable consumer request from You, we will stop selling Your personal information. To exercise Your right to opt-out, please contact Us. The Service Providers we partner with (for example, our analytics or advertising partners) may use technology on the Service that sells personal information as defined by the CCPA law. If you wish to opt out of the use of Your personal information for interest-based advertising purposes and these potential sales as defined under CCPA law, you may do so by following the instructions below. Please note that any opt out is specific to the browser You use. You may need to opt out on every browser that You use. <br>

**Website** \
You can opt out of receiving ads that are personalized as served by our Service Providers by following our instructions presented on the Service: The NAI's opt-out platform: <http://www.networkadvertising.org/choices/> The EDAA's opt-out platform <http://www.youronlinechoices.com/> The DAA's opt-out platform: <http://optout.aboutads.info/?c=2\\&lang=EN> The opt out will place a cookie on Your computer that is unique to the browser You use to opt out. If you change browsers or delete the cookies saved by your browser, You will need to opt out again. <br>

**Mobile Devices** \
Your mobile device may give You the ability to opt out of the use of information about the apps You use in order to serve You ads that are targeted to Your interests: "Opt out of Interest-Based Ads" or "Opt out of Ads Personalization" on Android devices "Limit Ad Tracking" on iOS devices You can also stop the collection of location information from Your mobile device by changing the preferences on Your mobile device.&#x20;

### "Do Not Track" Policy as Required by California Online Privacy Protection Act (CalOPPA)&#x20;

Our Service does not respond to Do Not Track signals. However, some third party websites do keep track of Your browsing activities. If You are visiting such websites, You can set Your preferences in Your web browser to inform websites that You do not want to be tracked. You can enable or disable DNT by visiting the preferences or settings page of Your web browser.&#x20;

### Children's Privacy&#x20;

Our Service does not address anyone under the age of 13. We do not knowingly collect personally identifiable information from anyone under the age of 13. If You are a parent or guardian and You are aware that Your child has provided Us with Personal Data, please contact Us. If We become aware that We have collected Personal Data from anyone under the age of 13 without verification of parental consent, We take steps to remove that information from Our servers. If We need to rely on consent as a legal basis for processing Your information and Your country requires consent from a parent, We may require Your parent's consent before We collect and use that information.&#x20;

### Your California Privacy Rights (California's Shine the Light law)&#x20;

Under California Civil Code Section 1798 (California's Shine the Light law), California residents with an established business relationship with us can request information once a year about sharing their Personal Data with third parties for the third parties' direct marketing purposes. If you'd like to request more information under the California Shine the Light law, and if You are a California resident, You can contact Us using the contact information provided below.&#x20;

### California Privacy Rights for Minor Users (California Business and Professions Code Section 22581)&#x20;

California Business and Professions Code Section 22581 allows California residents under the age of 18 who are registered users of online sites, services or applications to request and obtain removal of content or information they have publicly posted. To request removal of such data, and if You are a California resident, You can contact Us using the contact information provided below, and include the email address associated with Your account. Be aware that Your request does not guarantee complete or comprehensive removal of content or information posted online and that the law may not permit or require removal in certain circumstances.

### &#x20;Links to Other Websites&#x20;

Our Service may contain links to other websites that are not operated by Us. If You click on a third party link, You will be directed to that third party's site. We strongly advise You to review the Privacy Policy of every site You visit. We have no control over and assume no responsibility for the content, privacy policies or practices of any third party sites or services.&#x20;

### Changes to this Privacy Policy&#x20;

We may update Our Privacy Policy from time to time. We will notify You of any changes by posting the new Privacy Policy on this page. We will let You know via email and/or a prominent notice on Our Service, prior to the change becoming effective and update the "Last updated" date at the top of this Privacy Policy. You are advised to review this Privacy Policy periodically for any changes. Changes to this Privacy Policy are effective when they are posted on this page.&#x20;

### Contact Us&#x20;

If you have any questions about this Privacy Policy, You can contact us: By email: <info@sourceprotocol.io>\ <br>


