# Data marketplace

> How data providers sell feeds to vaults through DataProviderRegistry, with prepaid daily fees, performance royalties and on-chain access checks.

Source: https://docs.degenhive.ai/data

The data marketplace lets anyone sell a data feed to vault managers. `DataProviderRegistry` on HyperEVM (chain 999) records each feed's terms, holds prepaid USDC in escrow, collects royalties from vault fees and answers one question for the provider's API: does this vault have access right now?

> [!IMPORTANT]
> The registry is not deployed yet and not externally audited. Addresses publish at launch on [Network](https://docs.degenhive.ai/network.md).

## How it works

1. A provider calls `registerProvider` with a payout address, a daily price, a royalty share and a metadata URI. It receives a `providerId`.
2. A vault's manager subscribes for a number of days, paying the prepaid fee from their own wallet into escrow. Terms lock at that moment.
3. The vault names a data key. The provider's API asks the registry whether a signer may read the feed with `verifyAccess`. See [Gating access](https://docs.degenhive.ai/data/access.md).
4. Prepaid USDC streams to the provider every second of the subscription. Royalties arrive each time the vault pays a performance fee.
5. Anyone calls `claim` to send what the provider earned to its payout address.

Only vaults deployed by `HyperVaultFactory`, or vaults the council allowlists, can subscribe. The data never touches the chain: the registry handles terms, money and access, and the provider serves the data from its own API.

## Two ways to charge

A feed can use either model or both.

| | Prepaid daily fee | Performance royalty |
|---|---|---|
| Term | `dailyUsdcFee` | `managerShareBps` |
| Who pays | The subscriber's wallet, into escrow | The vault's performance fee, at each fee flush |
| When the provider earns | Linearly, second by second, while access is live | Only when the vault earns a performance fee |
| Bound | Any amount, 0 allowed. Up to `maxPrepaidDays` (default 90, at most 365) ahead. | At most 500 bps (5%) of the royalty base |
| Marketplace take | Up to 1,000 bps, locked at subscribe | None |

The royalty base is the vault's net performance fee after the protocol take on a third-party vault, or the full net performance fee on a flagship. A feed with a 300 bps royalty on a vault whose base is 8,000 USDC earns 240 USDC that roll. See the [fee waterfall](https://docs.degenhive.ai/vaults/fees.md#the-waterfall).

Per-vault limits on royalties:

| Limit | Value |
|---|---|
| Royalty per feed | 500 bps (`MAX_PROVIDER_SHARE_BPS`) |
| Royalty feeds per vault | 20 (`MAX_ROYALTY_FEEDS_PER_VAULT`). Prepaid-only feeds are unlimited. |
| Royalties combined per vault | 5,000 bps (`MAX_COMBINED_ROYALTY_BPS`) |

## Marketplace take

The council sets `marketplaceTakeBps`, from 0 (the default) to 1,000 bps (10%). It applies to prepaid fees only. Each subscription locks the take that applied when it started; renewals blend the old and new take by escrow. The take collects in `claimableMarketplaceFees`, and anyone can send it to `HyperRevenueRouter.notifyRevenue` with `claimMarketplaceFees()`. Royalties carry no take.

## Approval-required feeds

A provider that registers with `approvalRequired = true` chooses its subscribers. A vault must be approved with `setProviderApproval(providerId, vault, true)` before it subscribes, or `subscribe` reverts with `VaultNotApproved(vault, providerId)`. Use it for feeds with licensing limits or capacity caps.

## Badges

The council can mark a feed `VERIFIED` or `FLAGSHIP_BOOTSTRAP` with `setProviderBadge`. Every feed starts `UNVERIFIED`. `VERIFIED` means the council checked that the provider controls the actual data source. A badge is display only: no contract logic reads it, and it changes no terms.

## Suspension

The council can suspend a provider with `setProviderActive(providerId, false)`. While suspended:

- `verifyAccess` returns false for every subscriber;
- prepaid streams pause and no royalties accrue;
- managers can cancel for a full refund of their remaining escrow.

When the council lifts the suspension, the suspended time is added to every subscription, so subscribers lose no paid days. A provider deactivating its own feed is different: it only blocks new subscriptions, and live ones keep access and billing.

## Reading the marketplace

The read API at `https://api.degenhive.ai/v1` lists providers, subscriptions and royalty payments under `/v1/data/*`. See [API](https://docs.degenhive.ai/api.md).

## Related

- [Publish a feed](https://docs.degenhive.ai/data/publish-a-feed.md) Register a provider, get subscribers and get paid.
- [Gating access](https://docs.degenhive.ai/data/access.md) Check subscribers in your API with `verifyAccess`.
- [REST API](https://docs.degenhive.ai/api.md) Read providers, subscriptions and royalty payouts.
- [Fees](https://docs.degenhive.ai/vaults/fees.md) Where royalties sit in the vault fee waterfall.
