Skip to content

Commit

Permalink
Add tickParams and errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jununifi committed May 20, 2024
1 parent 7946652 commit aa74b7f
Show file tree
Hide file tree
Showing 4 changed files with 325 additions and 58 deletions.
187 changes: 172 additions & 15 deletions api/sunrise/liquiditypool/pool.pulsar.go

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

34 changes: 22 additions & 12 deletions proto/sunrise/liquiditypool/pool.proto
Original file line number Diff line number Diff line change
Expand Up @@ -13,30 +13,40 @@ message Pool {
string denom_base = 2;
string denom_quote = 3;
string fee_rate = 4 [
(cosmos_proto.scalar) = "cosmos.Dec",
(cosmos_proto.scalar) = "cosmos.Dec",
(gogoproto.customtype) = "cosmossdk.io/math.LegacyDec",
(gogoproto.nullable) = false,
(amino.dont_omitempty) = true
];
TickParams tick_params = 5 [
(gogoproto.nullable) = false,
(gogoproto.nullable) = false,
(amino.dont_omitempty) = true
];
TickParams tick_params = 5
[ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ];
int64 current_tick = 6;
string current_tick_liquidity = 7 [
(cosmos_proto.scalar) = "cosmos.Dec",
(cosmos_proto.scalar) = "cosmos.Dec",
(gogoproto.customtype) = "cosmossdk.io/math.LegacyDec",
(gogoproto.nullable) = false,
(gogoproto.nullable) = false,
(amino.dont_omitempty) = true
];
string current_sqrt_price = 8 [
(cosmos_proto.scalar) = "cosmos.Dec",
(cosmos_proto.scalar) = "cosmos.Dec",
(gogoproto.customtype) = "cosmossdk.io/math.LegacyDec",
(gogoproto.nullable) = false,
(gogoproto.nullable) = false,
(amino.dont_omitempty) = true
];
}

// PriceRatio^(Tick - BaseOffSet)
message TickParams {

}
string price_ratio = 1 [
(cosmos_proto.scalar) = "cosmos.Dec",
(gogoproto.customtype) = "cosmossdk.io/math.LegacyDec",
(gogoproto.nullable) = false,
(amino.dont_omitempty) = true
];
string base_offset = 2 [
(cosmos_proto.scalar) = "cosmos.Dec",
(gogoproto.customtype) = "cosmossdk.io/math.LegacyDec",
(gogoproto.nullable) = false,
(amino.dont_omitempty) = true
];
}
6 changes: 4 additions & 2 deletions x/liquiditypool/types/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import (

// x/liquiditypool module sentinel errors
var (
ErrInvalidSigner = sdkerrors.Register(ModuleName, 1100, "expected gov account as only signer for proposal message")
ErrSample = sdkerrors.Register(ModuleName, 1101, "sample error")
ErrInvalidSigner = sdkerrors.Register(ModuleName, 1100, "expected gov account as only signer for proposal message")
ErrPoolNotFound = sdkerrors.Register(ModuleName, 1101, "pool not found")
ErrInvalidBaseDenom = sdkerrors.Register(ModuleName, 1102, "invalid base denom")
ErrInvalidQuoteDenom = sdkerrors.Register(ModuleName, 1103, "invalid quote denom")
)

0 comments on commit aa74b7f

Please sign in to comment.