Decentralized signal portfolio(DSP)
The Decentralized Signal Portfolio (DSP) is an open-source package that enables access to high-quality signals about a borrower's income, assets, and liabilities. These signals are collected through Signal Adapters in the package, which gather data from a variety of on-chain and off-chain sources. Any developer can contribute to the platform by adding a new Signal Adapter for a specific data source. By adding and improving these signals, we can not only improve the quality of evaluations made by Evaluation Agents but also provide a valuable data source for reuse by the broader ecosystem.
In general, there are a few different flavors of signals:
- Income signals represent the amount, frequency, and other quantitative features that describe the income associated with a wallet. Predicted future income could be included as well.
- Asset signals represent the quality and quantity of the borrowers' assets.
- Liability signals represent borrowers' payment obligations from their assets and future income.
There is a wide range of sources that a Signal Adapter can be developed to fetch from. Examples include:
- On-chain sources
- Direct payments from treasuries, i.e., Gnosis SAFE, Circle Business Account
- Payments/invoices like Request Network, Utopia Labs, Coinshift, Superfluid
- Positions in lending pools
- Yield farming
- Staking, mining, and validation income
- Gaming income
- NFT royalties
- Balances, transactions, and revenue like Plaid, Teller, Stripe, Quickbooks, Recurly
- Invoices like Bill, Stripe, PayPal, Invoice2Go, Square, Zoho
- Income data aggregates like Pinwheel, Finicity, Argyle
- Sales data like Shopify, Amazon
- Credit/debt data aggregates like Experian API
Add a new signal definition class to list all the signals supported by the new adapter like the one below:
from huma_signals import models
It's likely that your new Signal Adapter needs some specific env settings to run, e.g. Alchemy API key. You can create a
pydantic.Settingclass to capture all the env settings for your adapter. For example:
case_sensitive = False
settings = Settings()
Then in your adapter, you can access the env vars by referencing the settings defined above.
Add an Adapter class with code to fetch data from external sources and compute derived signals. Below is an example:
from typing import Any
from huma_signals.adapters import models as adapter_models
def __init__(self, *args: Any, **kwargs: Any):
async def fetch(
self, input_a: str, input_b: str, input_c: str
) -> EthereumWalletSignals:
The unified interface to receive inputs and return computed signals.
pytestfor test framework.
pytest-describeto organize tests.
- If your adapter makes network requests, please use VCR cassettes to capture them so that the unit test environment do not make real network requests at runtime.
- If your tests require environment variables to run, please specify them in
pydantic.Settingclasses in your test files.
- 1.Implement the Signal Adapter according to the provided interface, and submit a pull request for review by Huma DAO.
- 2.If your Signal Adapter is accepted, it will be published as part of the package with the appropriate open-source license.
- 3.Evaluation Agents (EAs) can install the
huma-signalspackage and use your Signal Adapter to fetch signals.
- 4.Performance and usage statistics for Signal Adapters will be regularly collected and shared as metadata. This information will be valuable to EA developers in choosing the most robust Signal Adapters, and will also be used to calculate rewards for contributors.
- 5.Each Signal Adapter must be maintained by its original developer, Huma DAO, or the community. The maintainer will receive rewards but is also responsible for meeting service level agreements, implementing new features, and addressing bug fixes for the Signal Adapter.
We invite developers to contribute to the initial development and ongoing maintenance of Signal Adapters on the DSP platform. As a way to kickstart development, Huma offers bounty programs and a portion of the protocol revenue will be allocated to reward Signal Adapter developers and maintainers. The Huma DAO will review all contributions and determine how to distribute the reward pool among different contributors. Join us and be a part of building the future of decentralized finance!