equation-sdk
Version:
🛠An SDK for building applications on top of Equation.
37 lines (36 loc) • 1.5 kB
TypeScript
/**
* @module modules/markets
* @description Represents a PositionRouter.
*/
import { Contract, Wallet } from 'ethers';
import { Side } from '../config';
import Approval from "./Approval";
export default class PositionRouter {
provider: Wallet;
positionRouterContract: Contract;
positionMinExecutionFee: string;
slippage: string;
approval: Approval;
constructor(provider: Wallet, slippage?: string);
executionFee(): Promise<void>;
approvalPosition(): Promise<void>;
/**
* Create open or increase the size of existing position request
*
* @param market - The market in which to increase position
* @param side - The side of the position (Long or Short)
* @param marginDelta - The increase in position margin
* @param sizeDelta - TThe increase in position size
* @returns A Promise that resolves to the result of creating the increased position.
*/
createIncreasePosition(market: string, side: Side, marginDelta: string, sizeDelta: string): Promise<any>;
/**
* Create decrease position request
*
* @param market - The market in which to decrease position
* @param side - The side of the position (Long or Short)
* @param sizeDelta - The decrease in position size
* @returns A Promise that resolves to the result of creating the decreased position.
*/
createDecreasePosition(market: string, side: Side, sizeDelta: string): Promise<any>;
}