Skip to content

Commit

Permalink
Assign ID for poolDenom (#456)
Browse files Browse the repository at this point in the history
Create dedicated PoolMetadata storage 
Add associated lookups and refs

---------

Co-authored-by: Julian Compagni Portis <julian@terrascope.io>
  • Loading branch information
jcompagni10 and Julian Compagni Portis authored Sep 18, 2023
1 parent d1a0d14 commit 9ede0f2
Show file tree
Hide file tree
Showing 58 changed files with 3,345 additions and 936 deletions.
16 changes: 10 additions & 6 deletions proto/duality/dex/genesis.proto
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
syntax = "proto3";

package duality.dex;

import "gogoproto/gogo.proto";
import "duality/dex/params.proto";
import "duality/dex/limit_order_tranche_user.proto";
import "duality/dex/limit_order_tranche.proto";
import "duality/dex/tick_liquidity.proto";
import "duality/dex/pool_metadata.proto";

// this line is used by starport scaffolding # genesis/proto/import

option go_package = "github.com/duality-labs/duality/x/dex/types";

// GenesisState defines the dex module's genesis state.
message GenesisState {
Params params = 1 [(gogoproto.nullable) = false];
repeated TickLiquidity tickLiquidityList = 2 [(gogoproto.nullable) = true];
repeated LimitOrderTranche inactiveLimitOrderTrancheList = 6 [(gogoproto.nullable) = true];
repeated LimitOrderTrancheUser limitOrderTrancheUserList = 7 [(gogoproto.nullable) = true];


Params params = 1 [(gogoproto.nullable) = false];
repeated TickLiquidity tickLiquidityList = 2 [(gogoproto.nullable) = true ];
repeated LimitOrderTranche inactiveLimitOrderTrancheList = 3 [(gogoproto.nullable) = true ];
repeated LimitOrderTrancheUser limitOrderTrancheUserList = 4 [(gogoproto.nullable) = true ];
repeated PoolMetadata poolMetadataList = 5 [(gogoproto.nullable) = false];
uint64 poolCount = 6;
// this line is used by starport scaffolding # genesis/proto/state
}

9 changes: 6 additions & 3 deletions proto/duality/dex/pool.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ option go_package = "github.com/duality-labs/duality/x/dex/types";
import "gogoproto/gogo.proto";
import "duality/dex/pool_reserves.proto";

// NOTE: This struct is never actually stored in the KV store. It is merely a convenience wrapper for holding both sides of a pool.

message Pool {
PoolReserves lower_tick0 = 1;
PoolReserves upper_tick1 = 2;
}
uint64 ID = 1;
PoolReserves lower_tick0 = 2;
PoolReserves upper_tick1 = 3;
}
13 changes: 13 additions & 0 deletions proto/duality/dex/pool_metadata.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
syntax = "proto3";
package duality.dex;

option go_package = "github.com/duality-labs/duality/x/dex/types";

import "duality/dex/pair_id.proto";

message PoolMetadata {
uint64 ID = 1;
int64 tick = 2;
uint64 fee = 3;
PairID pairID = 4;
}
Loading

0 comments on commit 9ede0f2

Please sign in to comment.