Flippening product economic simulation
Opened this issue · 7 comments
- Added AMM library and initial
degen
script https://github.com/Badger-Finance/ebtc-sims/pull/7/commits/06b610d0d728503c486a40d750c27f60b86b6f9a - Added
betaGang
profile scaffold https://github.com/Badger-Finance/ebtc-sims/pull/7/commits/ecda5d151192d479660e76713acd764408ba1762 - Added Balancer weighted pool support in AMM library GalloDaSballo/pool-math#1
- Added table format for output and GMX cost comparison https://github.com/Badger-Finance/ebtc-sims/pull/8#issuecomment-1661478513
- Added AAVE cost comparison https://github.com/Badger-Finance/ebtc-sims/pull/8/commits/a26466d2df7c26cdc17215aa5af4163486c4f3d5
- Added cost comparison against Synthetix https://github.com/Badger-Finance/ebtc-sims/pull/8/commits/8f35d9c34e87674fc002ff440041047ce40e6f02
@rayeaster what is the next step towards getting this able to be hooked up to a UI?
@rayeaster what is the next step towards getting this able to be hooked up to a UI?
I think UI could try to use this tool now with GMX & AAVE cost comparison to
- Show that
eBTC
is a generally good (even the best for the long term) choice for BTC short position in regard to cost; - Show that
eBTC
helps to gain more (leveraged) exposure AND keep good LSD staking reward at the SAME time; - Show that
eBTC
allows better fund utilization (lowerMCR
& NO need to sell LSD asset to specified quote token)
But the simulation output(conclusion) depends heavily on the available liquidity in eBTC-stETH weighted pool of Balancer. It seems around $100M ~ $300M worth of eBTC
plus stETH
would help to achieve good slippage for a big leveraged position of size $5M
Some helpful insights from @spadaboom
Aave
- swap fee should be considered the same for comparison purposes
- are we using variable or fixed fee for interest rate? Is the average for variable 1.5% which is the number you used?
- We should use the flashloan fee that Aave charges not Balancer via defisaver. Since we could be in the same boat once they integrate our contracts.
- We need to take into consideration utilization somehow.
- Can you explain the "2x leverage" being the max allowed on Aave?
- We need to have some type of way to show your total position since with eBTC having lower MCR we can borrow much more in $$ terms. Thats pretty important for a user that wants XYZ short position.
SNX
- i think we missed the mark on this comparison. There is no way its $0 to keep a position open. Funding rate is going to be competitive with GMX and others or they would of already taken all the users. We need to include a funding fee here
For AAVE:
-
the average borrowing APY (variable type) rate taken in simulation is around
1.5%
https://app.aave.com/reserve-overview/?underlyingAsset=0x2260fac5e5542a773aa44fbcfedf7c193bc2c599&marketName=proto_mainnet_v3 -
"2X leverage" is taken from the calculation using
wstETH
as collateral in AAVE: since its Collateral Ratio is around144%
(69%
LTV), the theoretically maximum leverage allowed withwstETH
position would be144/(144-100)
= 3.3, so "2X" is a safe reasonable leverage option for AAVE https://app.aave.com/reserve-overview/?underlyingAsset=0x7f39c581f595b53c5cb19bd0b3f8da6c935e2ca0&marketName=proto_mainnet_v3 -
Currently total position (
Position Collateral
andPosition Debt
) is simulated and reported by the tool as shown there https://github.com/Badger-Finance/ebtc-sims/pull/8#issuecomment-1661478513 -
Good point on flashloan fee for AAVE, now the tool use AAVE's own flashloan fee instead of defisaver's https://docs.aave.com/developers/v/2.0/guides/flash-loans#flash-loan-fee
-
Swap fee for
eBTC
leveraged position depends on the available liquidity of paireBTC-ETH
oreBTC-stETH
. It would be perfect if we could achieve similarly good slippage for the majority of market trade in regular size compared to the popular pairwBTC-ETH
Similar to the post for GMX comparison, we could do a dedicated thread for AAVE comparison as well:
-
Below comparison assume a FlashLoan fee of
0.0003
& swap slippage of0.005
for eBTC system during position openning -
AAVE charges a variable borrowing interest (up to 100%, typically
1.5%
) forwBTC
debt -
Although AAVE enable wstETH as collateral but due to its LoanToValue limit (maximum LTV is
69%
), a safe leveraged position on AAVE could only get up to 2X to 3X (use 2X for comparison). -
Compare how
eBTC
&AAVE
would stack up if both users are now in a long ETH/BTC position up to$6M
(6X leverage) &$2M
(2X leverage) respectively when starting with$1M
. To hold that position for one Year it cost eBTC users$19718
& AAVE users$21400
-
Also eBTC user could earn staking reward of
$126k
while a less ($84k
) staking reward earned by AAVE position -
Calculating the annualized cost compared to starting capital it’s
1.48%
for eBTC &2.14%
for AAVE. -
eBTC user could earn $106k after subtracting the costs when using eBTC to long ETH/BTC! Annualized that’s earning 10.63% to keep this position open which doesn’t include if it ends up being a successful trade (ex. ETH outperforms BTC).
According to Synthetix/Kwenta API data, I fetched funding rates for sBTC
market from 2023-02-09
to 2023-09-13
(over 7 months) with following summary (positive funding rate means short position will receive money while negative funding rate means short position will pay out money):
Toal Hour Count=5028
Hourly funding rate Avg=0.007405%
Positive Count=3025(60.16%)
Positive Hourly funding rate Avg=0.02845%
Negative Count=2003(39.83%)
Negative Hourly funding rate Avg=-0.02438%
So for Sythetix/Kwenta comparison, maybe it make sense to use Quarter (3 months) instead of Year as the observation duration. We may argue that in the worst case (in favor of eBTC), funding rate of Kwenta during that entire period (3 months in a bear market) could be all negative for short position.
And another quite worrying aspect (if not the most) for trader in Synthetix/Kwenta is that they need to swap the principal (native ETH or wstETH) to sUSD
to open position. So they would lose the upside of ETH
forever
@spadaboom please shed your light on this