GIP-01: Allow FIDU-USDC Curve LP positions to be staked for GFI liquidity mining rewards

Authors

@alvinh, @emilyh

Summary

Goldfinch should allow FIDU-USDC Curve LP positions to be staked for GFI liquidity mining rewards.

GFI rewards would come from the existing distribution parameters to the Senior Pool Liquidity Mining program, and only the FIDU portion of the Curve LP position would be eligible for GFI rewards. This would help create a liquid secondary market of FIDU and USDC, which (a) reduces the friction of entering and exiting Goldfinch Senior Pool positions, (b) results in more USDC staying in the Senior Pool, and (c) allows people to get exposure to the Goldfinch Senior Pool by simply purchasing FIDU on Curve.

Motivation

When Goldfinch Liquidity Providers deposit USDC into the Senior Pool they receive FIDU, which is an ERC20 token that tracks their deposit and the interest payments accrued. Currently, if a user wants to remove their Senior Pool deposit, they can exchange FIDU for USDC on Goldfinch, but withdrawals are limited to the unutilized USDC in the Senior Pool and incurs a 0.5% withdrawal fee. This process is costly for depositors and drains the Senior Pool of USDC to utilize.

Being an ERC20 token representing an interest-bearing stablecoin deposit, FIDU has the potential to become interoperable with the rest of DeFi similar to Compound’s cTokens.

The first step towards realizing this would be to create a liquid secondary market between FIDU and USDC on an AMM like Curve. This would allow (a) Goldfinch Liquidity Providers to move in and out of their Senior Pool positions freely without limitations or withdrawal fees, (b) result in less drainage of USDC from the Senior Pool, and (c) allow people to get exposure to the Goldfinch Senior Pool by simply purchasing FIDU on Curve.

Right now, anyone could create a FIDU-USDC Curve pool. However, no one has yet because they would be forgoing juicy GFI token rewards from single-side staking FIDU. This proposal outlines how users could stake FIDU-USDC Curve LP positions to receive their fair share of GFI liquidity mining rewards, which benefits both Senior Pool LPs and the protocol.

Specifications & Requirements

Key Requirements

  1. On the Goldfinch app, users can stake FIDU-USDC Curve LP tokens for GFI liquidity mining rewards
  2. Augment the StakingRewards contract to accept FIDU-USDC Curve LP tokens
  3. Use the virtual price of the Curve LP position to calculate the appropriate GFI reward amounts
  4. GFI rewards will come from the existing distribution rate parameters for Senior Pool Liquidity Mining
  5. GFI rewards from staking FIDU-USDC Curve LP tokens will be subject to the existing unlock schedule
  6. Implementation should be generalizable so new types of staked positions may be easily added in the future

Specifications

StakingRewards Contract

We’ll augment the StakingRewards contract to accept FIDU-USDC Curve LP tokens and calculate rewards based on the user’s Curve LP position. Broadly, the changes might look something like this (updates highlighted in parentheses):

contract StakingRewards {
  // @notice Enum to represent the different staked positions (NEW)
  enum StakedPositionType {
    Fidu,
    CurveLP
  }

  struct StakedPosition {
    // @notice Type of the staked position (NEW)
    StakedPositionType positionType,
    // @notice Staked amount denominated in `stakingToken().decimals()` (UPDATED)
    uint256 amount,
    // @notice Exchange rate applied to staked amount to denominate in `baseStakingToken()` (NEW)
    uint256 effectiveExchangeRate;
    // ...
  }

  // @notice The address of the base staking token
  function baseStakingToken() public view returns (IERC20withDec) {
    return config.getFidu();
  }

  // @notice The address of the token staked for a given position type (new)
  function stakingToken(StakedPositionType positionType) internal view returns (IERC20withDec) {
    // ...
  }

  // @param amount The amount of `stakingToken()` to stake
  // @param positionType The type of the staking position (new)
  // @param lockupPeriod The period over which to lock staked tokens
  function stakeWithLockup(
    uint256 amount,
    StakedPositionType positionType,
    LockupPeriod lockupPeriod
  ) {
    uint256 lockDuration = lockupPeriodToDuration(lockupPeriod);
    uint256 leverageMultiplier = getLeverageMultiplier(lockupPeriod);
    uint256 lockedUntil = block.timestamp.add(lockDuration);
    uint256 effectiveExchangeRate = getEffectiveExchangeRate(positionType); // (NEW)

    _stakeWithLockup(
      msg.sender, 
      msg.sender, 
      amount, 
      effectiveExchangeRate, // (NEW)
      lockedUntil, 
      leverageMultiplier
    );
  }

  // @notice Helper function that calculates the effective exchange rate used to denominate in
  //   `baseStakingToken()` for any staked position type (NEW)
  // @param positionType Type of the staked position
  function getEffectiveExchangeRate(StakedPositionType positionType) internal returns (uint256) {
    if (type == StakedPositionType.CurveLP) {
      return getEffectiveExchangeRateCurveLP()
    } else if (type == StakedPositionType.Fidu) {
      return 1;
    } else {
      revert("unsupported StakedPositionType");
    }
  }
}

The modifications in the StakingRewards contracts should make it easy to include other new types of staked positions in the future. The current StakingReward contract only supports staking FIDU directly, so the contract simply calculates individual rewards based on the amount of FIDU staked. To support staking the Curve LP token (and any other future token), we will perform an additional calculation at the time of staking to get the exchange rate that will be used to convert the Curve LP tokens to an effective FIDU amount. The exchange rate for a Curve LP position will be calculated using the virtual price of the LP token given by Curve.

Note: Our proposal uses Curve’s virtual price to calculate the effective FIDU amount instead of spot prices or live ratios of the FIDU-USDC Curve pool to prevent flash loan attacks. You can read more details about how Curve has been exploited here.

Senior Pool Liquidity Mining program

GFI rewards will come from the existing Senior Pool Liquidity Mining program allocation. GFI rewards awarded to Curve LP token staking will be subject to the same unlock schedule as well. As mentioned before, the StakingRewards implementation will be done such that Curve LP stakers are awarded GFI tokens only for the FIDU portion of the Curve LP position. The USDC portion of their Curve LP position will not earn GFI rewards, preventing “doubling up” of rewards.

Curve pool specifications

Pool name: Goldfinch FIDU/USDC

Pool symbol: fidu-usdc

Type: Non-pegged assets

Token 1 address (FIDU): 0x6a445E9F40e0b97c92d0b8a3366cEF1d67F700BF

Token 2 address (USDC): 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48

Use Curve’s default parameter settings for non-volatile assets:

Amplification (A): 200000000

Gamma: 0.0001

Mid Fee: 0.05

Out Fee: 0.45

Allowed Extra Profit: 0.00000001

Fee Gamma: 0.005

Adjustment Step: 0.0000055

Admin Fee: 50

MA Half Time: 600

Initial Price: 1.04781838714912204*

*The Initial Price will be updated to the current sharePrice value from the Goldfinch Senior Pool contract (EIP173Proxy | 0x8481a6EbAf5c7DABc3F7e09e44A89531fd31F822) at time of pool creation.

Rationale

We propose using Curve v2 instead of Uniswap or Sushiswap because the AMM design is better suited for non-volatile asset pairs, through the Amplification Parameter A, which is the case for FIDU-USDC.

We propose using USDC as the stablecoin in the pair because it is the stablecoin used for initial Senior Pool deposits.

We propose using the existing distribution rate parameters for Senior Pool Liquidity Mining and the existing GFI rewards unlock schedule to avoid introducing any major changes to the GFI tokenomics.

Development costs

The core development Warbler Labs team is working hard on the roadmap and has limited bandwidth for this project. We propose that we award a one-time development grant of 3,500 GFI from the Community Treasury for the successful completion of this project. If this proposal passes, the proposal authors will be responsible for research, design, and development, and submitting code for public review and security audits.

3,500 GFI = ~$84/hr contractor rate assuming 2 people working for 80 hours, using 60d trailing GFI price of $3.85.

Benefits

  • Goldfinch rewards those who increase composability and utility of the FIDU token
  • Goldfinch Senior Pool Liquidity Providers can more easily move in and out of their Senior Pool positions without being subject to limitations or withdrawal fees
  • Less drainage of USDC from the Goldfinch Senior Pool which keeps TVL high
  • Allows people to get exposure to the Goldfinch Senior Pool simply by purchasing FIDU on Curve
  • Provides these benefits without changing liquidity mining distribution parameters or unlock schedules

Downsides

  • Potentially lower withdrawal fees for the protocol as people could swap on Curve instead of withdrawing

Voting

YES vote: Approve a change to allow staking of FIDU-USDC Curve LP tokens on Goldfinch, and include the FIDU portion of the position in the Senior Pool Liquidity Mining program. These GFI rewards will be subject to the same existing distribution rate parameters and token unlock schedule. This change would be funded with a 3,500 GFI development grant from the Community Treasury.

NO vote: Reject the proposed changes. Do not approve a change to allow the staking of FIDU-USDC Curve LP tokens on Goldfinch to participate in the Senior Pool Liquidity Mining program.

Resources

Goldfinch Senior Pool Liquidity Mining program

Introduction to Curve documentation

Curve developer documentation

Curve v2 factory pool creation parameters

Example contributor grant proposal from Compound

  • 500 COMP per year at $479 per COMP (Jul '21) = ~$239,500 per year
  • This grant proposal passed with on-chain voting here
4 Likes

Thank you for taking time and putting the proposal forward !!
I really like the idea and rationale on why we would want to do this and in general I would support the idea as long as we are grow the protocol.
Primarily I’ve few concerns -

  1. What about the regulatory aspect ? As you know only whitelisted/KYC participants can participate in the pool. How would this playout if we list them on curve and then have to stake the LP tokens on goldfinch ? Do we expect anybody can buy on curve but only KYC’ed participants can stake to earn additional GFI? it sort of is a grey area if we want to do that imo.
  2. Per my understanding there are bunch of small LP’s in senior pool and have already staked FIDU. What would happen to folks who are already staking FIDU ? do they have to unstake, pay fees and go through curve - this could add up quite a bit of gas costs. It would also be additional gas costs for new users because they would have to go to curve. Is it possible to split GFI rewards to leave existing stakes as is ?
  3. As you mentioned the protocol fees - protocol revenue would reduce quite a bit- Is it possible to hold a small percentage of GFI rewards during unstaking to compensate for the lost fees ?

Thanks !

1 Like

Hi @nisa! Great questions and thanks for starting the discussion.

  1. Anyone that owns FIDU or the FIDU-USDC Curve LP token would be able to stake it for GFI rewards. FIDU is a fully transferrable ERC20 token that users can do whatever they want with. Right now, if a non-KYC’d user receives FIDU they can stake on Goldfinch for GFI rewards (the KYC check is only made upon direct deposits and withdrawals of USDC in/out of the Senior Pool), so we think it makes sense to treat the FIDU-USDC Curve LP token similarly.

An analogy here are KYC’d on/off ramps into crypto through centralized exchanges. Many CEXs require KYC to deposit/withdraw fiat from banks, but once that has been done, the user is free to transfer their tokens to any users with a non-custodial wallet which can then interact with the rest of DeFi.

  1. Really good point; gas costs may be prohibitive for smaller LP’s in the Senior Pool to unstake, deposit in Curve, and re-stake on Goldfinch. Existing FIDU stakers should do their own research/calculations as to whether the Curve swap fees can make up for the gas costs incurred. New FIDU owners will only have one extra gas step (depositing into the Curve LP). I’m sure the Warbler Labs team is thinking about integrations with L2s to make using Goldfinch more accessible to smaller wallets, which I think is probably the right longer-term solution here.

Note: In the design of the implementation we have in mind, there would be a configurable variable that determines what percentage of the the FIDU-USDC Curve LP token will be eligible for GFI rewards. This would be set to 50% to start, and could be changed by governance voting. For example, this could be increased up to 60% if the community voted to increase the incentive of LP’ing in the Curve pool to help make up for gas costs.

Is it possible to split GFI rewards to leave existing stakes as is ?

The allocation of GFI awarded to existing FIDU stakers will not change under this proposal! We do not propose reducing/changing the allocation of GFI awarded to the Senior Pool Liquidity Mining program. This would simply give existing FIDU holders the option to stake via the FIDU-USDC Curve LP to earn both swap fees and GFI rewards.

  1. Yes, protocol fees coming from withdrawal fees will likely decrease a bit. However, we believe that the protocol earning the majority of its fees from their portion of interest repayments (vs pool withdrawals) is likely more incentives-aligned with the community. Our POV is that by having a simple and liquid FIDU-USDC secondary market, Goldfinch will become an even more attractive option for everyone looking for yield in DeFi – thereby increasing Senior Pool TVL to make up for the short-term loss in withdrawal fees with growth in protocol fees coming from interest repayments.

Is it possible to hold a small percentage of GFI rewards during unsticking to compensate for the lost fees ?

I’m not sure if I fully understand this idea but would love to hear more!

3 Likes

The proposal is well thought-off. I am sure other community members/engineers will comment on the technical aspects.

I echo @nisa opinion that protocol may potentially lose some revenue, i.e. 0.5% withdrawal fee. As the revenue is supposed to go to protocol treasury managed by decentralized governance, in this case, we are incentivizing Curve LPs. With a small figure, it may not matter much but let’s say when it goes to millions, I think 0.5% withdrawal fee matters. The question is do we want to lose some revenue - it’s up to the community to decide.

This is a little trickier in my opinion. While true Senior Pool depositors may have exit liquidity easily without the need to remove USDC from Senior Pool, the opposite force can also come true as I discussed with @alvinh. For example, let’s say if I buy some FIDU from Curve, USDC from Coinbase, add liquidity in Curve, and be able to stake FIDU-USDC LP, the question comes - will that not impact the growth of Senior Pool and hence constitute further loss of revenue? In some sense, it becomes more attractive to become Curve LPs than Senior Pool depositors.

Nonetheless, @alvinh and @emilyh have laid down things and specifications quite well. And just letting you guys know, this is not the first proposal, so GIP-01 is irrelevant here.

2 Likes

Thank you for the thoughtful responses as well !
As you know - currently only kyc’ed individuals from certain countries are allowed to participate in Goldfinch protocol. With the Curve LP approach - we will open it up for everyone. I’m ok with this but would like to hear from team on regulatory risks if any with this approach.

Per what I understand this is not something high up in the priority list for Warbler labs team because of the nature of how protocol is designed - I could be wrong here though

[quote=“alvinh, post:1, topic:734”]
GFI rewards will come from the existing Senior Pool Liquidity Mining program allocation.
[/quote].
I think I’m missing- where the rewards are going to come from exactly. Per what I understand so far - it will come from 8% allotment to senior pool liquidity mining and if we go with this proposal, we will stop rewarding users who are staking FIDU directly (existing stakers) and reward only the Curve LP staking. Or am I wildly off on this ?

  1. sorry edited the auto-corrected typo.

Good point Mans.
I have another question this - If everyone wants to be Curve LP - who will mint FIDU ? Would be curious to hear some thoughts on this.

Thank you !

2 Likes

As far as I understand according to this proposal the liquidity mining rewards should be available for both directly FIDU stakers and Curve LP stakers. So existing staking participants should not be affected.

However, I agree with @mans9841 and think that we need to somehow assess how the implementation of this proposal may affect the activity of protocol participants who supply capital to the senior pool

2 Likes

Thanks @nisa @mcegor13 @mans9841 for chiming in with great feedback! Will try to address each of these points in turn.

This is a little trickier in my opinion. While true Senior Pool depositors may have exit liquidity easily without the need to remove USDC from Senior Pool, the opposite force can also come true as I discussed with @alvinh. For example, let’s say if I buy some FIDU from Curve, USDC from Coinbase, add liquidity in Curve, and be able to stake FIDU-USDC LP, the question comes - will that not impact the growth of Senior Pool and hence constitute further loss of revenue? In some sense, it becomes more attractive to become Curve LPs than Senior Pool depositors.

The flow you described is accurate: a user buys FIDU from Curve, USDC from Coinbase, adds liquidity in Curve, and stakes their FIDU-USDC LP on Goldfinch for GFI rewards. However there is an important piece missing – the arbitrage opportunity that presents itself after this happens a number of times because the FIDU exchange rate on Goldfinch and Curve can move independently from each other.

As an example: let’s say the native exchange rate on Goldfinch is $1.05 per FIDU, and that’s also the exchange rate in the Curve pool upon creation. After enough users buy FIDU on Curve (and perhaps go through the aforementioned staking flow), the FIDU-USDC exchange rate goes up to something like $1.07 due to the pool becoming skewed towards USDC. However, the native exchange rate on Goldfinch has only increased slightly to $1.055 from interest compounding. Now, there is an arbitrage opportunity for users to deposit USDC in the Senior Pool to receive FIDU at $1.055 and they can go sell that FIDU on Curve for $1.07 for an instant profit. When that FIDU is sold for USDC on Curve, the USDC deposited into the Senior Pool by the arbitrageur stays there.

This creates a dynamic where strong demand for FIDU on Curve will lead to sticky one-way USDC flows into the Goldfinch Senior Pool (increasing Goldfinch TVL and interest rate revenue).

I think I’m missing- where the rewards are going to come from exactly. Per what I understand so far - it will come from 8% allotment to senior pool liquidity mining and if we go with this proposal, we will stop rewarding users who are staking FIDU directly (existing stakers) and reward only the Curve LP staking. Or am I wildly off on this ?

Nope, we do not propose to stop rewarding users who are staking FIDU directly (existing stakers). We propose that the existing 8% allotment to Senior Pool liquidity mining includes both FIDU-only stakers as well as FIDU-USDC Curve LP token stakers (applied at 50% to only account for the FIDU portion and not the USDC portion). Basically, those who are providing FIDU in Curve as liquidity and staking the Curve LP should not be left out of the liquidity mining program because they are providing value to the protocol.

I echo @nisa opinion that protocol may potentially lose some revenue, i.e. 0.5% withdrawal fee. As the revenue is supposed to go to protocol treasury managed by decentralized governance, in this case, we are incentivizing Curve LPs. With a small figure, it may not matter much but let’s say when it goes to millions, I think 0.5% withdrawal fee matters. The question is do we want to lose some revenue - it’s up to the community to decide.

Yep, I think the right question to answer here is whether the community is ok with the protocol to lose some revenue in return for increasing the utility and accessibility of FIDU, which hopefully should increase the growth of the Senior Pool and set the stage for FIDU to become a liquid asset that can be composable with the rest of DeFi. IMO the protocol is in its early days, and it makes sense to invest in this type of growth.

Nonetheless, @alvinh and @emilyh have laid down things and specifications quite well. And just letting you guys know, this is not the first proposal, so GIP-01 is irrelevant here.

Thank you! Yes, we realize this is not the first Goldfinch proposal. It seems like best practice in gov forums is to number each proposal so they are easily referenced in Discord, etc. without typing the full proposal name. I don’t believe past proposals have been numbered so just wanted to get the ball rolling here :laughing: . Happy to change the number to something else if it’s confusing.

3 Likes

Hey, @alvinh . It seems, you have a very good understanding of what needs to be done for it and I like it! Your idea is good, but I have a few questions for you, you may have answered them, but I will ask again to clarify the situation:

  1. As I understand it, the price is dynamic and will need to balance it all the time or take the lowest FIDU share. Is this true?

  2. Is it profitable for GF in the event that FIDU is small?

Thank you!

1 Like

Got it. Thank you for clarifying.

You are not wrong here. Soon we are proposing to form Governance Advocate Task Force. I am one of the members. If the Task Force comes into existence, will take your feedback into account :wink:

2 Likes

Thanks @Igor !

  1. Yes, the FIDU price on Curve will be dynamic based on supply/demand. However, this can be slightly different from the price of FIDU natively on Goldfinch, which changes based on net gains (i.e. interest - writedowns) to the Senior Pool. We would expect the two exchange rates to track pretty closely together as arbitrageurs have an incentive to bring them in line.

  2. If the FIDU price on Curve drops below the native FIDU price on Goldfinch, we would expect arbitrageurs to buy FIDU on Curve and then use that FIDU to redeem a higher amount of USDC, which would lead to increased withdrawal fees for Goldfinch. At the end of the day, the FIDU price on Curve vs Goldfinch shouldn’t have large deviations in either direction due to the arb opportunity.

2 Likes

Thanks for clarifying this !

This was the piece I was missing earlier. so no impact to existing stakers !

I’m in support of the proposal unless we see some regulatory issues I raised above.
Thanks for all you are doing on this proposal !

3 Likes

The Council has soft approved this proposal.

1 Like