syntax = "proto3";

package orders;

message Positions {}

message DeleteOrders {
  string mint = 1;
  repeated int64 ids = 2;
}
message PlaceLimitOrdersResponce {
  uint32 token_orders_num = 1;
  repeated int64 ids=2;
}

message TokenLimitOrders {
  string mint = 1;
  repeated ApiOrder orders =2;
}

message ApiOrder {
  optional int64 id = 1;
  uint32 slippage_bps = 2;
  uint64 tip = 3;
  Target target = 4;
  Side side = 5;
  Amount amount = 6;
  Trigger trigger =7;
}
enum Trigger {
  IMMEDIATE =0;
  MIGRATION =1;
}

message Target {
  oneof target_type {
      TargetPrice price = 1;
      TargetProfit profit = 2;
      TargetMovingPerc moving_perc = 3;
      Market market = 4;
  }
}

message TargetPrice {
  float price = 1;
  Direction direction = 2;
}

message TargetProfit {
  float profit_perc = 1;
  Direction direction = 2;
}

message TargetMovingPerc {
  float price_perc = 1;
  optional float local_ath = 2;
  Direction direction = 3;
}

message Market {}

enum Side {
  BUY = 0;
  SELL = 1;
}

enum Direction {
  ABOVE = 0;
  BELOW = 1;
}

message Amount {
  oneof amount_type {
      uint32 perc_bps = 1;
      uint64 fixed = 2;
  }
}



