@parifi/sdk
Version:
Parifi SDK with common utility functions
935 lines (930 loc) • 27.6 kB
JavaScript
;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/subgraph/positions/index.ts
var positions_exports = {};
__export(positions_exports, {
getAllOpenPositionsWithTime: () => getAllOpenPositionsWithTime,
getAllPositionHistoryWithTime: () => getAllPositionHistoryWithTime,
getAllPositionsByUserAddress: () => getAllPositionsByUserAddress,
getClosedPositionsByUserAddress: () => getClosedPositionsByUserAddress,
getLiquidatedPositionsByUserAddress: () => getLiquidatedPositionsByUserAddress,
getOpenPositionsByUserAddress: () => getOpenPositionsByUserAddress,
getPositionById: () => getPositionById,
getUserLiquidatedPositionsBySnxAccount: () => getUserLiquidatedPositionsBySnxAccount,
getUserOpenPositionsWithTime: () => getUserOpenPositionsWithTime,
getUserPositionHistoryWithTime: () => getUserPositionHistoryWithTime,
getUserPositionsHistory: () => getUserPositionsHistory
});
module.exports = __toCommonJS(positions_exports);
var import_graphql_request2 = require("graphql-request");
// src/subgraph/positions/subgraphQueries.ts
var import_graphql_request = require("graphql-request");
var fetchPositionsByUserQuery = (userAddress, count = 20, skip = 0) => import_graphql_request.gql`
{
snxAccounts(
first: ${count}
skip: ${skip}
where: { owner: "${userAddress}", type: PERP }) {
id
accountId
owner {
id
}
collateralDeposits {
id
collateralName
collateralSymbol
collateralDecimals
collateralAddress
currentDepositedAmount
totalAmountDeposited
totalAmountWithdrawn
totalAmountLiquidated
}
positions(where: {status_in: [OPEN, CLOSED, LIQUIDATED]}) {
id
market {
id
marketName
marketSymbol
feedId
}
positionSize
avgPrice
avgPriceDec
isLong
createdTimestamp
status
txHash
liquidationTxHash
closingPrice
realizedPositionPnl
realizedPnlAfterFees
totalFeesPaid
createdTimestamp
lastRefresh
lastRefreshISO
canBeLiquidated
snapshotCollateralValueUsd
}
}
}`;
var fetchPositionsByUserQueryAndStatus = (userAddress, status, count = 20, skip = 0) => import_graphql_request.gql`
{
snxAccounts(
first: ${count}
skip: ${skip}
where: { owner: "${userAddress}", type: PERP }
) {
id
accountId
owner {
id
}
collateralDeposits {
id
collateralName
collateralSymbol
collateralDecimals
collateralAddress
currentDepositedAmount
totalAmountDeposited
totalAmountWithdrawn
totalAmountLiquidated
}
positions(where: {status: ${status} }) {
id
market {
id
marketName
marketSymbol
feedId
}
positionSize
avgPrice
avgPriceDec
isLong
createdTimestamp
status
txHash
liquidationTxHash
closingPrice
realizedPositionPnl
realizedPnlAfterFees
totalFeesPaid
createdTimestamp
lastRefresh
lastRefreshISO
canBeLiquidated
snapshotCollateralValueUsd
}
}
}`;
var fetchOpenPositionsByUser = (userAddress, count = 20, skip = 0) => import_graphql_request.gql`
{
snxAccounts(
first: ${count}
skip: ${skip}
where: {
owner: "${userAddress}",
type: PERP,
openPositionCount_gt: 0
}
) {
id
accountId
owner {
id
}
collateralDeposits {
id
collateralName
collateralSymbol
collateralDecimals
collateralAddress
currentDepositedAmount
totalAmountDeposited
totalAmountWithdrawn
totalAmountLiquidated
}
positions(where: {status: OPEN }) {
id
market {
id
marketName
marketSymbol
feedId
}
positionSize
avgPrice
avgPriceDec
isLong
createdTimestamp
status
txHash
liquidationTxHash
closingPrice
realizedPositionPnl
realizedPnlAfterFees
totalFeesPaid
createdTimestamp
lastRefresh
lastRefreshISO
canBeLiquidated
snapshotCollateralValueUsd
}
}
}`;
var fetchUserPositionHistory = (userAddress, count = 20, skip = 0) => import_graphql_request.gql`
{
snxAccounts(
first: ${count}
skip: ${skip}
where: { owner: "${userAddress}", type: PERP }
) {
id
accountId
owner {
id
}
collateralDeposits {
id
collateralName
collateralSymbol
collateralDecimals
collateralAddress
currentDepositedAmount
totalAmountDeposited
totalAmountWithdrawn
totalAmountLiquidated
}
positions(where: {status_in: [CLOSED, LIQUIDATED]}) {
id
market {
id
marketName
marketSymbol
feedId
}
positionSize
avgPrice
avgPriceDec
isLong
createdTimestamp
status
txHash
liquidationTxHash
closingPrice
realizedPositionPnl
realizedPnlAfterFees
totalFeesPaid
createdTimestamp
lastRefresh
lastRefreshISO
canBeLiquidated
snapshotCollateralValueUsd
}
}
}`;
var fetchPositionByIdQuery = (positionId) => import_graphql_request.gql`
{
position(
id: "${positionId}"
) {
id
market {
id,
marketName,
marketSymbol,
feedId
}
snxAccount{
id
accountId
}
isLong
positionSize
avgPrice
avgPriceDec
status
txHash
liquidationTxHash
closingPrice
realizedPositionPnl
realizedPnlAfterFees
totalFeesPaid
createdTimestamp
lastRefresh
lastRefreshISO
canBeLiquidated
snapshotCollateralValueUsd
}
}`;
var fetchUserPositionHistoryWithTime = (userAddress, startTimestamp, endTimestamp, count = 20, skip = 0) => import_graphql_request.gql`
{
snxAccounts(
first: ${count}
skip: ${skip}
where: {
owner: "${userAddress}",
type: PERP
}
) {
id
accountId
owner {
id
}
collateralDeposits {
id
collateralName
collateralSymbol
collateralDecimals
collateralAddress
currentDepositedAmount
totalAmountDeposited
totalAmountWithdrawn
totalAmountLiquidated
}
positions( where: {
status_in: [CLOSED, LIQUIDATED],
createdTimestamp_gte: ${startTimestamp}
createdTimestamp_lte: ${endTimestamp}
}) {
id
market {
id
marketName
marketSymbol
feedId
}
positionSize
positionCollateral
avgPrice
avgPriceDec
isLong
createdTimestamp
status
txHash
liquidationTxHash
closingPrice
realizedPositionPnl
realizedPnlAfterFees
totalFeesPaid
createdTimestamp
lastRefresh
lastRefreshISO
canBeLiquidated
snapshotCollateralValueUsd
}
}
}`;
var fetchUserOpenPositionsWithTime = (userAddress, startTimestamp, endTimestamp, count = 20, skip = 0) => import_graphql_request.gql`
{
snxAccounts(
first: ${count}
skip: ${skip}
where: {
owner: "${userAddress}",
type: PERP,
positions_: {
status: OPEN,
createdTimestamp_gte: ${startTimestamp}
createdTimestamp_lte: ${endTimestamp}
}
}
) {
id
accountId
owner {
id
}
collateralDeposits {
id
collateralName
collateralSymbol
collateralDecimals
collateralAddress
currentDepositedAmount
totalAmountDeposited
totalAmountWithdrawn
totalAmountLiquidated
}
positions {
id
market {
id
marketName
marketSymbol
feedId
}
positionSize
avgPrice
avgPriceDec
isLong
createdTimestamp
status
txHash
liquidationTxHash
closingPrice
realizedPositionPnl
realizedPnlAfterFees
totalFeesPaid
createdTimestamp
lastRefresh
lastRefreshISO
canBeLiquidated
snapshotCollateralValueUsd
}
}
}`;
var fetchLiquidatedPositionsBySnxAccount = (snxAccountId, lastRefresh) => import_graphql_request.gql`
{
snxAccount(id: "${snxAccountId}"
) {
id
accountId
owner {
id
}
collateralDeposits {
id
collateralName
collateralSymbol
collateralDecimals
collateralAddress
currentDepositedAmount
totalAmountDeposited
totalAmountWithdrawn
totalAmountLiquidated
}
positions(where: { status: LIQUIDATED, lastRefresh_gt: ${lastRefresh} }) {
id
market {
id
marketName
marketSymbol
feedId
}
positionSize
avgPrice
avgPriceDec
isLong
createdTimestamp
status
txHash
liquidationTxHash
closingPrice
realizedPositionPnl
realizedPnlAfterFees
totalFeesPaid
createdTimestamp
lastRefresh
lastRefreshISO
canBeLiquidated
snapshotCollateralValueUsd
}
}
}`;
var fetchAllOpenPositionsWithTime = (startTimestamp, endTimestamp, count = 20, skip = 0) => import_graphql_request.gql`
{
snxAccounts(
first: ${count}
skip: ${skip}
where: {
type: PERP
openPositionCount_gt:0
}
) {
id
accountId
owner {
id
}
collateralDeposits {
id
collateralName
collateralSymbol
collateralDecimals
collateralAddress
currentDepositedAmount
totalAmountDeposited
totalAmountWithdrawn
totalAmountLiquidated
}
positions(where: {
status: OPEN,
createdTimestamp_gte: ${startTimestamp}
createdTimestamp_lte: ${endTimestamp}
})
{
id
market {
id
marketName
marketSymbol
feedId
}
positionSize
avgPrice
avgPriceDec
isLong
createdTimestamp
status
txHash
liquidationTxHash
closingPrice
realizedPositionPnl
realizedPnlAfterFees
totalFeesPaid
createdTimestamp
lastRefresh
lastRefreshISO
canBeLiquidated
snapshotCollateralValueUsd
}
}
}`;
var fetchAllPositionHistoryWithTime = (startTimestamp, endTimestamp, count = 20, skip = 0) => import_graphql_request.gql`
{
snxAccounts(
first: ${count}
skip: ${skip}
where: {
type: PERP
totalPositionsCount_gt :0
}
) {
id
accountId
owner {
id
}
collateralDeposits {
id
collateralName
collateralSymbol
collateralDecimals
collateralAddress
currentDepositedAmount
totalAmountDeposited
totalAmountWithdrawn
totalAmountLiquidated
}
positions(where: {
status_in: [CLOSED, LIQUIDATED],
createdTimestamp_gte: ${startTimestamp}
createdTimestamp_lte: ${endTimestamp}
}) {
id
market {
id
marketName
marketSymbol
feedId
}
positionSize
avgPrice
avgPriceDec
isLong
createdTimestamp
status
txHash
liquidationTxHash
closingPrice
realizedPositionPnl
realizedPnlAfterFees
totalFeesPaid
createdTimestamp
lastRefresh
lastRefreshISO
canBeLiquidated
snapshotCollateralValueUsd
}
}
}`;
// src/error/not-found.error.ts
var NotFoundError = class extends Error {
constructor(message) {
super(message);
this.name = this.constructor.name;
}
};
// src/common/subgraphMapper.ts
var mapResponseToWallet = (response) => {
if (!response) return void 0;
try {
return {
id: response?.id
// snxAccounts: mapSnxAccountsArray(response.snxAccounts)
};
} catch (error) {
console.log("Error while mapping data", error);
return void 0;
}
};
var mapResponseToSnxAccount = (response) => {
if (!response) return void 0;
try {
return {
id: response?.id,
type: response?.type,
accountId: response?.accountId,
owner: response?.owner ?? mapResponseToWallet(response?.owner),
totalOrdersCount: response?.totalOrdersCount,
totalPositionsCount: response?.totalPositionsCount,
openPositionCount: response?.openPositionCount,
countProfitablePositions: response?.countProfitablePositions,
countLossPositions: response?.countLossPositions,
countLiquidatedPositions: response?.countLiquidatedPositions,
realizedPnlFromPositions: response?.realizedPnlFromPositions,
totalFeesPaid: response?.totalFeesPaid,
finalPnlAfterFees: response?.finalPnlAfterFees,
totalVolumeInUsd: response?.totalVolumeInUsd,
totalAccruedBorrowingFeesInUsd: response?.totalAccruedBorrowingFeesInUsd,
integratorFeesGenerated: response?.integratorFeesGenerated,
orders: response?.orders ? mapResponseToOrderArray(response?.orders) : [],
positions: response?.positions ? mapResponseToPositionArray(response?.positions) : [],
collateralDeposits: response?.collateralDeposits ? mapResponseToCollateralDepositArray(response?.collateralDeposits) : []
};
} catch (error) {
console.log("Error while mapping data", error);
return void 0;
}
};
var mapResponseToSnxAccountArray = (response) => {
if (!response) return void 0;
try {
return response.map((snxAccount) => {
return mapResponseToSnxAccount(snxAccount);
});
} catch (error) {
console.log("Error while mapping data", error);
return void 0;
}
};
var mapResponseToMarket = (response) => {
if (!response) return void 0;
if (response?.marketName === "" || response?.marketSymbol === "") return void 0;
try {
return {
id: response?.id ?? "",
marketName: response?.marketName ?? "",
marketSymbol: response?.marketSymbol ?? "",
feedId: response?.feedId ?? "",
skew: response?.skew ?? "0",
size: response?.size ?? "0",
maxOpenInterest: response?.maxOpenInterest ?? "0",
interestRate: response?.interestRate ?? "0",
currentFundingRate: response?.currentFundingRate ?? "0",
currentFundingVelocity: response?.currentFundingVelocity ?? "0",
indexPrice: response?.indexPrice ?? "0",
skewScale: response?.skewScale ?? "0",
maxFundingVelocity: response?.maxFundingVelocity ?? "0",
makerFee: response?.makerFee ?? "0",
takerFee: response?.takerFee ?? "0",
maxMarketValue: response?.maxMarketValue ?? "0",
maxMarketSize: response?.maxMarketSize ?? "0",
marketPrice: response?.marketPrice ?? "0",
initialMarginRatioD18: response?.initialMarginRatioD18 ?? "0",
maintenanceMarginRatioD18: response?.maintenanceMarginRatioD18 ?? "0",
minimumInitialMarginRatioD18: response?.minimumInitialMarginRatioD18 ?? "0",
flagRewardRatioD18: response?.flagRewardRatioD18 ?? "0",
minimumPositionMargin: response?.minimumPositionMargin ?? "0",
openInterestUsd: response?.openInterestUsd ?? "0"
};
} catch (error) {
console.log("Error while mapping data", error);
return void 0;
}
};
var mapResponseToOrder = (response) => {
if (!response) return void 0;
try {
return {
id: response?.id,
market: response?.market ?? mapResponseToMarket(response?.market),
snxAccountId: response?.snxAccount?.id,
isLimitOrder: response?.isLimitOrder,
acceptablePrice: response?.acceptablePrice,
commitmentTime: response?.commitmentTime,
expectedPriceTime: response?.expectedPriceTime,
settlementTime: response?.settlementTime,
expirationTime: response?.expirationTime,
trackingCode: response?.trackingCode,
deltaSize: response?.deltaSize,
deltaSizeUsd: response?.deltaSizeUsd,
executionPrice: response?.executionPrice,
collectedFees: response?.collectedFees,
settlementReward: response?.settlementReward,
referralFees: response?.referralFees,
partnerAddress: response?.partnerAddress,
txHash: response?.txHash,
createdTimestamp: response?.createdTimestamp,
status: response?.status,
settledTxHash: response?.settledTxHash,
cancellationTxHash: response?.cancellationTxHash,
settledTimestamp: response?.settledTimestamp,
settledTimestampISO: response?.settledTimestampISO,
settledBy: response?.settledBy ?? mapResponseToWallet(response?.settledBy),
snapshotCollateralValueUsd: response?.snapshotCollateralValueUsd
};
} catch (error) {
console.log("Error while mapping data", error);
return void 0;
}
};
var mapResponseToOrderArray = (response) => {
if (!response) return void 0;
try {
return response.map((order) => {
return mapResponseToOrder(order);
});
} catch (error) {
console.log("Error while mapping data", error);
return void 0;
}
};
function mapResponseToCollateralDeposit(response) {
if (!response) return void 0;
try {
return {
id: response?.id,
snxAccountId: response?.snxAccountId,
collateralId: response?.collateralId,
collateralName: response?.collateralName,
collateralSymbol: response?.collateralSymbol,
collateralDecimals: response?.collateralDecimals,
collateralAddress: response?.collateralAddress,
currentDepositedAmount: response?.currentDepositedAmount,
totalAmountDeposited: response?.totalAmountDeposited,
totalAmountWithdrawn: response?.totalAmountWithdrawn,
totalAmountLiquidated: response?.totalAmountLiquidated
};
} catch (error) {
console.log("Error while mapping data", error);
return void 0;
}
}
var mapResponseToCollateralDepositArray = (response) => {
if (!response) return void 0;
try {
return response.map((deposit) => {
return mapResponseToCollateralDeposit(deposit);
});
} catch (error) {
console.log("Error while mapping data", error);
return void 0;
}
};
var mapResponseToPosition = (response) => {
if (!response) return void 0;
try {
return {
id: response?.id,
market: response?.market ?? mapResponseToMarket(response?.market),
snxAccountId: response?.snxAccountId,
isLong: response?.isLong,
positionSize: response?.positionSize,
avgPrice: response?.avgPrice,
avgPriceDec: response?.avgPriceDec,
status: response?.status,
txHash: response?.txHash,
liquidationTxHash: response?.liquidationTxHash,
closingPrice: response?.closingPrice,
realizedPositionPnl: response?.realizedPositionPnl,
totalFeesPaid: response?.totalFeesPaid,
realizedPnlAfterFees: response?.realizedPnlAfterFees,
createdTimestamp: response?.createdTimestamp,
lastRefresh: response?.lastRefresh,
lastRefreshISO: response?.lastRefreshISO,
accruedBorrowingFees: response?.accruedBorrowingFees,
canBeLiquidated: response?.canBeLiquidated,
snapshotCollateralValueUsd: response?.snapshotCollateralValueUsd
};
} catch (error) {
console.log("Error while mapping data", error);
return void 0;
}
};
var mapResponseToPositionArray = (response) => {
if (!response) return void 0;
try {
return response.map((position) => {
return mapResponseToPosition(position);
});
} catch (error) {
console.log("Error while mapping data", error);
return void 0;
}
};
// src/subgraph/positions/index.ts
var getAllPositionsByUserAddress = async (subgraphEndpoint, userAddress, count = 10, skip = 0) => {
try {
const subgraphResponse = await (0, import_graphql_request2.request)(subgraphEndpoint, fetchPositionsByUserQuery(userAddress, count, skip));
const snxAccounts = mapResponseToSnxAccountArray(subgraphResponse?.snxAccounts);
return snxAccounts ?? [];
} catch (error) {
console.error("Error fetching positions:", error);
return [];
}
};
var getOpenPositionsByUserAddress = async (subgraphEndpoint, userAddress, count = 10, skip = 0) => {
try {
const subgraphResponse = await (0, import_graphql_request2.request)(subgraphEndpoint, fetchOpenPositionsByUser(userAddress, count, skip));
const snxAccounts = mapResponseToSnxAccountArray(subgraphResponse?.snxAccounts);
return snxAccounts ?? [];
} catch (error) {
console.error("Error fetching positions:", error);
return [];
}
};
var getClosedPositionsByUserAddress = async (subgraphEndpoint, userAddress, count = 10, skip = 0) => {
try {
const subgraphResponse = await (0, import_graphql_request2.request)(
subgraphEndpoint,
fetchPositionsByUserQueryAndStatus(userAddress, "CLOSED", count, skip)
);
const snxAccounts = mapResponseToSnxAccountArray(subgraphResponse?.snxAccounts);
return snxAccounts ?? [];
} catch (error) {
console.error("Error fetching positions:", error);
return [];
}
};
var getLiquidatedPositionsByUserAddress = async (subgraphEndpoint, userAddress, count = 10, skip = 0) => {
try {
const subgraphResponse = await (0, import_graphql_request2.request)(
subgraphEndpoint,
fetchPositionsByUserQueryAndStatus(userAddress, "LIQUIDATED", count, skip)
);
const snxAccounts = mapResponseToSnxAccountArray(subgraphResponse?.snxAccounts);
return snxAccounts ?? [];
} catch (error) {
console.error("Error fetching positions:", error);
return [];
}
};
var getPositionById = async (subgraphEndpoint, positionId) => {
try {
let subgraphResponse = await (0, import_graphql_request2.request)(subgraphEndpoint, fetchPositionByIdQuery(positionId));
console.log("subgraph response:", subgraphResponse);
const position = mapResponseToPosition(subgraphResponse?.position);
if (position) return position;
throw new NotFoundError("Position id not found");
} catch (error) {
console.error("Error fetching position:", error);
throw new NotFoundError("Position id not found");
}
};
var getUserPositionsHistory = async (subgraphEndpoint, userAddress, count = 100, skip = 0) => {
try {
const subgraphResponse = await (0, import_graphql_request2.request)(subgraphEndpoint, fetchUserPositionHistory(userAddress, count, skip));
const snxAccounts = mapResponseToSnxAccountArray(subgraphResponse?.snxAccounts);
return snxAccounts ?? [];
} catch (error) {
console.error("Error fetching positions:", error);
return [];
}
};
var getUserPositionHistoryWithTime = async (subgraphEndpoint, userAddress, startTime, endTime, count = 100, skip = 0) => {
try {
const subgraphResponse = await (0, import_graphql_request2.request)(
subgraphEndpoint,
fetchUserPositionHistoryWithTime(userAddress, startTime, endTime, count, skip)
);
const snxAccounts = mapResponseToSnxAccountArray(subgraphResponse?.snxAccounts);
return snxAccounts ?? [];
} catch (error) {
console.error("Error fetching positions:", error);
return [];
}
};
var getUserOpenPositionsWithTime = async (subgraphEndpoint, userAddress, startTime, endTime, count = 10, skip = 0) => {
try {
const subgraphResponse = await (0, import_graphql_request2.request)(
subgraphEndpoint,
fetchUserOpenPositionsWithTime(userAddress, startTime, endTime, count, skip)
);
const snxAccounts = mapResponseToSnxAccountArray(subgraphResponse?.snxAccounts);
return snxAccounts ?? [];
} catch (error) {
console.error("Error fetching positions:", error);
return [];
}
};
var getUserLiquidatedPositionsBySnxAccount = async (subgraphEndpoint, snxAccountId, lastRefresh) => {
let formattedSnxAccountId = snxAccountId;
try {
if (!snxAccountId.includes("PERP")) {
formattedSnxAccountId = "PERP-".concat(snxAccountId);
}
const subgraphResponse = await (0, import_graphql_request2.request)(
subgraphEndpoint,
fetchLiquidatedPositionsBySnxAccount(formattedSnxAccountId, lastRefresh)
);
const snxAccount = mapResponseToSnxAccount(subgraphResponse?.snxAccount);
return snxAccount;
} catch (error) {
console.error("Error fetching positions:", error);
return void 0;
}
};
var getAllOpenPositionsWithTime = async (subgraphEndpoint, startTime, endTime, count = 10, skip = 0) => {
try {
const subgraphResponse = await (0, import_graphql_request2.request)(
subgraphEndpoint,
fetchAllOpenPositionsWithTime(startTime, endTime, count, skip)
);
console.log("subgraphresponse", subgraphResponse);
const snxAccounts = mapResponseToSnxAccountArray(subgraphResponse?.snxAccounts);
return snxAccounts ?? [];
} catch (error) {
console.error("Error fetching positions:", error);
return [];
}
};
var getAllPositionHistoryWithTime = async (subgraphEndpoint, startTime, endTime, count = 100, skip = 0) => {
try {
const subgraphResponse = await (0, import_graphql_request2.request)(
subgraphEndpoint,
fetchAllPositionHistoryWithTime(startTime, endTime, count, skip)
);
const snxAccounts = mapResponseToSnxAccountArray(subgraphResponse?.snxAccounts);
return snxAccounts ?? [];
} catch (error) {
console.error("Error fetching positions:", error);
return [];
}
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
getAllOpenPositionsWithTime,
getAllPositionHistoryWithTime,
getAllPositionsByUserAddress,
getClosedPositionsByUserAddress,
getLiquidatedPositionsByUserAddress,
getOpenPositionsByUserAddress,
getPositionById,
getUserLiquidatedPositionsBySnxAccount,
getUserOpenPositionsWithTime,
getUserPositionHistoryWithTime,
getUserPositionsHistory
});
//# sourceMappingURL=index.js.map