bigfat whitecat, [02/04/2023 22:44]
hey guys, we're interested in listing our MLP token on Scream with a very low and conservative LTV to begin with, around 15%-20%. Is this something we could do?

dudesahn, [02/04/2023 22:52]
Biggest concern is finding a good oracle

dudesahn, [02/04/2023 22:52]
Currently we only support assets with Chainlink oracles

dudesahn, [02/04/2023 22:52]
Perhaps reach out to abra and ask them, they have GLP as collateral on arbitrum

bigfat whitecat, [02/04/2023 22:53]
i've added Morpheus to discuss dev side further

Morpheus, [02/04/2023 22:54]
Hi everyone, pleasure to be here

Morpheus, [02/04/2023 22:56]
So concerning accurate pricing for MLP:

Morpheus, [02/04/2023 22:56]
The contract itself tracks the price of MLP, which is based on all token values in the pool (which already are oracle-priced by our own) and pending profits/lossess from active trader positions

Morpheus, [02/04/2023 22:57]
It's possible to have spread in token pricing, so the contract also returns a min/max price

Morpheus, [02/04/2023 22:57]
Let me link the function here, and fairly certain (90%, can double-check implementation in 20ish min) that all other GMX GLP collateral solutions use the same pricing

Morpheus, [02/04/2023 22:59]
https://ftmscan.com/address/0xA3Ea99f8aE06bA0d9A6Cf7618d06AEa4564340E9#readContract#F14

Morpheus, [02/04/2023 23:06]
For reference, here is abra's implementation:

https://arbiscan.io/address/0x8bee5db2315df7868295c531b36baa53439cf528#code

Morpheus, [02/04/2023 23:07]
Only difference is that instead of calling getPrice(false), they're just dividing the AUM by supply themselves

Morpheus, [02/04/2023 23:08]
Would be important to note all USD accounting done within GMX-based contracts are with a precision of 30 decimals as well

Morpheus, [02/04/2023 23:09]
As a quick background on our own oracles - it's a combination of chainlink that are used for price deviance checks, and the main oracles are off-chain Pyth pricefeeds that our keepers submit

Lafa, [02/04/2023 23:35]
Thx for the intro into the details @morpheus0x
& nice to meet you too

I will take a look, but GLP oracles seem to be battle tested by lots of projects by now

bigfat whitecat, [03/04/2023 06:15]
Would be a great listing for both Scream and Morphex

bigfat whitecat, [03/04/2023 06:15]
But I’d want to keep the LTV super low to begin with and low in general

Morpheus, [03/04/2023 16:50]
Hey guys, I've realized one more aspect - handling the MLP token as collateral itself due to it being "auto-staked" by a user and accruing rewards. Most likely some form of a wrapper contract would be required for this, I would need to look into this further

dudesahn, [03/04/2023 16:51]
this is what abra does, they call it like "magic GLP" or something

dudesahn, [03/04/2023 16:51]
sure, we're definitely interested, just from now on we are going to be putting things through community votes so can get that queued once we have final implementation details 🙂

Morpheus, [05/04/2023 15:58]
Hi guys, so I'm figuring out the wrapper model that could be used, I want to check in with you all if the wrapper was an auto-compounding version, but this means a custom oracle would need to apply the exchange rate of wMLP to MLP as well as the MLP price

Morpheus, [05/04/2023 15:59]
Would this be alright for listing as collateral on SCREAM, or must it be more of a 1:1 representation of MLP to use strictly only the MLP price?

dudesahn, [06/04/2023 00:56]
I think this should be fine. I could just write the wrapper and use a yearn vault token for it. will be important to be careful with the oracle for it to ensure that manipulation can't happen, but using the newest vault version should be fine, and would feel much more comfortable doing this instead of a custom wrapper solution

dudesahn, [06/04/2023 00:58]
I think we would want to start the collateral cap lower and raise it over time, and also moving forward I'd really like to start implementing oracle solutions that take the minimum of TWAP vs spot price for collateral (especially for something like MLP, but really for all assets)

Morpheus, [06/04/2023 12:09]
Alright, I would also note that Abra's magicGLP is essentially exactly this as well if required for reference, or if to simplify development to just use this model

Morpheus, [06/04/2023 12:09]
Their wrapper solution is an ERC4626

Morpheus, [06/04/2023 12:11]
I think the strategy that would make the most sense would be to autocompound all FTM earnings back into MLP, while using esMPX rewards to stake, earning more esMPX + multiplier points + FTM yield, where the FTM can also go to compounding the MLP and just continuing to use the rest for building an esMPX+MP position for additional rewards

Morpheus, [06/04/2023 12:53]
In terms of the wrapper itself, I assume that we would host this all on our frontend so that SCREAM could just simply list it as any other regular collateral, correct?

dudesahn, [07/04/2023 04:32]
Yes think so

bigfat whitecat, [08/04/2023 00:16]
Prior to shipping this, do you want to do another token swap? Seems like an appropriate time to consider it. This is going to be big for both Scream and Morphex.

Morpheus, [08/04/2023 10:22]
Hey @dudesahn, so as I understand you would want to write the wrapper contract with this strategy, we're already working on the frontend and nearly completed in terms of design, but would there be an approximate timeline to orient around for this for when the yearn vault solution could be ready?

Morpheus, [08/04/2023 14:07]
We've got this completed for the UI of the wrapper, some slight edits left to do though

bigfat whitecat, [10/04/2023 04:03]
@dudesahn what timeframe are we looking at? we'd like to have this live by end of week.

bigfat whitecat, [10/04/2023 04:05]
crolev is on our dev team, i'm wondering if @morpheus0x and him can write it using yearn if you're unable to this week, then just have you audit it? not sure if that is more efficient than having you do it from the start

dudesahn, [10/04/2023 22:17]
so the more I think about it, the more it might make sense to just fork whatever Abra did for magicGLP, I'm assuming it's open license

dudesahn, [10/04/2023 22:17]
my only concern would be airdrop protection

dudesahn, [10/04/2023 22:19]
biggest concern is implementing collateral caps in SCREAM, which hasn't been done yet—would need to fork from Iron Bank but would want to talk to them and review things first

tho tbh we can just start with supply caps since realistically this is going to be used almost entirely as collateral for borrowing other tokens, so supply cap is roughly the same thing

dudesahn, [10/04/2023 22:24]
okay actually after looking at the magicGLP contract I think it probably is best to just use a vault token

dudesahn, [10/04/2023 22:24]
then we could do some of this custom logic

dudesahn, [10/04/2023 22:29]
if we did something like this, we would maybe want to have a voter-like situation

  • all WFTM is compounded into MLP
  • some % of esMPX is compounded into MLP
  • some other % is kept aside for SCREAM to use to stake, generate yield and donate the yield to the MLP. so, scream owns this esMPX, but users exclusively receive the benefit from it

so basically we could be taking this as a "fee" but could commit to keep it locked for x time frame, with maximum withdrawal amounts or whatever kinds of guards we might want to add

dudesahn, [10/04/2023 22:29]
I actually was already building something very very similar to this for LQTY on mainnet for yearn lol

dudesahn, [10/04/2023 22:30]
stake LQTY, some % of rewards is sent to re-stake and boost yields (which grows over time and will be valuable down the line)

dudesahn, [10/04/2023 22:32]
tbh since I've literally been building something very similar it would be much easier than usual to get this done quickly

dudesahn, [10/04/2023 22:32]
just need to decide on the final logic for rewards handling

bigfat whitecat, [11/04/2023 03:26]
esMPX cannot be compounded into MLP itself. Not sure if that is what you meant to write or if that was short-hand for referencing the FTM yield earned by esMPX is compounded into MLP. If so, then what you wrote is essentially the same strategy we proposed except the request for a % fee for Scream - correct?

bigfat whitecat, [11/04/2023 03:27]
Reference for our proposed strategy here

bigfat whitecat, [11/04/2023 03:28]
If the only change is the request for a % of esMPX as a fee for Scream, we can come to an agreement on what that % is and the safeguards. Just want to confirm no other changes are up for consideration.

bigfat whitecat, [11/04/2023 03:30]
The esMPX can either earn yield or be converted to MPX with a 1-year escrow. You do realize that, when you talk about maximum withdrawal amounts, right?

bigfat whitecat, [11/04/2023 03:30]
I guess my concern is that for Scream to take a fee in esMPX it isn’t necessarily the most lucrative or liquid fee revenue for Scream…

bigfat whitecat, [11/04/2023 03:33]
We want to see Scream succeed as well, given we want to acquire a larger position of Scream tokens. I think we should consider a more liquid fee alternative such as a mixture of MPX and esMPX? For Scream to repay the debt it owes it will need to sell some tokens occasionally in small amounts and if we establish those parameters I am alright with that, just as Morphex would need to sell some Scream tokens in the same manner to balance profit from its investment in Scream into stablecoins.

bigfat whitecat, [11/04/2023 03:34]
Unless you’re certain you only want the fee in esMPX?

bigfat whitecat, [11/04/2023 03:38]
Speed is key here, along with safety obviously. What are some proposed time frames you can have this ready by?

bigfat whitecat, [11/04/2023 03:39]
We have already started forking abra as a back up in the unfortunate event this takes too long, as Morphex cannot afford to sit around and wait for this if it drags out. It’s an incredible opportunity for both Scream and Morphex and solidifies our partnership further, which I am excited about. But I do have PTSD from Yearn development as you’re aware, so I want to protect Morphex as well.

bigfat whitecat, [11/04/2023 03:40]
So, we do need some hard timeframes.

dudesahn, [11/04/2023 03:55]
so, from what I can tell abra's magicGLP only compounds the ETH yield (FTM in this case)

a custom solution could be a bit more creative

user deposits MLP to normal yearn vault. strategy stakes MLP in Morphex.

Strategy claims yield, compounds FTM into MLP. esMPX is deposited to a second vault for esMPX.

vault for esMPX simply compounds, and holds MPs in the strategy. FTM from esMPX yield is sent back to MLP strategy to compound into more MLP.

the MLP vault is the collateral. we could figure out what to do with the esMPX vault tokens. perhaps stream as rewards to suppliers on SCREAM, or airdrop to users based on some criterion we set. or just held by SCREAM to continue generating yield for MLP vault token holders.

I think for now the latter choice is easiest, and gives us the ability to later finalize what to do with them, whether it's just keep them, vest some portion to sell, OTC back with Morphex, etc

dudesahn, [11/04/2023 04:02]

dudesahn, [11/04/2023 04:04]
with vault tokens, fees are assessed by minting vault shares, so taking a small performance fee from the MLP vault would probably make the most sense (and would obvs be very liquid)

dudesahn, [11/04/2023 04:04]
tbh I think this setup is far superior to what magicGLP does

dudesahn, [11/04/2023 04:05]
not only does it have the security of a yearn vault vs a relatively new wrapper, but by tokenizing the MLP and the esMPX separately it gives us tons of flexibility

dudesahn, [11/04/2023 04:06]
@Lafachief you're not the only one who can make complicated flow diagrams 🙂

Lafa, [11/04/2023 04:07]
Looking good!

Lafa, [11/04/2023 04:10]
yearn could then do the same for GLP on gmx :D

bigfat whitecat, [11/04/2023 05:10]
We agree with you re: yearn vs magic and also prefer to do this in partnership with Scream - no questions there. Above looks good, however airdropping esMPX would be a nightmare given you need to burn equivalent MPX for user to vest. Probably best to split between suppliers and yield for vault token holders. Maybe 30-70, respectively?

bigfat whitecat, [11/04/2023 05:10]
But seriously, what is a reasonable time frame for this @dudesahn

bigfat whitecat, [11/04/2023 05:13]
I have 2.5 devs available to hammer this out in coordination with you if that will help expedite. All are very familiar with yearn contracts.

bigfat whitecat, [11/04/2023 05:14]
3 devs, but one is part time.

bigfat whitecat, [11/04/2023 05:19]

  1. Time frame. 2. Token Swap. 3. Exclusivity agreement not to launch this for any other gmx fork on Fantom given we create a dependence by having the vault token as collateral and not MLP itself

Lafa, [11/04/2023 05:22]
whats the rational behind the time pressure aspect?

bigfat whitecat, [11/04/2023 05:23]
We ship quickly at Morphex and getting MLP as collateral is the next pillar in our roadmap. Have significant liquidity waiting to enter when MLP is collateralized.

bigfat whitecat, [11/04/2023 05:27]
Securing the liquidity as soon as possible is important for us because it may find another opportunity if we take too long. To do so, we need to have MLP collateralized.

Morpheus, [11/04/2023 09:34]
With esMPX, the token is not generally meant to be transferrable, but we can whitelist specific contracts as handlers if required, allowing those contracts to be able to transfer the esMPX earned

Morpheus, [11/04/2023 09:36]
The only thing to keep in mind w/ that is due to internal reward accounting, that esMPX would only be able to be vested by whichever address actually earned that esMPX through staking - if that esMPX were to be streamed to various users on SCREAM, they wouldn't be able to vest due to a new address not having the vesting reserve amount required

Morpheus, [11/04/2023 09:36]
So this esMPX would only be stake-able

Morpheus, [11/04/2023 09:37]
If the esMPX were to just accrue to SCREAM treasury, it would be simple enough to create a specific vesting contract to bypass that (since it's just for one user)

bigfat whitecat, [11/04/2023 09:53]
@Lafachief please add @crolev to this group chat