syntax = "proto3";
package osmosis.twap.v1beta1;

import "gogoproto/gogo.proto";
import "osmosis/twap/v1beta1/twap_record.proto";
import "osmosis/twap/v1beta1/genesis.proto";

import "cosmos/base/v1beta1/coin.proto";
import "cosmos/base/query/v1beta1/pagination.proto";
import "google/api/annotations.proto";
import "google/protobuf/any.proto";
import "cosmos_proto/cosmos.proto";
import "google/protobuf/timestamp.proto";

option go_package = "github.com/osmosis-labs/osmosis/v13/x/twap/client/queryproto";

service Query {
  rpc Params(ParamsRequest) returns (ParamsResponse) {
    option (google.api.http).get = "/osmosis/twap/v1beta1/Params";
  }
  rpc ArithmeticTwap(ArithmeticTwapRequest) returns (ArithmeticTwapResponse) {
    option (google.api.http).get = "/osmosis/twap/v1beta1/ArithmeticTwap";
  }
  rpc ArithmeticTwapToNow(ArithmeticTwapToNowRequest)
      returns (ArithmeticTwapToNowResponse) {
    option deprecated = true;
    option (google.api.http).get = "/osmosis/twap/v1beta1/ArithmeticTwapToNow";
  }
}

message ArithmeticTwapRequest {
  uint64 pool_id = 1;
  string base_asset = 2;
  string quote_asset = 3;
  google.protobuf.Timestamp start_time = 4 [
    (gogoproto.nullable) = false,
    (gogoproto.stdtime) = true,
    (gogoproto.moretags) = "yaml:\"start_time\""
  ];
  google.protobuf.Timestamp end_time = 5 [
    (gogoproto.nullable) = true,
    (gogoproto.stdtime) = true,
    (gogoproto.moretags) = "yaml:\"end_time\""
  ];
}
message ArithmeticTwapResponse {
  string arithmetic_twap = 1 [
    (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
    (gogoproto.moretags) = "yaml:\"arithmetic_twap\"",
    (gogoproto.nullable) = false
  ];
}

message ArithmeticTwapToNowRequest {
  uint64 pool_id = 1;
  string base_asset = 2;
  string quote_asset = 3;
  google.protobuf.Timestamp start_time = 4 [
    (gogoproto.nullable) = false,
    (gogoproto.stdtime) = true,
    (gogoproto.moretags) = "yaml:\"start_time\""
  ];
}
message ArithmeticTwapToNowResponse {
  string arithmetic_twap = 1 [
    (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
    (gogoproto.moretags) = "yaml:\"arithmetic_twap\"",
    (gogoproto.nullable) = false
  ];
}

message ParamsRequest {}
message ParamsResponse { Params params = 1 [ (gogoproto.nullable) = false ]; }
