# The auto-bribe engine

Pearl DEX launched in 2023 with a unique mechanism that differentiates it from other Solidly DEXes. When most Solidly platform require external contributions from protocols to bribe so emissions can be directed towards their pools, creating a constant competition between protocols, Pearl innovated by creating an auto-bribing engine. This documentation presents how this mechanism works.

## Rebasing tokens

When Pearl initially launched, they partnered with the Tangible DAO team to make sure that every single pool would be a pair that contains the $USDR token, a stablecoin backed by Real Estate that was distributing rental yields via rebases.

After they launch on re.al network, Pearl is now making sure that every pair contains at least a rebasing token, which is easy as pretty much all tokens on the chain are earning yields from off-chain sources and distribute the yields via rebases.

### How rebase tokens work

A rebasing token has an elastic supply, meaning that the circulating supply of the token will increase (or decrease) over time in order to represent the yield earned by the token, either from on-chain or off-chain sources. The supply is adjusted automatically in your wallet and the `balanceOf()` function includes a multiplier that indicates the growth of the token supply over time. When the token is created on the chain, that multiplier is set to 1 initially, then as rebases happen, that multiplier goes up or down in value. The value of that multiplier, also known as rebase index, is accessible in the smart contract of the rebasing token via the `rebaseIndex()` method.

<figure><img src="/files/ZyqyyKb9ksXUW6Fk7GIS" alt=""><figcaption><p>Rebase Index for USTB = 1.04</p></figcaption></figure>

### Example

If this explanation is a bit confusing, let's see how it actually works with an example. Let's say that on the very first day of the launch of a rebasing token we have

* 1,000,000 total supply for the token
* An APY of 5%
* I own 1,000 of these tokens
* The rebase index is 1

With the assumption above, I know that my share is 0.1% of all circulating tokens.

After a full year, the situation changed

* the total supply is now 1,000,000 x 1.05 = 1,050,000 tokens (to take the 5% APY into account)
* the rebase index is now at 1,050,000 / 1,000,000 = 1.05
* my balance is the initial 1,000 tokens multiplied by the rebase index, so 1,000 x 1.05 = 1,050 tokens
* my share is still 1,050,000 / 1,050 = 0.1%

### Rebasing tokens in crypto

There are many rebasing tokens out there. Probably the most known one is stETH, a representation of staked Ethereum that LIDO issues. The way stETH works is as follows

* Users will deposit $ETH on LIDO decentralized application
* LIDO issues $stETH with a 1:1 ratio to people who deposited their $ETH
* LIDO uses the $ETH that is deposited to stake it and add more validators to their network (1 validator requires 32 ETH to operate).
* LIDO validators earn ETH rewards by validating transaction on the Ethereum Network
* the ETH rewards is passed to $stETH holders in the form of a rebase
* Users can always redeem their $stETH for $ETH with a 1:1 ratio on LIDO

On re.al network, many tokens are rebasing from different sources and with various rebase indexes representing the APY of the tokens. As of August 2024, here are some tokens you can find on re.al:

* USTB rebases with an APY of 5%
* DAI rebases with an APY of 8%
* UKRE rebases with an APY of 13%

## The skimming engine

The rebase of the different tokens on re.al is usually updated once a day. This means that the circulating supply grows daily, wherever the rebasing token is, including in a **L**iquidity **P**air on Pearl. This means that if

* I own 1,000 tokens in a LP pool (Liquidity Pair pool)
* That token is rebasing with a 5% APY
* This means that after 1 day, my yield would be 1,000 x 0.05 / 365 = 0.14 tokens, so I would have 1,000.14 after the rebase occurred

The Pearl skimming engine is actually able to harvest the rebase of the token in a liquidity pair, meaning that in the situation described above, after the rebase, you would still have 1,000 tokens and the 0.14 extra are removed from my position, and added to the bribes.

This is mostly done by checking the difference between the rebase index before and after the rebase, then calculate how much tokens need to be removed from the pool. You still own the same share of the pool before and after the rebase though, and the exact same number of tokens.

{% hint style="danger" %}
This also means that when you provide liquidity on Pearl, you renounce the yields your token may get and agree to give it away to the bribes. So make sure that the rewards you get from providing liquidity compensates for the "loss" of rebase reward.
{% endhint %}

## Auto-bribing pools

As the skimming engine harvests rewards from rebases and add them to bribes, the bribes increase after each rebase. You can check this by heading to the [vote page on Pearl](https://www.pearl.exchange/vote) and verify that the amount bribed for a given pool is increasing around midnight UTC, the time at which rebases usually occur.

As an example, this is what the vote page shows for the USTB/arcUSD pool:

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

The bribe amount in this screenshot is $1,715.14 that is solely coming from rebases of the 2 tokens. The pool is actually composed of these tokens:

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

* $1,194.665.62 of USTB that rebases at 5% APY
* $936,144.08 of arcUSD rebasing at 8.89% APY

This means that daily, the skimming engine adds

* 1,194,665.62 \* 0.05 / 365 = $163.65 of USTB to the bribes
* 936,144.08 \* 0.0889 / 365 = $228.01 of arcUSD to the bribes
* or a grand total of 163.65 + 228.01 = $391.66 to the bribes

{% hint style="success" %}
It's easy to see that if the TVL grows, or if the rebasing tokens get better rebases, the value bribes will increase, feeding the Pearl flywheel.
{% endhint %}

{% hint style="info" %}
As a side note, and because the pool is pretty balanced, the current farming APR of 8.5% paid in PEARL token provides more rewards than simply holding the exact same amount of arcUSD and USTB, but probably a little less than holding the $ value in arcUSD only.
{% endhint %}

Because the auto-bribe module that uses the skimming engine adds bribes automatically, the Arcana protocol that's issuing arcUSD, or the Tangible DAO protocol that issues USTB don't have to add as much bribes to attract TVL in the pools, as the voters will probably vote to these pools anyway to collect the bribes from rebases. Any additional money provided by protocols or users in the form of bribes will definitely increase the emissions for that pool, but it's not as critical as on other Solidly platforms.

## Final thoughts

Pearl is really one of a kind with its auto-bribe mechanism, and support for rebasing tokens that most other DEXes are not even able to support. This page was made to give a very high level explanation of why the skimming engine is important for Pearl and its users, as well as for protocols who are adding their tokens to the DEX.

It is also important to see that the auto-bribe feature is playing a strong role in the price of the PEARL token. Indeed, as long as voting incentives (bribes) are flowing from skimming rebases in the pools, there will be users who will buy and lock the PEARL token to get these voting rewards, effectively removing PEARL from the market and increasing the price of the token. This is obviously not a financial advice, make sure you understand the models before investing in a token or a protocol.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://real-community.gitbook.io/re.al-community/pearl/the-auto-bribe-engine.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
