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

docs: add drafts of specs for liquidfarming module #343

Conversation

jeonghoyeo7
Copy link
Contributor

Description

closes: #XXXX

Tasks

  • add spec docs

References


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Appropriate labels applied
  • Targeted PR against correct branch
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards.
  • Wrote unit and integration
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Re-reviewed Files changed in the Github PR explorer
  • Review Codecov Report in the comment section below once CI passes

…old-liquidfarm

* commit 'b55b46c37f871876dd16848db4cb125f89ce669f':
  feat: adding gRPC queries
  chore: add CreateRewardsAuction, AfterAllocateRewards hook, and remove unnecessary comments
  chore: update CHANGELOG
  fix: limit the number of active pools in a pair
  WIP: adding after allocate rewards hook
  chore: update deposit to farm and add refund bid test case
  docs: apply code review suggestion
  docs: update docs and CHANGELOG
  test: add more example tests
  refactor!: refactor `MakeOrderBookResponse`
  docs: link matching white paper
  chore: fix CHANGELOG
  fix: apply code review suggestion
  fix: update client docs and write CHANGELOG
  feat: improve PoolResponse from gGRPC queries
  fix: consider lowest/highest price when rendering order book response
  fix: return ticks by up to numTicks in OrderBookResponse
…old-liquidfarm

* commit '29849feae48bb02ebb6fe4b0afd1605b01056ff7':
  WIP: fixing registerservices and adding test case
…old-liquidfarm

* commit '3e14bf1391643c4b8d9efab27bc1fc923ca8a6d0':
  feat: add genesis import and export
  feat: add query commands
  WIP: adding query commands
  chore: remove selling reserve address in rewards auction, add grpc queries, add grpc test codes
  test: add msgs and params test cases
  feat: update grpc queries endpoints
  feat: add refund bid cmd
  test: add liquidfarms and liquifarm grpc queries
  feat: remove end blocker
  chore: organize codes and inline comments
  feat: terminate rewards auction and create new one, add logic for auto-compounding
Copy link
Contributor

@jaybxyz jaybxyz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work on writing up the technical specification! I left some comments; they are mostly about correcting indentation.

x/liquidfarming/spec/02_state.md Outdated Show resolved Hide resolved
x/liquidfarming/spec/02_state.md Outdated Show resolved Hide resolved
x/liquidfarming/spec/02_state.md Outdated Show resolved Hide resolved
x/liquidfarming/spec/02_state.md Outdated Show resolved Hide resolved
x/liquidfarming/spec/04_messages.md Outdated Show resolved Hide resolved
x/liquidfarming/spec/07_hooks.md Outdated Show resolved Hide resolved
x/liquidfarming/spec/07_hooks.md Outdated Show resolved Hide resolved
x/liquidfarming/spec/07_hooks.md Outdated Show resolved Hide resolved
x/liquidfarming/spec/04_messages.md Outdated Show resolved Hide resolved
x/liquidfarming/spec/04_messages.md Outdated Show resolved Hide resolved
@jaybxyz
Copy link
Contributor

jaybxyz commented Aug 1, 2022

@jeonghoyeo7 Can you pull the latest commit from #332 so that broken tests are resolved?

…old-liquidfarm

* commit '7470618e10332ec3d1615061f4715f92cd60bf39':
  chore: fix broken test cases and refactor hook
  test: add test case for UnfarmAndWithdraw
  feat: add UnfarmAndWithdraw and remove liquid farm exist validation for unfarm msg service
  chore: update CHANGELOG
  refactor: add `price_unit_powers` param to order books query
  feat: remove unused codes
  feat: adding unfarm and withdraw msg server
  refactor: make error handling consistent, follow naming convention, and clean up codes
  chore: add genesis test case, clean up codes
  fix: bug some pool coins voting power omitted on voting_powers
  chore: update CHANGELOG
  refactor!: detailed configuration for order book responses
…old-liquidfarm

* commit '2a402abde5dc20f7d24c174721d86b9aff4746ae':
  WIP: fixing bug
…old-liquidfarm

* commit '96046cf12bd27ebc7fb43413f00f639a994979bc':
  test: add more tests
  chore: remove LiquidFarmCreationFee and add test cases for types
  refactor: add necessary comments
  feat: update AdvancedEpoch
@github-actions github-actions bot added the documentation Improvements or additions to documentation label Aug 3, 2022
…old-liquidfarm

* commit '61edf2618aa34ea2b28bee8d9eb8ee72bf146edb':
  fix: remove pointer
…old-liquidfarm

* commit '8e3ea8f32bcb5eed7ab9f564c241098c5745f0b4':
  fix: typo in query endpoints
…old-liquidfarm

* commit '6347f1dad2d234b352fb3ba0cd2b6d8ee0fb5e32':
  fix: rename reward-auction to rewards-auction query command
  chore: fix RewardsAuctions query command, apply updated spec to store LiquidFarm object
  fix: rename lfCoin to UnfarmingCoin and add validation check for the liquid coin denom
…old-liquidfarm

* commit '7f91cfe4c01ede00dc0af66bfa4ba4b511b5d112':
  chore: apply updated spec and adding test cases
* kogisin/scaffold-liquidfarm:
  feat: make liquidFarmSet map deterministic
  fix: broken tests
  chore: add unfarm fee rate param, add more test cases, organize codebase
  test: adding test case
…old-liquidfarm

* commit 'e9c6542010a202879d62687e8cd96774d227149f':
  feat: `liquidfarming` module apply changed spec (cosmosquad-labs#345)
…old-liquidfarm

* commit '2a4f0a0a5d618e217bd14f0c7096d3a04409860a':
  feat: organize events
  feat: add stakedCoins zero validation before unstake
  feat: add edge test case
@jaybxyz jaybxyz marked this pull request as ready for review August 11, 2022 04:53
@jaybxyz
Copy link
Contributor

jaybxyz commented Aug 11, 2022

As discussed offline, we will merge this docs PR and continue to update in #332

@jaybxyz jaybxyz merged commit 4342601 into cosmosquad-labs:kogisin/scaffold-liquidfarm Aug 11, 2022
jeonghoyeo7 added a commit to jeonghoyeo7/squad that referenced this pull request Aug 13, 2022
…old-liquidfarm

* commit '4342601b042c58b35fc77c0b9966a28d5593ebdd':
  docs: add drafts of specs for liquidfarming module (cosmosquad-labs#343)
@dongsam dongsam removed the c-sync label Aug 25, 2022
jaybxyz added a commit that referenced this pull request Oct 5, 2022
* chore: scaffold liquidfarming module

* chore: apply updated spec

* feat: adding handlers for both msgs and proposal

* feat: adding keeper logics

* chore: fix proto numbering and add msg server boilerplate

* feat: add keys and proposal handler

* feat: add params and genesis

* feat: add more getter and setter stores

* chore: update store and add cli boilerplate

* feat: follow naming convention

* chore: apply updated spec and add keeper test suite boilerplate
1. LiquidFarm object doesn't need to be stored
2. Use param change proposal instead of a custom gov proposal
3. Clean up codebase

* feat: add winner bid id

* feat: update proto files

* feat: register liquid farming in app

* feat: implement deposit, cancel, and withdraw

* feat: add transaction commands

* docs: add spec docs

* docs: update README.md

* chore: fix indentation, add farming keeper, and add helper and short-cut functions for tests

* feat: apply updated specs

* feat: add liquidfarms and liquidfarm grpc queries

* feat: imposing deposit gas fee for deposit request

* feat: add logic to impose more gas as there are more number of deposit requests made by a depositor

* feat: add AfterAllocateRewardsHook for the farming module

* docs: add hooks

* feat: apply suggestions from the review

* feat: work in progress

* feat: update names

* feat: apply updated spec

* feat: clean up keeper and add missing logics

* feat: add AfterStaked hook in the farming module

* feat: set hooks in app

* chore: add queued farming, update params to meet naming convention, and fixing cancel queued farming logic

* test: adding store to cancel queued farming

* chore: fix farm and cancel queued farming logic and add test cases

* feat: mint LFCoin in hook

* chore: add test cases to verify farm, unfarm, cancel

* feat: set time nullable false and add create rewards auction function

* fix: add unsafe hooks to fix the case

* WIP: adding PlaceBid

* WIP: apply updated spec

* feat: rename some fields and add bid stores

* chore: apply updated spec, fix bugs, and add test cases

* chore: update deposit to farm and add refund bid test case

* WIP: adding after allocate rewards hook

* chore: add CreateRewardsAuction, AfterAllocateRewards hook, and remove unnecessary comments

* feat: adding gRPC queries

* WIP: fixing registerservices and adding test case

* feat: terminate rewards auction and create new one, add logic for auto-compounding

* chore: organize codes and inline comments

* feat: remove end blocker

* test: add liquidfarms and liquifarm grpc queries

* feat: add refund bid cmd

* feat: update grpc queries endpoints

* test: add msgs and params test cases

* chore: remove selling reserve address in rewards auction, add grpc queries, add grpc test codes

* WIP: adding query commands

* feat: add query commands

* feat: add genesis import and export

* chore: add genesis test case, clean up codes

* refactor: make error handling consistent, follow naming convention, and clean up codes

* feat: adding unfarm and withdraw msg server

* feat: remove unused codes

* feat: add UnfarmAndWithdraw and remove liquid farm exist validation for unfarm msg service

* test: add test case for UnfarmAndWithdraw

* chore: fix broken test cases and refactor hook

* WIP: fixing bug

* feat: update AdvancedEpoch

* refactor: add necessary comments

* chore: remove LiquidFarmCreationFee and add test cases for types

* test: add more tests

* fix: remove pointer

* fix: typo in query endpoints

* fix: rename lfCoin to UnfarmingCoin and add validation check for the liquid coin denom

* chore: fix RewardsAuctions query command, apply updated spec to store LiquidFarm object

* fix: rename reward-auction to rewards-auction query command

* chore: apply updated spec and adding test cases

* test: adding test case

* chore: add unfarm fee rate param, add more test cases, organize codebase

* fix: broken tests

* feat: make liquidFarmSet map deterministic

* feat: `liquidfarming` module apply changed spec (#345)

* feat: remove AfterStaked hook in the farming module

* chore: remove QueuedFarming and its related codebase, remove CanceldQueuedFarming tx

* chore: update unfarm msg server, add compounding rewards, update calculate functions

* feat: use MulTruncate for conservative approach

* test: add more test cases to increase coverage

* fix: resolve golang-lint ci

* test: add boilerplate for integration cli tests

* test: add unfarm partial test case

* chore: fix delete bid location and add unfarm complex test case

* feat: use panic in RemoveLiquidFarm instead of returning error

* feat: remove DelayedFarmGasFee

* feat: add edge test case

* feat: add stakedCoins zero validation before unstake

* feat: organize events

* docs: add drafts of specs for liquidfarming module (#343)

* add docs

* docs: draft specs for liquidfarming module

* docs: update specs

* docs: update specs

* docs: update specs

* docs: update spec

* docs: update spec

* docs: update docs

* docs: update cli/api docs

* docs: updates

* docs: update API/CLI

* docs: updated docs for deactivation of liquidFarms

* Revert "docs: updated docs for deactivation of liquidFarms"

This reverts commit 2a0545d.

* Revert "Revert "docs: updated docs for deactivation of liquidFarms""

This reverts commit 07a063d.

* docs: update liquidfarming spec

* docs: update spec docs

* docs: updates

* docs: update spec/api/cli

* review: applying almost all suggestions

* review: refund previous bid if exists in PlaceBid

* review: apply the rest suggestions

* chore: rename minimum to min for convention and fix broken test cases

* test: add tx query integration tests

* fix: fix daed links in spec docs

* fix: move denom verification to message level

* fix: add bidding coin denom verification and winning bid verification must be checked first

* test: add integration tests

* docs: update cli docs

* test: add boilerplate for simulation tests

* feat: rename UnfarmFeeRate to FeeRate and move it inside LiquidFarm

* feat: add deduct fees logic

* feat: add mint/burn rate queries

* fix: fix genesis validation test

* test: add tests for mint/burn rates grpc queries

* fix: fix simulation params

* test: add param test for simulation

* chore: add liquidfarming in labeler workflow and remove mistakenly added struct

* feat: remove hooks in farming and liquidfarming modules as they are not needed anymore

* feat: change names from Farm and Unfarm to LiquidFarm and LiquidUnfarm

* feat: switch farming module to farm module and update with new functions

* feat: add auction period hours

* feat: updating RewardsAuction creation

* feat: complete BeginBlocker logics

* feat: add NewLiquidUnfarmAndWithdrawCmd CLI command

* feat: rename BurningCoin to UnfarmingCoin

* test: add more test cases for types

* feat: add TODO comments and use Rewards

* test: fixing test case

* fix: SetRewardsAuctionEndTime

* test: updating test cases

* test: resolve TODO comments

* test: update more test cases

* test: update all keeper and type test cases for the farm module

* fix: fix broken test cases due to relying on the farming module

* test: add missing param in simulation test

* test: update simulation tests and fix golangci-lint issues

* fix: fix params test

* chore: update api and cli docs

* docs: updating spec docs with the latest version

* test: update test cases

* chore: update comments, clean up, update docs

* feat: remove typo

* feat: apply suggestions from the review

* chore: fix broken integration test and add test cases

* fix: fix error messages

* revert: revert incorrectly fixed error message

* docs: update spec docs

* feat: resolve TODO comments

* fix: add includeWinningBid when refunding all bids to fix an edge case

* fix: simulation halted due to position

* feat: add auction id as param for PlaceBid and RefundBid, add WinningAmount in RewardsAuction

* fix: test cases by applying the previous commit

* docs: update spec docs

* docs: update CHANGELOG.md

* env: add farm and liquidfarming modules in c-sync labeler.yml

Co-authored-by: Jeongho Yeo <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation x/farming
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants