liquity / ChickenBond

GNU General Public License v3.0
32 stars 5 forks source link

model: Adapt to last version and use real internal AMM #168

Closed bingen closed 2 years ago

bingen commented 2 years ago

Results I’m getting now:

Screenshot_20220818_175214 Screenshot_20220818_175223 Screenshot_20220818_175235 Screenshot_20220818_175248

Essentially:

Also there may be bugs in the new changes.

bingen commented 2 years ago

Final state of the system:

Chicken Bonds state
 - Pending LQTY:               36,198.69
 - Reserve LQTY:               649,956.49
 - Permanent (DEX) LQTY value: 291,380.52
 - bLQTY supply:               506,621.27
 - Backing ratio:              1.28

Fair price:      2.30
Accrual param:   0.01
Rebond Time:     1,440.00
Chicken in Time: 1,440.00

AMM pool:

 - LQTY amount: 145,690.26
 - ETH amount: 145,690.26
 - Price LQTY/ETH: 1.00
 - Price ETH/LQTY: 1.00
 - LP tokens total supply 145,690.26

bTKN AMM pool:

 - LQTY amount: 27,098.96
 - bLQTY amount: 21,001.67
 - Price LQTY/bLQTY: 0.77
 - Price bLQTY/LQTY: 1.29
 - LP tokens total supply 27,506.32
 - LQTY Fees: 1,431.23
 - bLQTY Fees: 745.77
 - AMM APR: 0.000%
danielattilasimon commented 2 years ago

I've yet to check out the code, but here are some quick thoughts.

Would be interesting to see the permanent bucket, too. Or is that the combination of AMM TOKEN & AMM ETH? Is the yield of that rolled back into reserve? (How much is that)?

What do the results look like with a smaller premium (might have to reduce chicken-in fee too)? 100% seems a bit high given redemption price only grows ~30% over 4 years.

For tuning the parameters of LUSD Chicken Bonds, we can probably be more optimistic about the pending & reserve yield.

bingen commented 2 years ago

Would be interesting to see the permanent bucket, too. Or is that the combination of AMM TOKEN & AMM ETH?

Exactly, it’s the column in red and yellow in the first chart.

Is the yield of that rolled back into reserve? (How much is that)?

It’s defined by AMM_YIELD constant (in the run above, 2%) and you can see it rolled back into reserve in distribute_yield function:

        # AMM generated yield
        generated_yield = self.get_yield_amount(chicken.amm.get_value_in_token_A(), self.amm_yield)

        chicken.token.mint(chicken.reserve_account, generated_yield)