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

Handle class-XP based on shipped raid data in DungeonMaster #17

Open
ECWireless opened this issue Jan 11, 2024 · 2 comments
Open

Handle class-XP based on shipped raid data in DungeonMaster #17

ECWireless opened this issue Jan 11, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@ECWireless
Copy link
Collaborator

ECWireless commented Jan 11, 2024

  • For now, all class-XP will be based 1-to-1 on stablecoins earned on a raid
    • We should first run a script to calculate general XP based on stablecoins earned
    • We’ll have to use Smart Escrow to figure out what the payouts were
    • If the output looks fair, then we’ll move on to figuring out class-XP
  • We should export XP data for all of January before implementing, so that RaidGuild members can deem it fair or not
  • Implementation will primarily rely on Hasura events in DungeonMaster
    • Back-tracking XP will be handled via different methods later

Implementation Idea

  1. Listen for a DungeonMaster Hasura event that triggers when a raid status is changed to "SHIPPED"
  2. When this occurs, the bot should query Hasura for the smart escrow address that the raiders were paid out from
  3. Bot then queries the subgraph to grab smart escrow data. If funds haven't been released yet, then the bot should store SHIPPED raid data in the DB. If it has been released then...
  4. Bot distributes class-XP based on the amount the raider was paid, and the role that they acted as (data from DM)
  5. If the smart escrow is released after the raid is marked SHIPPED, then we need to listen to that event, then perform step 5
@ECWireless ECWireless added the enhancement New feature or request label Jan 11, 2024
@ECWireless
Copy link
Collaborator Author

ECWireless commented Feb 8, 2024

Major components

  1. Using CharacterSheets classes in DungeonMaster
    1.5) Add CharacterSheets cards to DungeonMaster party (Add Character Cards to the raid party card on the raid page dungeon-master-v2#106)
  2. Filling out raid party by assigning specific classes to each raider (right now a random class of the raider is displayed)
  3. Autofilling the split in DungeonMaster based on Smart Invoice and 0xSplits data
  4. Allowing the autofill to be editable
  5. Allowing non-stablecoins (need to fetch the conversion rate for non-stables)
  6. Releasing XP when raid is shipped (should we wait until the Smart Invoice escrow is released?)

@ECWireless
Copy link
Collaborator Author

ECWireless commented Feb 13, 2024

Implementation Plan

Last updated on 2/20/24

Overview

  • For now, only focus on the invoice payouts as described in option 1 here
    • Option 1: Create a safe + DAO split + raid party split + escrow
    • We only only handling for this option for now in order to take more time to brainstorm how to handle the other options, as well as past raids
  • In https://dm.raidguild.org/escrow, we need to warn users that if they don't choose option 1, they won't immediately receive XP after the raid is shipped
  • In DungeonMaster, we need to add a final status action called "Distribute XP"
    • For all raids where it is not possible to distribute XP, this button should be greyed out
    • We need to ensure that every raid (past and present) that hasn't distributed XP is recorded as such
    • We also need an indicator when XP has been distributed, and maybe a link to play.raidguild.org
    • We probably also want to have confirmation popup which renders what the XP distribution will look like
    • We can't allow it to be clicked until the escrow is actually released
    • If a payout address doesn't match a raiders member address, there should be a prompt to add an alternative payout address, in order to match the two in the future
    • How do we handle the scenario of a raid party where some raiders don't have characters in CharacterSheet?
      • We could possibly have the bot "airdrop" a character to the raider?
    • We need to think about how to handle the scenario where someone forgets to distribute XP. Does the bot remind them? Does the bot do it on its own using a CRON?
  • We need to add character cards to the raid page
  • We need to update the join raid flow to allow class/role selection
    • This also requires updating the Hasura schema
  • We need to add a flow that allows members to add additional payout wallet address
    • They will need to verify this address with a signature
    • We need a way to do this where it isn't a blocker the raid party to receive XP
  • We need to update the DungeonMaster bot to listen to the Hasura even that is triggered when "Distribute XP" is clicked
    • The bot will make the necessary checks and subgraph queries, then issue the XP itself
    • The bot should probably message the raid channel to let them know who received what XP
    • We will also need to handle for non-stablecoins (maybe based on the price from when the raid was shipped?)

Full Implementation

  1. Get invoice data from subgraph, and sync with CharacterSheets database
  2. Get raid classes from DungeonMaster
    • Need to add a flow to DungeonMaster that allows users to select their class(es) within the raid
  3. Add XP distribution functionality to bot
    • We need to handle for all tokens
  4. Add "additional payout address" flow to DungeonMaster
  5. Update escrow page to push people towards option 1
  6. Add CharacterSheets cards to DungeonMaster's raid page

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant