Skip to content

Commit

Permalink
update spec
Browse files Browse the repository at this point in the history
  • Loading branch information
zsystm committed Jul 25, 2023
1 parent e95dedb commit 428a82e
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 34 deletions.
2 changes: 1 addition & 1 deletion client/docs/statik/statik.go

Large diffs are not rendered by default.

36 changes: 15 additions & 21 deletions client/docs/swagger-ui/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2225,15 +2225,15 @@ paths:
type: string
title: >-
Calculated by reward module account's native token balance
+ all paired
+ all

chunk's native token balance + all delegation tokens of
paired chunks
chunk's native token balance + sum of all remaining
rewards of paired

since last Epoch + all unbonding delegation tokens of
unpairing chunks +
chunks since last Epoch + all unbonding delegation tokens
of unpairing

reward module account's balance
chunks + reward module account's balance
total_liquid_tokens:
type: string
title: >-
Expand Down Expand Up @@ -35763,16 +35763,11 @@ definitions:
ls tokens
net_amount:
type: string
title: >-
title: |-
Calculated by reward module account's native token balance + all
paired

chunk's native token balance + all delegation tokens of paired chunks

since last Epoch + all unbonding delegation tokens of unpairing chunks
+

reward module account's balance
chunk's native token balance + sum of all remaining rewards of paired
chunks since last Epoch + all unbonding delegation tokens of unpairing
chunks + reward module account's balance
total_liquid_tokens:
type: string
title: |-
Expand Down Expand Up @@ -36429,15 +36424,14 @@ definitions:
type: string
title: >-
Calculated by reward module account's native token balance + all
paired

chunk's native token balance + all delegation tokens of paired
chunks
chunk's native token balance + sum of all remaining rewards of
paired

since last Epoch + all unbonding delegation tokens of unpairing
chunks +
chunks since last Epoch + all unbonding delegation tokens of
unpairing

reward module account's balance
chunks + reward module account's balance
total_liquid_tokens:
type: string
title: >-
Expand Down
8 changes: 4 additions & 4 deletions proto/canto/liquidstaking/v1/liquidstaking.proto
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,10 @@ message NetAmountState {
(gogoproto.nullable) = false
];

// Calculated by reward module account's native token balance + all paired
// chunk's native token balance + all delegation tokens of paired chunks
// since last Epoch + all unbonding delegation tokens of unpairing chunks +
// reward module account's balance
// Calculated by reward module account's native token balance + all
// chunk's native token balance + sum of all remaining rewards of paired
// chunks since last Epoch + all unbonding delegation tokens of unpairing
// chunks + reward module account's balance
string net_amount = 3 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false
Expand Down
11 changes: 7 additions & 4 deletions x/liquidstaking/spec/02_state.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,14 @@ This will be consumed at **Handle Queued Withdraw Insurance Requests** when Epoc
- When insurance is withdrawn and there are no candidate insurances, the chunk balance can be the same as the chunk size in tokens.
- **sum of all tokens corresponding delegation shares of paired chunks**
- total amount of native tokens currently delegated
- may be less than the sum of the delegation shares due to slashing in the calculation
- This will be an edge case because insurance will cover any penalty.
- may be less than original values due to slashing in the calculation when there was a slashing which will not be covered by insurance.
- **sum of all remaining rewards of all chunks delegations**
- not yet claimed native tokens
- `cumulated delegation rewards x (1 - paired insurance commission rates - module's fee rate)`
- the remaining reward for each chunk is calculated as follows:
```
rest = del_reward - insurance_commission
remaining = rest x (1 - dynamic_fee_rate)
result = remaining x (1 - discount_rate)
```

**MintRate** is the rate that is calculated from total supply of ls tokens divided by NetAmount.

Expand Down
8 changes: 4 additions & 4 deletions x/liquidstaking/types/liquidstaking.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 428a82e

Please sign in to comment.