io.contek.invoker.bybit.api.websocket.user.PositionChannel Maven / Gradle / Ivy
The newest version!
package io.contek.invoker.bybit.api.websocket.user;
import io.contek.invoker.bybit.api.websocket.WebSocketChannel;
import io.contek.invoker.bybit.api.websocket.WebSocketChannelId;
import io.contek.invoker.bybit.api.websocket.WebSocketRequestIdGenerator;
import io.contek.invoker.bybit.api.websocket.common.WebSocketTopicMessage;
import javax.annotation.Nullable;
import javax.annotation.concurrent.Immutable;
import javax.annotation.concurrent.NotThreadSafe;
import javax.annotation.concurrent.ThreadSafe;
import java.util.ArrayList;
@ThreadSafe
public final class PositionChannel extends WebSocketChannel {
PositionChannel(Id id, WebSocketRequestIdGenerator requestIdGenerator) {
super(id, requestIdGenerator);
}
@Override
public Class getMessageType() {
return Message.class;
}
@Immutable
public static final class Id extends WebSocketChannelId {
private Id(String topic) {
super(topic);
}
public static Id of(@Nullable String category) {
return category == null ? new Id("position") : new Id(String.format("position.%s", category));
}
}
@NotThreadSafe
public static final class Message extends WebSocketTopicMessage {}
@NotThreadSafe
public static final class Data extends ArrayList {}
@NotThreadSafe
public static final class Position {
public Integer positionIdx;
public Integer tradeMode;
public Integer riskId;
public String riskLimitValue;
public String symbol;
public String side;
public String size;
public String entryPrice;
public String leverage;
public String positionValue;
public String positionBalance;
public String markPrice;
public String positionIM;
public String positionMM;
public String takeProfit;
public String stopLoss;
public String trailingStop;
public String unrealisedPnl;
public String cumRealisedPnl;
public String createdTime;
public String updatedTime;
public String tpslMode;
public String liqPrice;
public String bustPrice;
public String category;
public String positionStatus;
public Integer adlRankIndicator;
public Integer autoAddMargin;
public String leverageSysUpdatedTime;
public String mmrSysUpdatedTime;
public Integer seq;
public Boolean isReduceOnly;
}
}