import BigNumber from 'bignumber.js'; import Web3 from 'web3'; import { Balance, BigNumberable, Fee, Order, Price } from '../lib/types'; import { Contracts } from './Contracts'; import { Orders } from './Orders'; /** * Module for handling orders in an inverse perpetual market. * * Inverse perpetual: * - When isBuy is true, the maker is buying base currency (margin) and selling quote (position). * - The fill amount is denoted in quote currency (position). * - Prices are denoted in quote currency per unit of base currency (position per margin). * - The fee is paid (or received) in base currency (margin). */ export declare class InverseOrders extends Orders { constructor(contracts: Contracts, web3: Web3); /** * Estimate the maker's collateralization after executing a sequence of orders. * * The `maker` of every order must be the same. This function does not make any on-chain calls, * so all information must be passed in, including the oracle price and remaining amounts * on the orders. Orders are assumed to be filled at the limit price and limit fee. * * Returns the ending collateralization ratio for the account, or BigNumber(Infinity) if the * account does not end with any negative balances. * * @param initialBalance The initial margin and position balances of the maker account. * @param oraclePrice The price at which to calculate collateralization. * @param orders A sequence of orders, with the same maker, to be hypothetically filled. * @param fillAmounts The corresponding fill amount for each order, denominated in the token * spent by the maker--quote currency when buying, and base when selling. */ getAccountCollateralizationAfterMakingOrders(initialBalance: Balance, oraclePrice: Price, orders: Order[], makerTokenFillAmounts: BigNumber[]): BigNumber; /** * Calculate the effect of filling an order on the maker's balances. */ getBalanceUpdatesAfterFillingOrder(fillAmount: BigNumberable, fillPrice: Price, fillFee: Fee, isBuy: boolean): { marginDelta: BigNumber; positionDelta: BigNumber; }; getFeeForOrder(amount: BigNumber, isTaker?: boolean): Fee; }