syntax = "proto3";
package osmosis.superfluid;

import "gogoproto/gogo.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/timestamp.proto";
import "cosmos/base/v1beta1/coin.proto";

option go_package = "github.com/osmosis-labs/osmosis/v13/x/superfluid/types";

// SuperfluidAssetType indicates whether the superfluid asset is
// a native token itself or the lp share of a pool.
enum SuperfluidAssetType {
  option (gogoproto.goproto_enum_prefix) = false;

  SuperfluidAssetTypeNative = 0;
  SuperfluidAssetTypeLPShare = 1;
  // SuperfluidAssetTypeLendingShare = 2; // for now not exist
}

// SuperfluidAsset stores the pair of superfluid asset type and denom pair
message SuperfluidAsset {
  option (gogoproto.equal) = true;
  option (gogoproto.goproto_getters) = false;

  string denom = 1;
  // AssetType indicates whether the superfluid asset is a native token or an lp
  // share
  SuperfluidAssetType asset_type = 2;
}

// SuperfluidIntermediaryAccount takes the role of intermediary between LP token
// and OSMO tokens for superfluid staking. The intermediary account is the
// actual account responsible for delegation, not the validator account itself.
message SuperfluidIntermediaryAccount {
  // Denom indicates the denom of the superfluid asset.
  string denom = 1;
  string val_addr = 2;
  // perpetual gauge for rewards distribution
  uint64 gauge_id = 3;
}

// The Osmo-Equivalent-Multiplier Record for epoch N refers to the osmo worth we
// treat an LP share as having, for all of epoch N. Eventually this is intended
// to be set as the Time-weighted-average-osmo-backing for the entire duration
// of epoch N-1. (Thereby locking whats in use for epoch N as based on the prior
// epochs rewards) However for now, this is not the TWAP but instead the spot
// price at the boundary. For different types of assets in the future, it could
// change.
message OsmoEquivalentMultiplierRecord {
  int64 epoch_number = 1;
  // superfluid asset denom, can be LP token or native token
  string denom = 2;
  string multiplier = 3 [
    (gogoproto.moretags) = "yaml:\"multiplier\"",
    (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
    (gogoproto.nullable) = false
  ];
}

// SuperfluidDelegationRecord is a struct used to indicate superfluid
// delegations of an account in the state machine in a user friendly form.
message SuperfluidDelegationRecord {
  string delegator_address = 1;
  string validator_address = 2;
  cosmos.base.v1beta1.Coin delegation_amount = 3 [
    (gogoproto.nullable) = false,
    (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin"
  ];
  cosmos.base.v1beta1.Coin equivalent_staked_amount = 4
      [ (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin" ];
}

// LockIdIntermediaryAccountConnection is a struct used to indicate the
// relationship between the underlying lock id and superfluid delegation done
// via lp shares.
message LockIdIntermediaryAccountConnection {
  uint64 lock_id = 1;
  string intermediary_account = 2;
}

message UnpoolWhitelistedPools { repeated uint64 ids = 1; }
