syntax = "proto3";
package elys.amm;

option go_package = "github.com/elys-network/elys/x/amm/types";
import "elys/amm/pool_params.proto";
import "elys/amm/pool_asset.proto";
import "gogoproto/gogo.proto";
import "cosmos/base/v1beta1/coin.proto";
import "cosmos_proto/cosmos.proto";

message LegacyPool {
  uint64 pool_id = 1;
  string address = 2;
  LegacyPoolParams pool_params = 3 [ (gogoproto.nullable) = false ];
  cosmos.base.v1beta1.Coin total_shares = 4 [ (gogoproto.nullable) = false ];
  repeated PoolAsset pool_assets = 5 [ (gogoproto.nullable) = false ];
  string total_weight = 6 [
    (cosmos_proto.scalar) = "cosmos.Int",
    (gogoproto.customtype) = "cosmossdk.io/math.Int",
    (gogoproto.nullable) = false
  ];
  string rebalance_treasury = 7;
}

message Pool {
  uint64 pool_id = 1;
  string address = 2;
  PoolParams pool_params = 3 [ (gogoproto.nullable) = false ];
  cosmos.base.v1beta1.Coin total_shares = 4 [ (gogoproto.nullable) = false ];
  repeated PoolAsset pool_assets = 5 [ (gogoproto.nullable) = false ];
  string total_weight = 6 [
    (cosmos_proto.scalar) = "cosmos.Int",
    (gogoproto.customtype) = "cosmossdk.io/math.Int",
    (gogoproto.nullable) = false
  ];
  string rebalance_treasury = 7;
}

message PoolExtraInfo {
  string tvl = 1 [
    (cosmos_proto.scalar) = "cosmos.Dec",
    (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec",
    (gogoproto.nullable) = false
  ];
  string lp_token_price = 2 [
    (cosmos_proto.scalar) = "cosmos.Dec",
    (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec",
    (gogoproto.nullable) = false
  ];
  string lp_saved_apr = 3 [
    (cosmos_proto.scalar) = "cosmos.Dec",
    (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec",
    (gogoproto.nullable) = false
  ];
}

message OraclePoolSlippageTrack {
  uint64 pool_id = 1;
  uint64 timestamp = 2;
  repeated cosmos.base.v1beta1.Coin tracked = 3 [
    (gogoproto.nullable) = false,
    (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
  ];
}

message WeightBreakingSlippage {
  uint64 pool_id = 1;
  string date = 2;
  string amount = 3 [
    (cosmos_proto.scalar) = "cosmos.Dec",
    (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec",
    (gogoproto.nullable) = false
  ];
}
