Skip to content

Commit

Permalink
Merge pull request #293 from comdex-official/com_refactor
Browse files Browse the repository at this point in the history
Asset,vault,tokenmint,collector namings changed and unused code removed
  • Loading branch information
dheerajkd30 authored Jun 29, 2022
2 parents 8eec9f2 + 530b397 commit 781ad87
Show file tree
Hide file tree
Showing 63 changed files with 3,645 additions and 7,570 deletions.
4 changes: 1 addition & 3 deletions app/wasm/bindings/msg.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,14 @@ type MsgWhitelistAppIDLockerRewards struct {
type MsgAddExtendedPairsVault struct {
AppMappingID uint64 `json:"app_mapping_id"`
PairID uint64 `json:"pair_id"`
LiquidationRatio sdk.Dec `json:"liquidation_ratio"`
StabilityFee sdk.Dec `json:"stability_fee"`
ClosingFee sdk.Dec `json:"closing_fee"`
LiquidationPenalty sdk.Dec `json:"liquidation_penalty"`
DrawDownFee sdk.Dec `json:"draw_down_fee"`
IsVaultActive bool `json:"is_vault_active"`
DebtCeiling uint64 `json:"debt_ceiling"`
DebtFloor uint64 `json:"debt_floor"`
IsPsmPair bool `json:"is_psm_pair"`
IsStableMintVault bool `json:"is_stable_mint_vault"`
MinCr sdk.Dec `json:"min_cr"`
PairName string `json:"pair_name"`
AssetOutOraclePrice bool `json:"asset_out_oracle_price"`
Expand Down Expand Up @@ -78,7 +77,6 @@ type MsgSetAuctionMappingForApp struct {
type MsgUpdatePairsVault struct {
AppMappingID uint64 `json:"app_mapping_id"`
ExtPairID uint64 `json:"ext_pair_id"`
LiquidationRatio sdk.Dec `json:"liquidation_ratio"`
StabilityFee sdk.Dec `json:"stability_fee"`
ClosingFee sdk.Dec `json:"closing_fee"`
LiquidationPenalty sdk.Dec `json:"liquidation_penalty"`
Expand Down
2 changes: 1 addition & 1 deletion proto/comdex/asset/v1beta1/appMapping.proto
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ message AppMapping {
message MintGenesisToken {
uint64 asset_id = 1 [ (gogoproto.moretags) = "yaml:\"asset_id\"" ];
string genesis_supply = 2[(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int"];
bool isgovToken = 3 [ (gogoproto.moretags) = "yaml:\"isgovToken\"" ];
bool is_gov_token = 3 [ (gogoproto.moretags) = "yaml:\"is_gov_token\"" ];
string recipient = 4 [ (gogoproto.moretags) = "yaml:\"recipient\"" ];
}

Expand Down
4 changes: 2 additions & 2 deletions proto/comdex/asset/v1beta1/asset.proto
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ message Asset {
string name = 2 [ (gogoproto.moretags) = "yaml:\"name\"" ];
string denom = 3 [ (gogoproto.moretags) = "yaml:\"denom\"" ];
int64 decimals = 4 [ (gogoproto.moretags) = "yaml:\"decimals\"" ];
bool isOnchain = 5 [ (gogoproto.moretags) = "yaml:\"isOnchain\"" ];
bool assetOraclePrice = 6 [(gogoproto.moretags) = "yaml:\"asset_oracle_price\""];
bool is_on_chain = 5 [ (gogoproto.moretags) = "yaml:\"is_on_chain\"" ];
bool is_oracle_price_required = 6 [(gogoproto.moretags) = "yaml:\"is_oracle_price_required\""];
}
37 changes: 0 additions & 37 deletions proto/comdex/asset/v1beta1/extendedAsset.proto

This file was deleted.

58 changes: 0 additions & 58 deletions proto/comdex/asset/v1beta1/extendedLend.proto

This file was deleted.

31 changes: 13 additions & 18 deletions proto/comdex/asset/v1beta1/extendedPairVault.proto
Original file line number Diff line number Diff line change
Expand Up @@ -11,55 +11,50 @@ message ExtendedPairVault {
uint64 id = 1;
uint64 app_mapping_id = 2 [(gogoproto.moretags) = "yaml:\"app_mapping_id\""];
uint64 pair_id = 3 [(gogoproto.moretags) = "yaml:\"pair_id\""];
string liquidation_ratio = 4 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false,
(gogoproto.moretags) = "yaml:\"liquidation_ratio\""
];
string stability_fee = 5 [
string stability_fee = 4 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false,
(gogoproto.moretags) = "yaml:\"stability_fee\""
];
string closing_fee = 6 [
string closing_fee = 5 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false,
(gogoproto.moretags) = "yaml:\"closing_fee\""
];

string liquidation_penalty = 7 [
string liquidation_penalty = 6 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false,
(gogoproto.moretags) = "yaml:\"liquidation_penalty\""
];
string draw_down_fee = 8 [
string draw_down_fee = 7 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false,
(gogoproto.moretags) = "yaml:\"draw_down_fee\"" ];

bool is_vault_active = 9 [ (gogoproto.moretags) = "yaml:\"active_flag\"" ];
string debt_ceiling = 10[
bool is_vault_active = 8 [ (gogoproto.moretags) = "yaml:\"active_flag\"" ];
string debt_ceiling = 9[
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
(gogoproto.nullable) = false,
(gogoproto.moretags) = "yaml:\"debt_ceiling\"" ];
string debt_floor = 11 [
string debt_floor = 10 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
(gogoproto.nullable) = false,
(gogoproto.moretags) = "yaml:\"debt_floor\""
];
bool is_psm_pair = 12[ (gogoproto.moretags) = "yaml:\"is_psm_pair\"" ];
bool is_stable_mint_vault = 11[ (gogoproto.moretags) = "yaml:\"is_stable_mint_vault\"" ];

string min_cr = 13 [
string min_cr = 12 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false,
(gogoproto.moretags) = "yaml:\"min_cr\""
];

string pair_name = 14 [ (gogoproto.moretags) = "yaml:\"pair_name\"" ];
bool asset_out_oracle_price = 15 [ (gogoproto.moretags) = "yaml:\"asset_out_oracle_price\"" ];
uint64 asset_out_price = 16 [
string pair_name = 13 [ (gogoproto.moretags) = "yaml:\"pair_name\"" ];
bool asset_out_oracle_price = 14 [ (gogoproto.moretags) = "yaml:\"asset_out_oracle_price\"" ];
uint64 asset_out_price = 15 [
(gogoproto.moretags) = "yaml:\"asset_out_price\"" ];
uint64 min_usd_value_left = 17 [
uint64 min_usd_value_left = 16 [
(gogoproto.moretags) = "yaml:\"min_usd_value_left\"" ];

}
26 changes: 0 additions & 26 deletions proto/comdex/asset/v1beta1/gov.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ package comdex.asset.v1beta1;
import "gogoproto/gogo.proto";
import "comdex/asset/v1beta1/asset.proto";
import "comdex/asset/v1beta1/pair.proto";
import "comdex/asset/v1beta1/extendedAsset.proto";
import "comdex/asset/v1beta1/extendedLend.proto";
import "comdex/asset/v1beta1/extendedPairVault.proto";
import "comdex/asset/v1beta1/appMapping.proto";

Expand All @@ -31,30 +29,6 @@ message AddPairsProposal {
repeated Pair pairs = 3 [(gogoproto.nullable) = false];
}

message AddWhitelistedAssetsProposal {
string title = 1 [(gogoproto.moretags) = "yaml:\"title\""];
string description = 2 [(gogoproto.moretags) = "yaml:\"description\""];
repeated ExtendedAsset assets = 3 [(gogoproto.nullable) = false];
}

message UpdateWhitelistedAssetProposal {
string title = 1 [(gogoproto.moretags) = "yaml:\"title\""];
string description = 2 [(gogoproto.moretags) = "yaml:\"description\""];
ExtendedAsset asset = 3 [(gogoproto.nullable) = false];
}

message AddWhitelistedPairsProposal {
string title = 1 [(gogoproto.moretags) = "yaml:\"title\""];
string description = 2 [(gogoproto.moretags) = "yaml:\"description\""];
repeated ExtendedPairLend pairs = 3 [(gogoproto.nullable) = false];
}

message UpdateWhitelistedPairProposal {
string title = 1 [(gogoproto.moretags) = "yaml:\"title\""];
string description = 2 [(gogoproto.moretags) = "yaml:\"description\""];
ExtendedPairLend pair = 3 [(gogoproto.nullable) = false];
}

message AddExtendedPairsVaultProposal {
string title = 1 [(gogoproto.moretags) = "yaml:\"title\""];
string description = 2 [(gogoproto.moretags) = "yaml:\"description\""];
Expand Down
52 changes: 26 additions & 26 deletions proto/comdex/asset/v1beta1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@ message QueryAppResponse {
];
}

message QueryTokenGovRequest {
message QueryGovTokenByAppRequest {
uint64 app_id = 1 [(gogoproto.moretags) = "yaml:\"app_id\""];
}

message QueryTokenGovResponse {
message QueryGovTokenByAppResponse {
uint64 gov_asset_id = 1 [(gogoproto.moretags) = "yaml:\"gov_asset_id\""];
}

Expand All @@ -102,50 +102,50 @@ message QueryAppsResponse {
];
}

message QueryPairVaultRequest {
message QueryExtendedPairVaultRequest {
uint64 id = 1;
}

message QueryPairVaultResponse {
message QueryExtendedPairVaultResponse {
ExtendedPairVault pairVault = 1 [
(gogoproto.moretags) = "yaml:\"pair_vault\"",
(gogoproto.nullable) = false
];
}

message QueryPairVaultsRequest {}
message QueryAllExtendedPairVaultsRequest {}

message QueryPairVaultsResponse {
message QueryAllExtendedPairVaultsResponse {
repeated ExtendedPairVault pairVault = 1 [
(gogoproto.moretags) = "yaml:\"pair_vault\"",
(gogoproto.nullable) = false
];
}

message QueryProductToExtendedPairRequest {
uint64 product_id = 1 [(gogoproto.moretags) = "yaml:\"product_id\""];
message QueryAllExtendedPairVaultsByAppRequest {
uint64 app_id = 1 [(gogoproto.moretags) = "yaml:\"app_id\""];
}

message QueryProductToExtendedPairResponse {
message QueryAllExtendedPairVaultsByAppResponse {
repeated ExtendedPairVault extended_pair =1 [
(gogoproto.moretags) = "yaml:\"extended_pair\"",
(gogoproto.nullable) = false
];
}

message QueryExtendedPairPsmPairWiseRequest {
uint64 product_id = 1 [(gogoproto.moretags) = "yaml:\"product_id\""];
message QueryAllExtendedPairStableVaultsIdByAppRequest {
uint64 app_id = 1 [(gogoproto.moretags) = "yaml:\"app_id\""];
}

message QueryExtendedPairPsmPairWiseResponse {
message QueryAllExtendedPairStableVaultsIdByAppResponse {
repeated uint64 extended_pairs_id =1 [(gogoproto.moretags) = "yaml:\"extended_pairs_id\""];
}

message QueryExtendedPairDataPsmPairWiseRequest {
message QueryAllExtendedPairStableVaultsDataByAppRequest {
uint64 app_id = 1 [(gogoproto.moretags) = "yaml:\"app_id\""];
}

message QueryExtendedPairDataPsmPairWiseResponse {
message QueryAllExtendedPairStableVaultsDataByAppResponse {
repeated ExtendedPairVault extended_pair =1 [
(gogoproto.moretags) = "yaml:\"extended_pair\"",
(gogoproto.nullable) = false
Expand Down Expand Up @@ -174,23 +174,23 @@ service Query {
rpc QueryAppMappings(QueryAppRequest) returns (QueryAppResponse) {
option (google.api.http).get = "/comdex/asset/v1beta1/app/{id}";
}
rpc QueryPairVault(QueryPairVaultRequest) returns (QueryPairVaultResponse) {
option (google.api.http).get = "/comdex/asset/v1beta1/pairVault/{id}";
rpc QueryExtendedPairVault(QueryExtendedPairVaultRequest) returns (QueryExtendedPairVaultResponse) {
option (google.api.http).get = "/comdex/asset/v1beta1/extended_pair_vault/{id}";
}
rpc QueryPairVaults(QueryPairVaultsRequest) returns (QueryPairVaultsResponse) {
option (google.api.http).get = "/comdex/asset/v1beta1/pairVaults";
rpc QueryAllExtendedPairVaults(QueryAllExtendedPairVaultsRequest) returns (QueryAllExtendedPairVaultsResponse) {
option (google.api.http).get = "/comdex/asset/v1beta1/extended_pair_vaults";
}
rpc QueryProductToExtendedPair(QueryProductToExtendedPairRequest) returns (QueryProductToExtendedPairResponse) {
option (google.api.http).get = "/comdex/asset/v1beta1/product_to_extended_pair/{product_id}";
rpc QueryAllExtendedPairVaultsByApp(QueryAllExtendedPairVaultsByAppRequest) returns (QueryAllExtendedPairVaultsByAppResponse) {
option (google.api.http).get = "/comdex/asset/v1beta1/product_to_extended_pair/{app_id}";
}
rpc QueryExtendedPairPsmPairWise(QueryExtendedPairPsmPairWiseRequest) returns (QueryExtendedPairPsmPairWiseResponse) {
option (google.api.http).get = "/comdex/asset/v1beta1/extended_pair_psm_pair_wise/{product_id}";
rpc QueryAllExtendedPairStableVaultsIdByApp(QueryAllExtendedPairStableVaultsIdByAppRequest) returns (QueryAllExtendedPairStableVaultsIdByAppResponse) {
option (google.api.http).get = "/comdex/asset/v1beta1/extended_pair_stable_vault_wise/{app_id}";
}
rpc QueryTokenGov(QueryTokenGovRequest) returns (QueryTokenGovResponse) {
option (google.api.http).get = "/comdex/asset/v1beta1/check_for_token_gov/{app_id}";
rpc QueryGovTokenByApp(QueryGovTokenByAppRequest) returns (QueryGovTokenByAppResponse) {
option (google.api.http).get = "/comdex/asset/v1beta1/gov_token_in_an_app/{app_id}";
}
rpc QueryExtendedPairDataPsmPairWise(QueryExtendedPairDataPsmPairWiseRequest) returns (QueryExtendedPairDataPsmPairWiseResponse) {
option (google.api.http).get = "/comdex/asset/v1beta1/extended_pair_psm_wise/{app_id}";
rpc QueryAllExtendedPairStableVaultsDataByApp(QueryAllExtendedPairStableVaultsDataByAppRequest) returns (QueryAllExtendedPairStableVaultsDataByAppResponse) {
option (google.api.http).get = "/comdex/asset/v1beta1/extended_pair_stable_vault_wise/{app_id}";
}

}
14 changes: 0 additions & 14 deletions proto/comdex/collector/v1beta1/collector.proto
Original file line number Diff line number Diff line change
Expand Up @@ -97,20 +97,6 @@ message AppToDenomsMapping {
repeated uint64 asset_ids = 2 [(gogoproto.moretags) = "yaml:\"asset_ids\""];
}

/////////////////////////////////////////////////////////2222222222222


message HistoricalAuction {
uint64 app_id = 1 [(gogoproto.moretags) = "yaml:\"app_id\""];
repeated AssetToAuctionMapping asset_to_auction = 2 [(gogoproto.moretags) = "yaml:\"asset_to_auction\""];
}

message AssetToAuctionMapping {
uint64 auctionId = 1 [(gogoproto.moretags) = "yaml:\"auction_id\""];
repeated string asset_denoms = 2 [(gogoproto.moretags) = "yaml:\"asset_denoms\""];
}

////////////////////////////////////////////////////////33333333333333

// key app id -> assets traverse this one
message CollectorAuctionLookupTable {
Expand Down
Loading

0 comments on commit 781ad87

Please sign in to comment.