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

Treasury – Staking Delegation #104

Closed
34 of 41 tasks
ori-near opened this issue Oct 31, 2024 · 1 comment · Fixed by #111
Closed
34 of 41 tasks

Treasury – Staking Delegation #104

ori-near opened this issue Oct 31, 2024 · 1 comment · Fixed by #111
Assignees

Comments

@ori-near
Copy link

ori-near commented Oct 31, 2024

Background

We have already built an MVP for our Treasury Dashboard with basic functions (Dashboard, Payments, Settings). This ticket focuses on adding a "Stake Delegation" feature specifically for managing the staking of liquid tokens available within the DAO. A separate feature for handling locked tokens will be introduced in a later ticket.

User Stories

  • As a DAO member with "create" permission, I want to be able to create staking and unstaking requests so that I can manage the DAO's token delegation and earn rewards.
  • As a DAO member with "vote" permission, I want to be able to review and approve/reject staking and unstaking requests so that I can participate in the DAO's treasury governance process.
  • As a general user, I want to be able to view the history of staking and unstaking requests so that I can track the DAO's delegation activities.

Acceptance Criteria

Stake Delegation Page

  • Add a "Stake Delegation" link to the Treasury Dashboard navigation.
  • Clicking the link displays a page with two tabs: Pending Requests and History. The number of requests in pending history is shown next to the titles.
  • Users with create permission can see and click on the Create Request button dropdown, which has two options: Staking, Unstaking.
  • There is a filter tab that allows user to enable/disable and rearrange columns within the table below
  • There is pagination at the bottom to handle a large number of requests (e.g. greater than 20).

Pending Requests Tabs

  • Displays a list of all pending staking and unstaking requests, including the following columns:
    • ID: The ID of the pending request (default sort, ascending order from 01)
    • Created Date: The date and time the request was made (in UTC)
    • Amount: In NEAR and USD equivalence
    • Validator: Include chosen validator URL, fee, and status
    • Created By: The username of the admin who created the request
    • Notes: Any notes entered by request creator
    • Votes: Number of votes required for approval and current number of completed votes
    • Approvers: The usernames of the users who approved or rejected and their vote indication
    • Actions: Approve, Reject – Only visible to users with vote permissions
    • Details – Shows transaction details
    • Pencil edit (not shown in diagram) – this button allows users with create permission to edit the request before it had any votes. Clicking on this will show the create staking or unstaking dialogue with the pre-populated information, along with a delete button option.

Create Staking Request

  • User with create permission who click on create staking request will see the dialogue with the following elements:
    • Display treasury's available balance and total staked amount.
    • Allow users to select a validator from a dynamically fetched list (need to clarify where this is coming from), showing the validator's account, fee, and status.
    • Amount to stake input, with a warning displayed if user tries to exceed the available balance.
    • Notes text area for optional comments.
    • Delete button (show this to users with create permissions only when editing an existing staking request, not during the initial creation).
    • Cancel button – will clear all fields and close the dialogue.
    • Submit button – triggers a confirmation screen and will then make the request appear in the "Pending Requests" table.

Create Unstaking Request

  • User with create permission who click on create unsticking request will see the dialogue with the following elements:
    • Display treasury's available balance and total staked amount.
    • Only show a list of selected validators with active staking for the treasury, including the validator's account, fee, status, and staked amount (NEAR and USD equivalence).
    • Amount to unstake, with a warning displayed if user tries to exceed the staking balance.
    • Notes text area for optional comments.
    • Delete button (show this to users with create permissions only when editing an existing staking request, not during the initial creation).
    • Cancel button – will clear all fields and close the dialogue.
    • Submit button – triggers a confirmation screen and will then make the request appear in the "Pending Requests" table.

History Tab

  • Display a list of all past staking and unstaking requests, with their status (Approved, Expired, Rejected).
  • Include the same columns as the "Pending Requests" tabs, with the addition of a "Transaction Date" and "Transaction Link" columns.

Request Execution

  • Requests are executed (tokens are staked or unstated) only after the required number of approval is met, as defined in the voting policy settings
  • Once executed, the request moves to the "History" tab"

Permission Considerations

  • All users can view the "Stake Delegation" page and both tabs.
  • Users with "create" permission can create staking and unstaking requests.
  • Users with "create" permission can delete requests before they were approved. These requests will not show up in history.
  • Users with "vote" permission can approve or reject pending requests.

Attachments

Ask @FREZZZBE for the latest mockups.

Pending Requests Tab

Image

Create Staking Request

Image

Create Unstaking Request

Image

Create Unstaking Request – No Validators

Image

History Tab

Image

@Megha-Dev-19
Copy link
Collaborator

hey @ori-near, few things:

ID: The ID of the pending request (default sort, ascending order from 01)

  • we show the ID in descending order, so the latest request is at the top

Amount: In NEAR and USD equivalence

  • I remember we put the USD equivalence part on hold (for payments as well), since when the request was created the NEAR can be of different price, and when the user view it, it will be different, we decided to add it after the indexer (I will add this point to the indexer ticket).

Pencil edit (not shown in diagram) – this button allows users with create permission to edit the request before it had any votes. Clicking on this will show the create staking or unstaking dialogue with the pre-populated information, along with a delete button option.
Delete button (show this to users with create permissions only when editing an existing staking request, not during the initial creation).
Users with "create" permission can delete requests before they were approved. These requests will not show up in history

Include the same columns as the "Pending Requests" tabs, with the addition of a "Transaction Date" and "Transaction Link" columns.

  • can I remove this, since this a part of ticket

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants