frontend-monorepo
frontend-monorepo copied to clipboard
Add submit / amend / remove liquidity button to Console
Story
As a liquidity provide I want a button that lets me submit / amend / remove my liquidity commitment So that I don't have to submit transactions using CLI
Acceptance Criteria
- [ ] There is a button to submit liquidity
- [ ] It pops open a modal
- [ ] The modal lets me input amount and fee
- [ ] If the market has a set fee factor then the fee input is disabled
- [ ] Market Id and partyID are taken from the wallet / market in question
- [ ] No toast needed, we should show success / fail on the modal
- [ ] If the market is terminated or closed you shouldnt be able to submit
- [ ] the same button supports amending liquidity if you already have a commitment for that market
Tasks
- [ ] UX (if needed)
- [ ] Design (if needed)
- [ ] Team and stakeholder review
- [ ] Specs reviewed and created or adjusted
- [ ] Implementation
- [ ] Testing (unit and/or e2e)
- [ ] Code review
- [ ] QA review
Sketch
I would think some sort of button in here to ADD LIQUIDITY would be a must have:
I would think something in line in here to allow me to Amend / Remove would be required:
Additional details / background info
Submission form
When you click to commit we should have a form with the necessary fields:
- Market Name / ID (which we could default based on the market you were viewing)
- Amount (which we would need to process in human readable and sort out the asset decimals)
- Fee factor
We should also display some information on what this means, some text and probably some derived info based on teh market config.
eg.
Commit Liquidity
Market Name: ETH/USDT
Amount: 1000 USDT
Fee factor: 0.1%
Sending this transaction will commit you as a liquidity provider to this market and make you eligible to receive a share of the fees and rewards paid on this market each epoch.
Fees last epoch = X
Rewards last epoch = Y
To be eligible for these fees and rewards you will be expected to meet the SLA for this market:
- Provide liquidity for `time on book` of the time
- To count as "on book" you must provide liquidity between `LP price range`
You can review your live scores against this SLA in the table below, as well as any fees accrued and penalties that may be applied to those fees at the end of the epoch.
Commands required:
message LiquidityProvisionSubmission {
reserved 4, 5;
// Market that the submitter wishes to provide liquidity for.
string market_id = 1;
// Amount that the submitter will commit as liquidity to the market, specified as a unitless number in the settlement asset of the market.
// This field is an unsigned integer scaled using the asset's decimal places.
string commitment_amount = 2;
// Nominated liquidity fee factor, which is an input to the calculation of taker fees on the market, as per setting fees and rewarding liquidity providers.
string fee = 3;
// Arbitrary reference to be added to every order created out of this liquidity provision submission.
string reference = 6;
}
// Command that allows a liquidity provider to inform the network that they will stop providing liquidity for a market.
message LiquidityProvisionCancellation {
// Market that the submitter will stop providing liquidity for.
string market_id = 1;
}
// Command that allows a liquidity provider to update the details of their existing liquidity commitment.
// Any field that is left unset or as a default value indicates that this field on the original submission will be left unchanged.
message LiquidityProvisionAmendment {
reserved 4, 5;
// Market that the submitter wants to amend the liquidity commitment for.
string market_id = 1;
// New commitment amount.
string commitment_amount = 2;
// New nominated liquidity fee factor.
string fee = 3;
// New arbitrary reference to be added to every order created out of this liquidity provision submission.
string reference = 6;
}
Need to find out the conditions we need on the REMOVE case.
How else can we better signpost the liquidity table?
Also can we add that back to trading button? I know ppl will say "just hit back"!!
This is now defunct since Core are removing this transaction anyway.