# Introducing the Autocap Allocator
Filecoin's Fil+ program faces three challenges:
1. Inefficient human-in-the-loop verification creating bottlenecks;
2. Vulnerability to abuse undermining confidence in legitimate data storage, and
3. Ecosystem value leakage when DataCap (DC) maintenance costs aren't offset by customer payments.
Our Game Theoretic Programmable Fil+ Allocator addresses these issues while strengthening Filecoin's value proposition.
[**Autocap**](https://github.com/CELtd/filplus-autocap) is a programmable allocator.
Storage Providers (SP) that made an *on-chain paid deal* with a client can request AutoCap for QAP reward for sealing such a deal upon payment of a fee. This fee is proportional to the *on-chain deal payment* and is known in advance to the SP, which can therefore pass it on to the client. Fees are partially burned to accrue value in the Filecoin economy
## What is Autocap
A mechanism to:
- **Reward QAP to SPs that brought *paid deals* on-chain**;
- **Accrue value in the Filecoin economy** from *on-chain paid deals*.
## Autocap is not
- **A pay to get datacap service**: a real *on-chain deal payment* needs to exist, and the fee paid has to be proportional to the *payment*.
- **A replacement for other allocators**. It simply offers a new route to access DataCap.
- **A mechanism to erode SP ROI**: the fee the SP has to pay to engage with Autocap is proportional to the *on-chain deal payment* and is known in advance to the SP, which can therefore pass it on to the client.
## How it works (High level overview)
* Autocap issues a fixed amount of DataCap (DC) at fixed time intervals called rounds;
* SPs with a *on-chain deal payment* send a fee in FIL to Autocap, specifying the details of the *deal*. The fee has to be proportional to the *on-chain deal payment* for the contribution to be valid;
* At the end of each round, Autocap distributes the DC prize to the SPs that submitted valid contributions. The DC prize for each SP is proportional to the fee each SP paid, i.e. proportional to the *on-chain deal payment*:
Higher *on-chain deal payment* -> Higher contribution fee -> Higher share of the DC reward;
* Autocap creates claimable DC allocations tied to the *on-chain deal* each SP communicated to Autocap: SPs can now seal the deal and claim QAP;
* A portion of the fees collected in the round is burned, recirculating value into the broader Filecoin economy.
Self-dealing is disincentivized. On the one hand, SP with real paying clients can offset the cost of engaging with Autocap directly to their clients. On the other hand, self-dealing SP will have to bear the whole cost of interacting with Autocap.
---
## Technical details
Storage Providers (SP) that made an unsealed on-chain deal with a client can request AutoCap for QAP reward for sealing such a deal.
1. The SP sends a transaction in FIL to the wallet address of AutoCap.
The SP needs to include in the `params` section of the tx the encoded `deal` metadata.
```
lotus send --from <SP-addr> --params-hex a66870726... <AutoCap-addr> 0.001
```
Now the SP is participating in the next round of DataCap (DC) distribution of AutoCap.
2. AutoCap creates an allocation of DC in the `Verified Registry` on behalf of the SP with an amount of DC equal to the deal size.
```
AllocationID Client Miner PieceCid PieceSize TermMin TermMax Expiration
15 1003 <SP-addr> baga6e... 1024 518400 1036800 48618
```
3. The SP can now seal the deal and claim the QAP associated the allocation created by AutoCap
### What happens under the hood?
When a SP with a unverified and unsealed deal sends a valid tx to the allocator (FIL + deal metadata):
1. AutoCap **registers the incoming valid txs** from the SPs
```
🪙 Detected tx: bafy2b... from <SP-addr> with 0.001 FIL
```
Adding it to the list of eligible participants for DC distribution in the current round.
2. Every `x` blocks, AutoCap **distributes a fixed amount of DC prize** `D` to the SPs participating in the current round.
In each round, each participating SP receives an amount of DC `credit` (`dc`) proportional to the contribution in FIL that the SP had during the auction:
$$dc_i = D \cdot \frac{FIL_i}{\sum_j FIL_j}$$
Where:
- $dc_i$ is the amount of datacap issued to the i-th SP in the current round
- $FIL_i$ is the contribution in FIL of the i-th SP in the current round
- $D$ is the total datacap prize issued each round
- $\sum_j FIL_j$ is the sum of all FIL contributions from all participating SPs in the current round
**In plain english**: if in the current round there are 10 SP contributing, and each of them contributed with the same amount of FIL, each of them will receive 10% of the DC prize.
3. The **DC prize** won by the SP in the current round is **added in its DC credit**:
```
💸 <SP-addr> gained 1 GiB of DataCap in this round.
💰 <SP-addr> has 1.1 GiB of DC credit
```
**Note**: Each SP owns a DC credit. For each SP the credit is equal to:
`DC won in the current round + DC unspent from previous rounds`
(In this example the SP had 0.1 GiB of DC unspent from previous rounds)
4. Now AutoCap **creates the DC allocations for each SP** and associated to the deal that each SP declared in the first step:
- **If SP's DC credit is greater or equal than the provided deal piece size**: AutoCap creates an allocation for the SP tied to that deal, and DC credit is updated.
```
✅ 1 GiB DataCap allocation created for <SP-addr> → Tx CID: "bafy2..."
💰 <SP-addr> has 0.1 GiB of DC credit remaining
```
- **If SP's DC credit is smaller than the provided deal piece size**: AutoCap can't create an allocation. SP credit is unchanged.
```
⚠️ <SP-addr> has insufficient credits. Required: 2 GiB, Available: 1.1 GiB
💰 <SP-addr> has 1.1 GiB of DC credit reamining
```
5. A **part of the FIL collected** in the AutoCap allocator **is burned** to accrue value in FIL economy (our current approach is: ⅓ is burned, ⅓ is reserved for PGF, ⅓ is for funding the development of the allocator)
```
🔥 Sent 500000000000000 aFIL to burn address. CID: bafy2b...
```
6. A **new round starts**.
---
# Closing Thoughts
The Autocap Allocator introduces a fully automated, transparent, and economically aligned alternative to the status quo. It ensures:
* Datacap only flows to storage deals holding an on-chain payment
* The Filecoin ecosystem gains value through regular token burns
* Self-dealing is uneconomical and discouraged by design
➡️ Code & docs: [github.com/CELtd/filplus-autocap](https://github.com/CELtd/filplus-autocap)