syntax = "proto3";
package provenance.exchange.v1;

option go_package = "github.com/provenance-io/provenance/x/exchange";

option java_package        = "io.provenance.exchange.v1";
option java_multiple_files = true;

import "amino/amino.proto";
import "cosmos/base/v1beta1/coin.proto";
import "cosmos_proto/cosmos.proto";
import "gogoproto/gogo.proto";

// Commitment contains information on committed funds.
message Commitment {
  // account is the bech32 address string with the committed funds.
  string account = 1;
  // market_id is the numeric identifier of the market the funds are committed to.
  uint32 market_id = 2;
  // amount is the funds that have been committed by the account to the market.
  repeated cosmos.base.v1beta1.Coin amount = 3 [
    (gogoproto.nullable)     = false,
    (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins",
    (amino.dont_omitempty)   = true,
    (amino.encoding)         = "legacy_coins"
  ];
}

// AccountAmount associates an account with a coins amount.
message AccountAmount {
  option (gogoproto.goproto_stringer) = false;
  // account is the bech32 address string of the account associated with the amount.
  string account = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
  // amount is the funds associated with the address.
  repeated cosmos.base.v1beta1.Coin amount = 2 [
    (gogoproto.nullable)     = false,
    (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins",
    (amino.dont_omitempty)   = true,
    (amino.encoding)         = "legacy_coins"
  ];
}

// MarketAmount associates a market with a coins amount.
message MarketAmount {
  option (gogoproto.goproto_stringer) = false;
  // market_id is the numeric identifier the amount has been committed to.
  uint32 market_id = 1;
  // amount is the funds associated with the address.
  repeated cosmos.base.v1beta1.Coin amount = 2 [
    (gogoproto.nullable)     = false,
    (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins",
    (amino.dont_omitempty)   = true,
    (amino.encoding)         = "legacy_coins"
  ];
}

// NetAssetPrice is an association of assets and price used to record the value of things.
// It is related to the NetAssetValue message from the x/marker module, and is therefore often referred to as "a NAV".
message NetAssetPrice {
  option (gogoproto.goproto_stringer) = false;
  // assets is the volume and denom that has been bought or sold.
  cosmos.base.v1beta1.Coin assets = 1 [(gogoproto.nullable) = false];
  // price is what was paid for the assets.
  cosmos.base.v1beta1.Coin price = 2 [(gogoproto.nullable) = false];
}