DeFi Magic Price Floor Sweeper

DeFi Magic
5 min readDec 7, 2021

The following is a helpful guide to understanding the Price Floor Sweeper mechanics of the DeFi Magic ecosystem.

What is a Price Floor

A price floor, the lowest value an asset can reach, is almost always due to some form of underlying collateral or separate asset of value. In the case of DeFi Magic on the blockchain, the calculation determining the price floor is based upon mathematical equations surrounding the supply of a token, such as Magic or Dark Magic.

The focal point of this calculation is the relation to its locked liquidity pools, total finite supply, and burned or inaccessible tokens.

The key element is the locked liquidity. For Magic, this locked liquidity ties to the liquidity pool wrapper token (LP wrapper) Vein on Pancakeswap on Binance Smart Chain (BSC). For Dark Magic, this locked liquidity ties to the LP wrappers Drax on Sushiswap and NightBane on Quickswap, both of which are on Polygon.

When a user trades tokens for one of the LP wrappers on the Defi Magic zapper, the tokens are converted to liquidity pool tokens and locked into the LP wrapper smart contract, returning equal stated value in LP wrapper tokens. The key is the locking of the tokens during the transaction.

Tokens (MAGIC or DMAGIC) => Zapper => LP wrapper tokens (VEIN, DRAX, NIGHTBANE)

Visualization Example:

Problem: Stuck Money

Once the liquidity is locked, there is a corresponding paired token also locked. On Binance Smart Chain, Magic locks to a synthetic BNB, discussed further down in this Medium. Since there is a math equation that shows how Magic cannot go below a certain price due to its locked paired BNB, that means there is “stuck” BNB in the liquidity pool that, even if all Magic tokens were sold, could never be reached. This BNB is the amount of the price floor.

If the BNB is stuck, that can add up to a lot of money that becomes an untapped resource that can never be taken advantage of by the project for the community.

The Price Floor Math

The basis of the math, from a simplification standpoint, is total tokens in the liquidity pool (cannot be sold because they’re in the LP) compared to total tokens out of the liquidity pool that can be sold. As a reminder, tokens in the liquidity pool cannot be unwrapped and removed.

If there are less tokens outside of the liquidity pool compared to tokens locked inside the liquidity pool, and if every token that could be sold was sold, there would be a certain percentage of the opposite locked paired token that could never be reached.

The math behind the price floor is based upon the following, using Magic on BSC as the example:

  • Finite supply of Magic.
  • Burning mechanism, a transaction fee on Magic reduces the supply.
  • Locked liquidity tokens.
  • Inaccessible tokens such as in the 0x000dead address or other stuck or lost addresses.

Synthetic Paired Token

Earlier on, a synthetic BNB, axBNB was mentioned. This is related to Magic on BSC. Magic is paired to the native token of Binance Smart Chain, BNB, through a synthetic, 100% backed BNB token called axBNB.

1 BNB = 1 axBNB

When users swap BNB to axBNB, their BNB is locked inside the axBNB smart contract, and axBNB is minted and sent to the user. Users can always swap their axBNB back into BNB at any time. If a user swaps axBNB to BNB, the axBNB sent to the axBNB contract is burned, and the same amount of axBNB burned is sent to that user.

This is a critical component to the price floor sweeper mechanism. Because, as people lock their axBNB-Magic LP into Vein (the liquidity pool wrapper which locks the LP), the axBNB gets “stuck” inside the liquidity pool along with the Magic in relation to the price floor math calculation.

When the axBNB is “stuck” it means that the corresponding collateral BNB in relation to the stuck axBNB is no longer necessary to remain in the axBNB contract.

For example, if 100 axBNB is in the liquidity pool, this means 100 BNB is in the axBNB smart contract, held as collateral to that axBNB. If 90% of all Magic tokens are locked to that 100 axBNB in the liquidity pool, this means 10% of Magic is outside of the liquidity pool.

If all 10% of Magic tokens were sold, that means only 10% of the axBNB would be needed to cover those Magic tokens sold (ignoring price impact and any transaction fees for this example).

10% of 100 axBNB is 10 BNB. Thus only 10 BNB is necessary to remain as collateral for the 100 axBNB in the liquidity pool. This means the price floor sweeper can be engaged.

Solution: Price Floor Sweeper

The price floor sweeper functionality is where the reward for the community comes into play.

This is a function built into the synthetic paired token smart contract. In the case of DeFi Magic on BSC, this function is built into the axBNB contract. In other words, the contract that is holding the BNB collateral backing axBNB. Only the contract owner of the contract has access to call this function, ensuring security of the ecosystem.

When the function “sweepFloor” is called, a calculation takes place:

Total axBNB beneath price floor in locked liquidity as BNB less any prior BNB already function called out of axBNB contract in terms of BNB can be removed from the axBNB smart contract. This is because that BNB calculated number correlates to no longer being needed as collateral for the stuck axBNB.

Thus the BNB can be removed from the axBNB contract and utilized to the benefit of the community. Such beneficial manners, as an example, could be buying Magic tokens and making them available as rewards in staking contracts or other DAPPs created for the benefit of DeFi Magic community and ecosystem.

Price Floor Sweeper Visualization

Questions? Join the DeFi Magic Telegram group to get all of the answers: https://t.me/defimagic

$DeFi MAGIC 💫
Website: https://www.defimagic.io/
Twitter: https://twitter.com/defi_magic
Telegram: https://t.me/defimagic

--

--

DeFi Magic

Wizards and Dragons. Bringing pure utility to Binance Smart Chain and Polygon. Powered by Axioms, defimagic.io — we develop and build other projects.