Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Macro economic model for Chicken Bonds #5

Open
bingen opened this issue Jan 18, 2022 · 3 comments
Open

Macro economic model for Chicken Bonds #5

bingen opened this issue Jan 18, 2022 · 3 comments

Comments

@bingen
Copy link
Contributor

bingen commented Jan 18, 2022

Vanilla Chicken Bonds

First approach with only bonds, no AMM, no lending.

  • 100 users with an initial balance of 10,000 tokens
  • Daily iterations for 4 years
  • External yield 5%
  • Natural rate is 5% plus shock, but it’s not used at all yet
  • sTOKEN price is defined as the ration between the amount of TOKEN in the system and the amount of sTOKEN supply
  • A TWAP over 20 days is computed as well, and used for user behaviours
  • “Coop” is where bonded TOKEN are stored before they are chickened in/up or out
  • Users to bond follow a binomial distribution with probability of 0.3 (so in average 30% of users that are not already bonded will bond)
  • Chicken in probability follows a gamma distribution with mean 40% profit: https://www.desmos.com/calculator/taphbjrugg
  • On each chicken in event, chicks will chicken up with a probability of 50%. They will use the maximum balance possible, i.e., twice the initial bond, or their total balance if it’s lower than that.
  • Chicken out follows a binomial distribution of probability 0.1 (so on each iteration, 10% of bonded users who didn’t chicken in would leave)
  • For a better visualization, prices are capped at 50 and APRs at 20% in the charts.

4 years run

001_0_0_1_bonds_Chicken_bonds_state
001_0_0_2_bonds_sTOKEN_price
001_0_0_3_bonds_APRs

@bingen
Copy link
Contributor Author

bingen commented Jan 18, 2022

Chicken bonds with AMM

Same as before but now with sTOKEN / TOKEN AMM:

  • On each chicken in/up event (and assuming sTOKEN price > 1), 20% of the foregone TOKENs will be diverted to the AMM. The system will pair the necessary amount of sTOKEN to pair them.
  • On each iteration, if the reserve ratio (without the AMM), i.e. the ratio between the amount of TOKEN owned by the protocol plus the amount in the Coop and the sTOKEN total supply, differs from the sTOKEN spot price more than 5%, chicks will arbitrage it by buying or selling from the AMM to bring those values back close.
  • On each iteration, if the POL ratio is bigger than sTOKEN spot price in more than 5%, chicks will arbitrage it by redeeming sTOKEN they own and then swapping the obtained TOKEN back to sTOKEN in the AMM. (The formula for the redemption corresponds to approach (2) in Redemptions and DEX liquidity #3, see more details there)
  • For each swap using the AMM, a max slippage of 3% is imposed.

001_0_2_1_bonds_amm_2_Chicken_bonds_state
001_0_2_2_bonds_amm_2_sTOKEN_price
001_0_2_3_bonds_amm_2_APRs

@bingen
Copy link
Contributor Author

bingen commented Feb 2, 2022

Chicken bonds with AMM and rebonding

Same as before but now 20 out of the 100 users will always try to rebond right after they reach the cap (it’s not yet the best strategy, they should wait more due to the toll for the AMM). They are brave chicks and never chicken out.

As shown in the last chart, they are outperforming their lazier or more coward fellows, but to do a fair comparison we should optimize regular chicken in/up strategies and have the same behaviour about chicken outs.

Another clear difference appears in the initial stage: rebonders take longer to start chickening in, as they always chicken in (50%) or up (50%) right after they reach the cap, not before nor afterwards, and that implies:

  • The AMM builds up slowly
  • As a consequence, arbitrages take longer to rebalance (as there are limits for slippage)
  • Fair price is higher initially as all rebonders are contributing to the premium

001_0_5_1_bonds_amm_2_rebonding_Chicken_bonds_state
001_0_5_2_bonds_amm_2_rebonding_sTOKEN_price
001_0_5_3_bonds_amm_2_rebonding_APRs
001_0_5_6_bonds_amm_2_rebonding_Chick_balances

@bingen
Copy link
Contributor Author

bingen commented Feb 3, 2022

Chicken bonds with AMM and dynamic toll

Same as “Chicken bonds with AMM” but now with dynamic toll. This means that instead of diverting always 20% of the funds to the AMM, the percentage will vary. The curve followed is the purple one here: https://www.desmos.com/calculator/6ze6tloxk3 where x-axis is the ratio between price and backing ratio. So the higher the market price compared to the redemption price, the higher the toll rate, capped at 50% to avoid throttling the system too much.
Other differences are:

  • The bonders of the very first iteration will chicken in/up (in the usual 50/50 proportion) on the iteration 30th, no matter what’s their target profit. This is to avoid problems with bootstrapping. Before the first chicken in event, there’s no sLQTY supply, nor AMM, so it’s hard to define backing ratio, reserve ratio or market price.
  • The sensitivity of the arbitrages has gone down from 5% to 1%. I just wanted to make sure that the AMM depth was not being the bottleneck and that the system was responsive enough. Now spot price follows more closely fair price. Not a big impact though.
  • The initial price has gone up from 19 to 25. This was to make it more consistent with the new bootstrapping. Anyway it’s completely made up.
  • Chicken in gamma distribution has been changed so that now average target profit is 20%. 40% as an average seemed too high. Actually 20 still probably is.

The most important difference we can observe (2nd chart) is that now the premium, the difference between backing ratio (redemption price) and both reserve price (fair price) and market price is lower. Due to a smaller toll and less aggressive target profits, chicken-ins are more frequents, which leaves less outstanding bonds on average.
First chart confirm this with bigger green bars (“POL”) compared to dark blue ones (“Coop”).
AMM in proportion is also smaller, but enough to satisfy the demands, so in that regard the system seems healthier.

001_0_6_1_bonds_amm_dynamic_toll_2_Chicken_bonds_state
001_0_6_2_bonds_amm_dynamic_toll_2_sTOKEN_price
001_0_6_3_bonds_amm_dynamic_toll_2_APRs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant