Skip to content

Instantly share code, notes, and snippets.

@dgufdavjiahu
Created October 27, 2021 02:56
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dgufdavjiahu/3d8ca75939fec762162d84e7a1ee15bc to your computer and use it in GitHub Desktop.
Save dgufdavjiahu/3d8ca75939fec762162d84e7a1ee15bc to your computer and use it in GitHub Desktop.
aladdin-prod-solution

Aladdin Production Solution Draft

Essentially there are 2 roles: user and DAO

Essentially there are 2 kind of interactive systems: vault and treassury

User Operations

  • deposit

    user can transfer amount n of $BASE to one of the vaults, where $BASE is the demand token of the vault; then the user will receive amount n * (100% - f_d) of $aldBASE where $aldBASE is the wrrapped token of $BASE in aladdinDAO and f_d is the deposit fee (can be 0); the vault will follow specified strategy and make use of the recieved $BASE to earn $FARM where $FARM represents the reward tokens of the strategy;

  • withdraw

    user can transfer amount n of $aldBASE to one of the vaults, where $aldBASE is the wrapped token of the vault; then the user will receive amount n * (100% - f_w) of $aldBASE where $aldBASE is the wrrapped token of $BASE in aladdinDAO and f_w is the withdraw fee (can be 0); the vault will withdraw $BASE from the strategy if needed;

  • claim

    user can claim its $ALD reward from vaults it deposited; the amount of $ALD reward is sum_{of time}(balance * reward_rate) where balance is user's balance of $aldBASE and reward_rate means $ALD reward per token per second set by the DAO see more on Adjust Reward Rate;

  • auction

    users can join the auction to burn $ALD and receive a part of tokens in treassury when an auction is launched; this is a basic way to support the price of $ALD; see more on ALD Buy Back

there is also a vault whose $BASE is $ALD and it can be treated as $ALD staking pool

DAO Operations

DAO here means aladdin boules or DAO of $ALD holders depends on the operation frequency

  • adjust_vault

    DAO is able to adjust the reward_rate of each vault; actually a vault is removed when reward_rate is set to 0; Adjust Reward Rate

  • use_treassury

    DAO is able to make use of the token in the treassury and earn more reward for the treassury; we have enough confidence in that boule members can do well in farming with the treassury money;

Adjust Reward Rate

the reward_rate is updated by the DAO through a fixed mechanism;

essenially the reward_rate can be k * earned / ald_price where k can be about 125% and earned is the average earned reward per second in $USD and ald_price is the twap of $ALD in $USD

note that twap and average need a duration for stats, which means, the reward_rate adjustment has a latency

and the latency is actually a good feature to protect aladdinDAO from the huge changes in earnings and price;

ALD Buy Back

$ALD buy back is perfromed through autions when the price of $ALD is quite different from expected;

a fixed amount tokens selled from the treassury and users who want to burn the most $ALD will receive that tokens.

$ALD buy back is not a frequent event and it is only trigged when the market cap of $ALD is quite misleading;

we expect boule members can make best use of treassury tokens and earn most reawards to make the treassury bigger and bigger;

essentially to objectively describe the misleading: the metric of liquidity_cap / treassury_balance can be used;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment