<aside> 💡

To use this function, you must use GlueERC20 or GlueERC721 contract of a specific Sticky Token. To better understand the Glue Ecosystem architecture and find the correct deployment addresses, visit visit Lore and Architecture | License & Deployments

</aside>

The getSupplyDelta function is a crucial component of the Glue Protocol that calculates the proportion of collateral that can be unglued based on the amount of sticky tokens being burned. This function provides a deterministic way to calculate withdrawal entitlements while accounting for various token supply mechanics.

Adjusted Total Supply

By passing an amount of the Sticky Token, you can call getSupplyDelta to receive a uint256 return. This value can be used for various external calculations, providing important information about the passed amount and the adjustedTotalSupply.

The Supply Delta is calculated from the Adjusted Total Supply. This information, available without requiring external calculations, is unique to Glue.

The Adjusted Total Supply offers a more realistic total supply of the Sticky Token. It takes into account both the totalSupply and the assets held by the DeAd address and stored in Glue. This makes it the most pragmatic total supply information about an asset you can find in DeFi.

👇 To learn more about the adjustedTotalSupply

Get the Adjusted Total Supply

// Example: 
// Total Adjusted Supply = 1,000,000 tokens
// You want to unglue = 50,000 tokens
// Supply Delta = (50,000 / 1,000,000) * PRECISION = 50000000000000000 (5%)

// Supply Delta Examples:
// 1% of supply = 10000000000000000
// 5% of supply = 50000000000000000  
// 10% of supply = 100000000000000000
// 50% of supply = 500000000000000000
// 100% of supply = 1000000000000000000

The Most Accurate Way to Receive a Calculated Amount's Percentage of Total Supply

The Supply Delta is calculated using a formula that determines the impact of a given amount on the Adjusted Total Supply. The result is scaled to 1e18 and can be easily translated into a percentage (if required) or expressed as a supply of tokens.

$Sticky Token Amount * 1e18 / Adjusted Total Supply$

Convert Supply Delta in an Asset Balance:

For example, to translate the Supply Delta into a specific asset balance, you can use the following formula based on the Delta Impact:

$Total Asset Balance * Supply Delta / 1e18$

Convert Supply Delta into a Percentage:

To convert the Supply Delta into a percentage, you can calculate:

$Supply Delta * 100 / 1e18$

Use cases

The Supply Delta is the impact of an amount on the Adjusted Total Supply of a Glue's Sticky Token. It represents the percentage of the Adjusted Supply, expressed as an 18-decimal uint256.