From 2a0545d6ad738a6a98c04b267c2cbdb1df891d6c Mon Sep 17 00:00:00 2001 From: jeongho7yeo Date: Mon, 8 Aug 2022 14:20:56 +0900 Subject: [PATCH] docs: updated docs for deactivation of liquidFarms --- proto/squad/boost/v1beta1/boost.proto | 0 proto/squad/boost/v1beta1/genesis.proto | 0 proto/squad/boost/v1beta1/param.proto | 0 proto/squad/boost/v1beta1/query.proto | 0 proto/squad/boost/v1beta1/tx.proto | 0 x/boost/abci.go | 0 x/boost/client/cli/query.go | 0 x/boost/client/cli/tx.go | 0 x/boost/handler.go | 0 x/boost/keeper/genesis.go | 0 x/boost/keeper/grpc_query.go | 0 x/boost/keeper/keeper.go | 0 x/boost/keeper/msg_server.go | 0 x/boost/module.go | 0 x/boost/spec/01_concepts.md | 0 x/boost/spec/02_state.md | 0 x/boost/spec/03_state_transitions.md | 0 x/boost/spec/04_messages.md | 0 x/boost/spec/05_begin_block.md | 0 x/boost/spec/06_end_block.md | 0 x/boost/spec/07_hooks.md | 0 x/boost/spec/08_events.md | 0 x/boost/spec/09_params.md | 0 x/boost/types/codec.go | 0 x/boost/types/errors.go | 0 x/boost/types/events.go | 0 x/boost/types/genesis.go | 0 x/boost/types/keys.go | 0 x/boost/types/msgs.go | 0 x/boost/types/params.go | 0 x/liquidfarming/spec/01_concepts.md | 14 ++++++++++++++ x/liquidfarming/spec/02_state.md | 6 ++++++ x/liquidfarming/spec/05_begin_block.md | 16 ++++++++++++++++ .../spec/{05_events.md => 06_events.md} | 2 +- .../spec/{06_params.md => 07_params.md} | 2 +- .../spec/{07_hooks.md => 08_hooks.md} | 2 +- 36 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 proto/squad/boost/v1beta1/boost.proto create mode 100644 proto/squad/boost/v1beta1/genesis.proto create mode 100644 proto/squad/boost/v1beta1/param.proto create mode 100644 proto/squad/boost/v1beta1/query.proto create mode 100644 proto/squad/boost/v1beta1/tx.proto create mode 100644 x/boost/abci.go create mode 100644 x/boost/client/cli/query.go create mode 100644 x/boost/client/cli/tx.go create mode 100644 x/boost/handler.go create mode 100644 x/boost/keeper/genesis.go create mode 100644 x/boost/keeper/grpc_query.go create mode 100644 x/boost/keeper/keeper.go create mode 100644 x/boost/keeper/msg_server.go create mode 100644 x/boost/module.go create mode 100644 x/boost/spec/01_concepts.md create mode 100644 x/boost/spec/02_state.md create mode 100644 x/boost/spec/03_state_transitions.md create mode 100644 x/boost/spec/04_messages.md create mode 100644 x/boost/spec/05_begin_block.md create mode 100644 x/boost/spec/06_end_block.md create mode 100644 x/boost/spec/07_hooks.md create mode 100644 x/boost/spec/08_events.md create mode 100644 x/boost/spec/09_params.md create mode 100644 x/boost/types/codec.go create mode 100644 x/boost/types/errors.go create mode 100644 x/boost/types/events.go create mode 100644 x/boost/types/genesis.go create mode 100644 x/boost/types/keys.go create mode 100644 x/boost/types/msgs.go create mode 100644 x/boost/types/params.go create mode 100644 x/liquidfarming/spec/05_begin_block.md rename x/liquidfarming/spec/{05_events.md => 06_events.md} (99%) rename x/liquidfarming/spec/{06_params.md => 07_params.md} (97%) rename x/liquidfarming/spec/{07_hooks.md => 08_hooks.md} (98%) diff --git a/proto/squad/boost/v1beta1/boost.proto b/proto/squad/boost/v1beta1/boost.proto new file mode 100644 index 000000000..e69de29bb diff --git a/proto/squad/boost/v1beta1/genesis.proto b/proto/squad/boost/v1beta1/genesis.proto new file mode 100644 index 000000000..e69de29bb diff --git a/proto/squad/boost/v1beta1/param.proto b/proto/squad/boost/v1beta1/param.proto new file mode 100644 index 000000000..e69de29bb diff --git a/proto/squad/boost/v1beta1/query.proto b/proto/squad/boost/v1beta1/query.proto new file mode 100644 index 000000000..e69de29bb diff --git a/proto/squad/boost/v1beta1/tx.proto b/proto/squad/boost/v1beta1/tx.proto new file mode 100644 index 000000000..e69de29bb diff --git a/x/boost/abci.go b/x/boost/abci.go new file mode 100644 index 000000000..e69de29bb diff --git a/x/boost/client/cli/query.go b/x/boost/client/cli/query.go new file mode 100644 index 000000000..e69de29bb diff --git a/x/boost/client/cli/tx.go b/x/boost/client/cli/tx.go new file mode 100644 index 000000000..e69de29bb diff --git a/x/boost/handler.go b/x/boost/handler.go new file mode 100644 index 000000000..e69de29bb diff --git a/x/boost/keeper/genesis.go b/x/boost/keeper/genesis.go new file mode 100644 index 000000000..e69de29bb diff --git a/x/boost/keeper/grpc_query.go b/x/boost/keeper/grpc_query.go new file mode 100644 index 000000000..e69de29bb diff --git a/x/boost/keeper/keeper.go b/x/boost/keeper/keeper.go new file mode 100644 index 000000000..e69de29bb diff --git a/x/boost/keeper/msg_server.go b/x/boost/keeper/msg_server.go new file mode 100644 index 000000000..e69de29bb diff --git a/x/boost/module.go b/x/boost/module.go new file mode 100644 index 000000000..e69de29bb diff --git a/x/boost/spec/01_concepts.md b/x/boost/spec/01_concepts.md new file mode 100644 index 000000000..e69de29bb diff --git a/x/boost/spec/02_state.md b/x/boost/spec/02_state.md new file mode 100644 index 000000000..e69de29bb diff --git a/x/boost/spec/03_state_transitions.md b/x/boost/spec/03_state_transitions.md new file mode 100644 index 000000000..e69de29bb diff --git a/x/boost/spec/04_messages.md b/x/boost/spec/04_messages.md new file mode 100644 index 000000000..e69de29bb diff --git a/x/boost/spec/05_begin_block.md b/x/boost/spec/05_begin_block.md new file mode 100644 index 000000000..e69de29bb diff --git a/x/boost/spec/06_end_block.md b/x/boost/spec/06_end_block.md new file mode 100644 index 000000000..e69de29bb diff --git a/x/boost/spec/07_hooks.md b/x/boost/spec/07_hooks.md new file mode 100644 index 000000000..e69de29bb diff --git a/x/boost/spec/08_events.md b/x/boost/spec/08_events.md new file mode 100644 index 000000000..e69de29bb diff --git a/x/boost/spec/09_params.md b/x/boost/spec/09_params.md new file mode 100644 index 000000000..e69de29bb diff --git a/x/boost/types/codec.go b/x/boost/types/codec.go new file mode 100644 index 000000000..e69de29bb diff --git a/x/boost/types/errors.go b/x/boost/types/errors.go new file mode 100644 index 000000000..e69de29bb diff --git a/x/boost/types/events.go b/x/boost/types/events.go new file mode 100644 index 000000000..e69de29bb diff --git a/x/boost/types/genesis.go b/x/boost/types/genesis.go new file mode 100644 index 000000000..e69de29bb diff --git a/x/boost/types/keys.go b/x/boost/types/keys.go new file mode 100644 index 000000000..e69de29bb diff --git a/x/boost/types/msgs.go b/x/boost/types/msgs.go new file mode 100644 index 000000000..e69de29bb diff --git a/x/boost/types/params.go b/x/boost/types/params.go new file mode 100644 index 000000000..e69de29bb diff --git a/x/liquidfarming/spec/01_concepts.md b/x/liquidfarming/spec/01_concepts.md index 02010572b..6c1c477cd 100644 --- a/x/liquidfarming/spec/01_concepts.md +++ b/x/liquidfarming/spec/01_concepts.md @@ -47,3 +47,17 @@ Therefore, a bidder to place a bid for the auction should be aware of this uncer A bidder can place a bid with the pool coin, which is the paying coin of the auction. A bidder only can place a single bid per auction of a liquid farm. The bid amount of the pool coin must be higher than the current winning bid amount that is the highest bid amount of the auction. The bidder placing the bid with the highest amount of the pool coin becomes the winner of the auction and will takes all the accumulated rewards amount at the end of the auction. + +## Activation of LiquidFarm + +A `liquidFarm` is activated by addition of `liquidFarm` in the parameter by governance. +When a `liquidFarm` is activated, users can request to farm their pool coins and the `liquidfarming` module stakes the pool coins. + +## Deactivation of LiquidFarm + +A `liquidFarm` is deactivated by deletion of `liquidFarm` in the parameter by governance. +When a `liquidFarm` is deactivated, the `liquidfarming` module unstakes all pool coins from the farming module with the reserve module account. +The users cannot request to farm their pool coins, but users can still request to unfarm LF coins. +If a user has the request as `QueuedFarming`, the user needs to cancel the request to get the pool coins back. +In this case, the ongoing rewards auction becomes finished, all bids are refunded, and a new auction is not started. + diff --git a/x/liquidfarming/spec/02_state.md b/x/liquidfarming/spec/02_state.md index 33bdb9e77..ac5bec01c 100644 --- a/x/liquidfarming/spec/02_state.md +++ b/x/liquidfarming/spec/02_state.md @@ -4,6 +4,12 @@ The `liquidfarming` module keeps track of the states of pool coins and LFCoins. +## LiquidFarms + +```go +type LiquidFarms []LiquidFarm +``` + ## QueuedFarming ```go diff --git a/x/liquidfarming/spec/05_begin_block.md b/x/liquidfarming/spec/05_begin_block.md new file mode 100644 index 000000000..f475f0bed --- /dev/null +++ b/x/liquidfarming/spec/05_begin_block.md @@ -0,0 +1,16 @@ + + +# Begin-Block + +Begin block operations for the liquidfarming module synchronizes `liquidFarms` of the parameter and state. + +## Addition of new liquidFarm + +When a new liquidFarm is added in the parameter `LiquidFarms`, the new liquidFarm is also added in the state `LiquidFarms`. + +## Deletion of liquidFarm + +When a liquidFarm is deleted in the parameter `LiquidFarms`, the following opertions are done. +- Unstake all pool coins from the farming module with the reserve module account +- The ongoing auction status is set to `AUCTION_STATUS_FINISHED`. +- The new liquidFarm is also deleted in the state `LiquidFarms`. \ No newline at end of file diff --git a/x/liquidfarming/spec/05_events.md b/x/liquidfarming/spec/06_events.md similarity index 99% rename from x/liquidfarming/spec/05_events.md rename to x/liquidfarming/spec/06_events.md index 68f1f2885..0a2a96ada 100644 --- a/x/liquidfarming/spec/05_events.md +++ b/x/liquidfarming/spec/06_events.md @@ -1,4 +1,4 @@ - + # Events diff --git a/x/liquidfarming/spec/06_params.md b/x/liquidfarming/spec/07_params.md similarity index 97% rename from x/liquidfarming/spec/06_params.md rename to x/liquidfarming/spec/07_params.md index 3bcf90590..1037c4e8d 100644 --- a/x/liquidfarming/spec/06_params.md +++ b/x/liquidfarming/spec/07_params.md @@ -1,4 +1,4 @@ - + # Parameters diff --git a/x/liquidfarming/spec/07_hooks.md b/x/liquidfarming/spec/08_hooks.md similarity index 98% rename from x/liquidfarming/spec/07_hooks.md rename to x/liquidfarming/spec/08_hooks.md index acf5f7e1a..b45a5f719 100644 --- a/x/liquidfarming/spec/07_hooks.md +++ b/x/liquidfarming/spec/08_hooks.md @@ -1,4 +1,4 @@ - + # Hooks