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

Update fees page with new fee model #59

Open
27 tasks
descartes1596 opened this issue Nov 5, 2024 · 0 comments
Open
27 tasks

Update fees page with new fee model #59

descartes1596 opened this issue Nov 5, 2024 · 0 comments

Comments

@descartes1596
Copy link
Collaborator

The Chore

Taken from Vega project repo ...

Fee page

  • One card shoudl just show the network fees, including the new treasury and buyback components, all these come from the network params and are easy
  • Maker rebate info
  • Taker volume discount
    • Current tier shoudl come from partyDiscountStats
    • Current volume shuld come from runningVolume on volumeDiscountStats for the current epoch
    • Volume to next tier find the volume needed fro the next minimumRunningNotionalTakerVolume up on currentVolumeDiscountProgram and show the gap to get there
  • Referral discount
    • Current tier shoudl come from partyDiscountStats
    • Current running volume shoudl come from referralSetRunningNotionalTakerVolume on referralSetStats
      • You may be able to do this simply by adding a partyId
      • Or maybe you need to first query referralSetReferees for referee = partyId to find the referralSetId.. then use that
      • We will need to set up some tests to check this because I think the referrer doesnt get the discount but the referee does, so we need to make sure we're showing the right info
    • Volume to next tier find the volume needed for the next tier up on currentReferralProgram and show the gap to get there

image

  • Next section should be the fees by market which now focuses on the below and SHOULD all be available on the new partyDiscountStats API
    • Show discountedTakerFee as "Taker fee"
    • Show undiscountedTakerFee - discountedTakerFee / undiscountedTakerFee in brackets
    • Show baseMakerFee + userMakerRebate as "Maker rebate"
    • Show userMakerRebate in brackets

image

  • Show the full grids of the programs for use as reference, likely these will need to move to just stacked on top of each other since they are too large now, also probably remove the colours as these are now not the focus
  • We're basically just goiing to be showing the full content of the APIs for
    • Taker volume discount (currentVolumeDiscountProgram)
    • Referral program (currentReferralProgram)
    • Maker rebate boost (currentVolumeRebateProgram)

image

Example of volume

{
  "data": {
    "currentVolumeDiscountProgram": {
      "id": "ee5481ca6eec3b3dc2ff1c60e09589856998e54ff0f6de38ade1f530995374fd",
      "windowLength": 1,
      "version": 1,
      "endOfProgramTimestamp": "2024-10-01T17:31:32Z",
      "endedAt": null,
      "benefitTiers": [
        {
          "minimumRunningNotionalTakerVolume": "10",
          "tierNumber": 1,
          "volumeDiscountFactors": {
            "infrastructureFactor": "0.01",
            "makerFactor": "0.01",
            "liquidityFactor": "0.01"
          }
        },
        {
          "minimumRunningNotionalTakerVolume": "100",
          "tierNumber": 2,
          "volumeDiscountFactors": {
            "infrastructureFactor": "0.015",
            "makerFactor": "0.015",
            "liquidityFactor": "0.015"
          }
        },
        {
          "minimumRunningNotionalTakerVolume": "1000",
          "tierNumber": 3,
          "volumeDiscountFactors": {
            "infrastructureFactor": "0.021",
            "makerFactor": "0.021",
            "liquidityFactor": "0.021"
          }
        },
        {
          "minimumRunningNotionalTakerVolume": "10000",
          "tierNumber": 4,
          "volumeDiscountFactors": {
            "infrastructureFactor": "0.031",
            "makerFactor": "0.031",
            "liquidityFactor": "0.031"
          }
        }
      ]
    }
  }
}

Referral page

  • Make the same changes to the referral tiers table as were done above

Additional details / background info

Spec PR

vegaprotocol/specs#2293

Core ticket for the maker rebate boost tier

vegaprotocol/vega#11530

Core ticket to update existing referral / volume discount program APIs

vegaprotocol/vega#11531

Party Discount Stats output

query feesByMarket {
  partyDiscountStats(partyId:"89fd87b86727fa4d9ab06b9f4e64b51c9b07055e8a0c8f0bc40f0a249e321525"){
    volumeDiscountTier
    volumeRebateTier
    referralDiscountTier
    partyMarketFees{
      marketId
      undiscountedTakerFee
      discountedTakerFee
      baseMakerFee
      userMakerRebate
    }
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

1 participant