diff --git a/app/package.json b/app/package.json
index eb7acdf..6454ebf 100644
--- a/app/package.json
+++ b/app/package.json
@@ -25,6 +25,7 @@
"@ethersproject/providers": "^5.7.2",
"@ethersproject/units": "^5.7.0",
"@lyrafinance/lyra-js": "^0.0.26",
+ "api": "6.1.1",
"axios": "^1.3.2",
"cross-fetch": "^3.1.5",
"dayjs": "^1.11.7",
@@ -33,10 +34,12 @@
"ethers": "5.6.0",
"graphql": "^16.6.0",
"graphql-tag": "^2.12.6",
+ "json-schema-to-ts": "2.8.0-beta.0",
"lodash": "^4.17.21",
"moment": "^2.29.4",
"node-schedule": "^2.1.1",
"nullthrows": "^1.1.1",
+ "oas": "20.10.3",
"react": "^18.2.0",
"rimraf": "^4.1.2",
"rpc-websocket-client": "^1.1.4",
diff --git a/app/src/api/index.ts b/app/src/api/index.ts
new file mode 100644
index 0000000..7ea2a89
--- /dev/null
+++ b/app/src/api/index.ts
@@ -0,0 +1,839 @@
+import type * as types from './types'
+import type { ConfigOptions, FetchResponse } from 'api/dist/core'
+import Oas from 'oas'
+import APICore from 'api/dist/core'
+import definition from './openapi.json'
+
+class SDK {
+ spec: Oas
+ core: APICore
+
+ constructor() {
+ this.spec = Oas.init(definition)
+ this.core = new APICore(this.spec, 'lyra-api/1.0.0 (api/6.1.1)')
+ }
+
+ /**
+ * Optionally configure various options that the SDK allows.
+ *
+ * @param config Object of supported SDK options and toggles.
+ * @param config.timeout Override the default `fetch` request timeout of 30 seconds. This number
+ * should be represented in milliseconds.
+ */
+ config(config: ConfigOptions) {
+ this.core.setConfig(config)
+ }
+
+ /**
+ * If the API you're using requires authentication you can supply the required credentials
+ * through this method and the library will magically determine how they should be used
+ * within your API request.
+ *
+ * With the exception of OpenID and MutualTLS, it supports all forms of authentication
+ * supported by the OpenAPI specification.
+ *
+ * @example
HTTP Basic auth
+ * sdk.auth('username', 'password');
+ *
+ * @example Bearer tokens (HTTP or OAuth 2)
+ * sdk.auth('myBearerToken');
+ *
+ * @example API Keys
+ * sdk.auth('myApiKey');
+ *
+ * @see {@link https://spec.openapis.org/oas/v3.0.3#fixed-fields-22}
+ * @see {@link https://spec.openapis.org/oas/v3.1.0#fixed-fields-22}
+ * @param values Your auth credentials for the API; can specify up to two strings or numbers.
+ */
+ auth(...values: string[] | number[]) {
+ this.core.setAuth(...values)
+ return this
+ }
+
+ /**
+ * If the API you're using offers alternate server URLs, and server variables, you can tell
+ * the SDK which one to use with this method. To use it you can supply either one of the
+ * server URLs that are contained within the OpenAPI definition (along with any server
+ * variables), or you can pass it a fully qualified URL to use (that may or may not exist
+ * within the OpenAPI definition).
+ *
+ * @example Server URL with server variables
+ * sdk.server('https://{region}.api.example.com/{basePath}', {
+ * name: 'eu',
+ * basePath: 'v14',
+ * });
+ *
+ * @example Fully qualified server URL
+ * sdk.server('https://eu.api.example.com/v14');
+ *
+ * @param url Server URL
+ * @param variables An object of variables to replace into the server URL.
+ */
+ server(url: string, variables = {}) {
+ this.core.setServer(url, variables)
+ }
+
+ /**
+ * Create a new account
+ *
+ * @summary Create Account
+ */
+ // tsignore
+ postPublicCreate_account(
+ body: types.PostPublicCreateAccountBodyParam,
+ ): Promise> {
+ return this.core.fetch('/public/create_account', 'post', body)
+ }
+
+ /**
+ * Build a signable transaction params dictionary.
+ *
+ * @summary Build Register Session Key Tx
+ */
+ postPublicBuild_register_session_key_tx(
+ body: types.PostPublicBuildRegisterSessionKeyTxBodyParam,
+ ): Promise> {
+ return this.core.fetch('/public/build_register_session_key_tx', 'post', body)
+ }
+
+ /**
+ * Register or update expiry of an existing session key.
+ *
+ * @summary Register Session Key
+ */
+ postPublicRegister_session_key(
+ body: types.PostPublicRegisterSessionKeyBodyParam,
+ ): Promise> {
+ return this.core.fetch('/public/register_session_key', 'post', body)
+ }
+
+ /**
+ * Deregister Session Key
+ *
+ */
+ postPublicDeregister_session_key(
+ body: types.PostPublicDeregisterSessionKeyBodyParam,
+ ): Promise> {
+ return this.core.fetch('/public/deregister_session_key', 'post', body)
+ }
+
+ /**
+ * Authenticate a websocket connection. Unavailable via HTTP.
+ *
+ * @summary Login
+ */
+ postPublicLogin(body: types.PostPublicLoginBodyParam): Promise> {
+ return this.core.fetch('/public/login', 'post', body)
+ }
+
+ /**
+ * Get single instrument by asset name
+ *
+ * @summary Get Instrument
+ */
+ postPublicGet_instrument(
+ body: types.PostPublicGetInstrumentBodyParam,
+ ): Promise> {
+ return this.core.fetch('/public/get_instrument', 'post', body)
+ }
+
+ /**
+ * Get all active instruments for a given `currency` and `type`
+ *
+ * @summary Get Instruments
+ */
+ postPublicGet_instruments(
+ body: types.PostPublicGetInstrumentsBodyParam,
+ ): Promise> {
+ return this.core.fetch('/public/get_instruments', 'post', body)
+ }
+
+ /**
+ * Get all active instrument tickers for a given `currency` and `type`
+ *
+ * @summary Get Ticker
+ */
+ postPublicGet_ticker(
+ body: types.PostPublicGetTickerBodyParam,
+ ): Promise> {
+ return this.core.fetch('/public/get_ticker', 'post', body)
+ }
+
+ /**
+ * Get latest signed data feeds
+ *
+ * @summary Get Latest Signed Feeds
+ */
+ postPublicGet_latest_signed_feeds(
+ body: types.PostPublicGetLatestSignedFeedsBodyParam,
+ ): Promise> {
+ return this.core.fetch('/public/get_latest_signed_feeds', 'post', body)
+ }
+
+ /**
+ * Get spot feed history by currency
+ *
+ * @summary Get Spot Feed History
+ */
+ postPublicGet_spot_feed_history(
+ body: types.PostPublicGetSpotFeedHistoryBodyParam,
+ ): Promise> {
+ return this.core.fetch('/public/get_spot_feed_history', 'post', body)
+ }
+
+ /**
+ * Get trade history for a subaccount, with filter parameters.
+ *
+ * @summary Get Trade History
+ */
+ postPublicGet_trade_history(
+ body: types.PostPublicGetTradeHistoryBodyParam,
+ ): Promise> {
+ return this.core.fetch('/public/get_trade_history', 'post', body)
+ }
+
+ /**
+ * Used for getting a transaction by its transaction id
+ *
+ * @summary Get Transaction
+ */
+ postPublicGet_transaction(
+ body: types.PostPublicGetTransactionBodyParam,
+ ): Promise> {
+ return this.core.fetch('/public/get_transaction', 'post', body)
+ }
+
+ /**
+ * Calculates margin for a given portfolio and (optionally) a simulated state change. Does
+ * not take into account
+ * open orders margin requirements.
+ *
+ * @summary Get Margin
+ */
+ postPublicGet_margin(
+ body: types.PostPublicGetMarginBodyParam,
+ ): Promise> {
+ return this.core.fetch('/public/get_margin', 'post', body)
+ }
+
+ /**
+ * Calculates MtM and maintenance margin for a given subaccount.
+ *
+ * @summary Margin Watch
+ */
+ postPublicMargin_watch(
+ body: types.PostPublicMarginWatchBodyParam,
+ ): Promise> {
+ return this.core.fetch('/public/margin_watch', 'post', body)
+ }
+
+ /**
+ * Account details getter
+ *
+ * @summary Get Account
+ */
+ postPrivateGet_account(
+ body: types.PostPrivateGetAccountBodyParam,
+ ): Promise> {
+ return this.core.fetch('/private/get_account', 'post', body)
+ }
+
+ /**
+ * Create a new subaccount under a given wallet, and deposit an asset into that subaccount.
+ *
+ * @summary Create Subaccount
+ */
+ postPrivateCreate_subaccount(
+ body: types.PostPrivateCreateSubaccountBodyParam,
+ ): Promise> {
+ return this.core.fetch('/private/create_subaccount', 'post', body)
+ }
+
+ /**
+ * Used for debugging only, do not use in production. Will return the incremental encoded
+ * and hashed data.
+ *
+ * @summary Create Subaccount Debug
+ */
+ postPublicCreate_subaccount_debug(
+ body: types.PostPublicCreateSubaccountDebugBodyParam,
+ ): Promise> {
+ return this.core.fetch('/public/create_subaccount_debug', 'post', body)
+ }
+
+ /**
+ * Get open orders, active positions, and collaterals of a subaccount
+ *
+ * @summary Get Subaccount
+ */
+ postPrivateGet_subaccount(
+ body: types.PostPrivateGetSubaccountBodyParam,
+ ): Promise> {
+ return this.core.fetch('/private/get_subaccount', 'post', body)
+ }
+
+ /**
+ * Get all subaccounts of an account / wallet
+ *
+ * @summary Get Subaccounts
+ */
+ postPrivateGet_subaccounts(
+ body: types.PostPrivateGetSubaccountsBodyParam,
+ ): Promise> {
+ return this.core.fetch('/private/get_subaccounts', 'post', body)
+ }
+
+ /**
+ * Change a user defined label for given subaccount
+ *
+ * @summary Change Subaccount Label
+ */
+ postPrivateChange_subaccount_label(
+ body: types.PostPrivateChangeSubaccountLabelBodyParam,
+ ): Promise> {
+ return this.core.fetch('/private/change_subaccount_label', 'post', body)
+ }
+
+ /**
+ * Get the notifications related to a subaccount.
+ *
+ * @summary Get Notifications
+ */
+ postPrivateGet_notifications(
+ body: types.PostPrivateGetNotificationsBodyParam,
+ ): Promise> {
+ return this.core.fetch('/private/get_notifications', 'post', body)
+ }
+
+ /**
+ * RPC to mark specified notifications as seen for a given subaccount.
+ *
+ * @summary Update Notifications
+ */
+ postPrivateUpdate_notifications(
+ body: types.PostPrivateUpdateNotificationsBodyParam,
+ ): Promise> {
+ return this.core.fetch('/private/update_notifications', 'post', body)
+ }
+
+ /**
+ * Deposit an asset to a subaccount.
+ *
+ * @summary Deposit
+ */
+ postPrivateDeposit(
+ body: types.PostPrivateDepositBodyParam,
+ ): Promise> {
+ return this.core.fetch('/private/deposit', 'post', body)
+ }
+
+ /**
+ * Withdraw an asset to wallet.
+ *
+ * @summary Withdraw
+ */
+ postPrivateWithdraw(
+ body: types.PostPrivateWithdrawBodyParam,
+ ): Promise> {
+ return this.core.fetch('/private/withdraw', 'post', body)
+ }
+
+ /**
+ * Transfer ERC20 assets from one subaccount to another (e.g. USDC or ETH).
+ *
+ * For transfering positions (e.g. options or perps), use `private/transfer_position`
+ * instead.
+ *
+ * @summary Transfer Erc20
+ */
+ postPrivateTransfer_erc20(
+ body: types.PostPrivateTransferErc20BodyParam,
+ ): Promise> {
+ return this.core.fetch('/private/transfer_erc20', 'post', body)
+ }
+
+ /**
+ * Transfers a positions from one subaccount to another, owned by the same wallet.
+ *
+ * The transfer is executed as a pair of orders crossing each other.
+ * The maker order is created first, followed by a taker order crossing it.
+ * The order amounts, limit prices and instrument name must be the same for both orders.
+ * Fee is not charged and a zero `max_fee` must be signed.
+ * The maker order is forcibly considered to be `reduce_only`, meaning it can only reduce
+ * the position size.
+ *
+ * History: For position transfer history, use the `private/get_trade_history` RPC (not
+ * `private/get_erc20_transfer_history`).
+ *
+ * @summary Transfer Position
+ */
+ postPrivateTransfer_position(
+ body: types.PostPrivateTransferPositionBodyParam,
+ ): Promise> {
+ return this.core.fetch('/private/transfer_position', 'post', body)
+ }
+
+ /**
+ * Create a new order
+ *
+ * @summary Order
+ */
+ postPrivateOrder(
+ body: types.PostPrivateOrderBodyParam,
+ ): Promise> {
+ return this.core.fetch('/private/order', 'post', body)
+ }
+
+ /**
+ * Debug a new order
+ *
+ * @summary Order Debug
+ */
+ postPrivateOrder_debug(
+ body: types.PostPrivateOrderDebugBodyParam,
+ ): Promise> {
+ return this.core.fetch('/private/order_debug', 'post', body)
+ }
+
+ /**
+ * Get state of an order by order id
+ *
+ * @summary Get Order
+ */
+ postPrivateGet_order(
+ body: types.PostPrivateGetOrderBodyParam,
+ ): Promise> {
+ return this.core.fetch('/private/get_order', 'post', body)
+ }
+
+ /**
+ * Get orders for a subaccount, with optional filtering.
+ *
+ * @summary Get Orders
+ */
+ postPrivateGet_orders(
+ body: types.PostPrivateGetOrdersBodyParam,
+ ): Promise> {
+ return this.core.fetch('/private/get_orders', 'post', body)
+ }
+
+ /**
+ * Get all open orders of a subacccount
+ *
+ * @summary Get Open Orders
+ */
+ postPrivateGet_open_orders(
+ body: types.PostPrivateGetOpenOrdersBodyParam,
+ ): Promise> {
+ return this.core.fetch('/private/get_open_orders', 'post', body)
+ }
+
+ /**
+ * Cancel a single order.
+ *
+ * @summary Cancel
+ */
+ postPrivateCancel(
+ body: types.PostPrivateCancelBodyParam,
+ ): Promise> {
+ return this.core.fetch('/private/cancel', 'post', body)
+ }
+
+ /**
+ * Cancel all open orders for a given subaccount and a given label.
+ *
+ * @summary Cancel By Label
+ */
+ postPrivateCancel_by_label(
+ body: types.PostPrivateCancelByLabelBodyParam,
+ ): Promise> {
+ return this.core.fetch('/private/cancel_by_label', 'post', body)
+ }
+
+ /**
+ * Cancel an order with a given subaccount and a given nonce.
+ *
+ * @summary Cancel By Nonce
+ */
+ postPrivateCancel_by_nonce(
+ body: types.PostPrivateCancelByNonceBodyParam,
+ ): Promise> {
+ return this.core.fetch('/private/cancel_by_nonce', 'post', body)
+ }
+
+ /**
+ * Cancel all open orders for a given subaccount and a given instrument.
+ *
+ * @summary Cancel By Instrument
+ */
+ postPrivateCancel_by_instrument(
+ body: types.PostPrivateCancelByInstrumentBodyParam,
+ ): Promise> {
+ return this.core.fetch('/private/cancel_by_instrument', 'post', body)
+ }
+
+ /**
+ * Cancel all open orders for a given subaccount.
+ *
+ * @summary Cancel All
+ */
+ postPrivateCancel_all(
+ body: types.PostPrivateCancelAllBodyParam,
+ ): Promise> {
+ return this.core.fetch('/private/cancel_all', 'post', body)
+ }
+
+ /**
+ * Get order history for a subaccount
+ *
+ * @summary Get Order History
+ */
+ postPrivateGet_order_history(
+ body: types.PostPrivateGetOrderHistoryBodyParam,
+ ): Promise> {
+ return this.core.fetch('/private/get_order_history', 'post', body)
+ }
+
+ /**
+ * Get trade history for a subaccount, with filter parameters.
+ *
+ * @summary Get Trade History
+ */
+ postPrivateGet_trade_history(
+ body: types.PostPrivateGetTradeHistoryBodyParam,
+ ): Promise> {
+ return this.core.fetch('/private/get_trade_history', 'post', body)
+ }
+
+ /**
+ * Get subaccount deposit history.
+ *
+ * @summary Get Deposit History
+ */
+ postPrivateGet_deposit_history(
+ body: types.PostPrivateGetDepositHistoryBodyParam,
+ ): Promise> {
+ return this.core.fetch('/private/get_deposit_history', 'post', body)
+ }
+
+ /**
+ * Get subaccount withdrawal history.
+ *
+ * @summary Get Withdrawal History
+ */
+ postPrivateGet_withdrawal_history(
+ body: types.PostPrivateGetWithdrawalHistoryBodyParam,
+ ): Promise> {
+ return this.core.fetch('/private/get_withdrawal_history', 'post', body)
+ }
+
+ /**
+ * Calculates margin for a given subaccount and (optionally) a simulated state change. Does
+ * not take into account
+ * open orders margin requirements.
+ *
+ * @summary Get Margin
+ */
+ postPrivateGet_margin(
+ body: types.PostPrivateGetMarginBodyParam,
+ ): Promise> {
+ return this.core.fetch('/private/get_margin', 'post', body)
+ }
+
+ /**
+ * Get collaterals of a subaccount
+ *
+ * @summary Get Collaterals
+ */
+ postPrivateGet_collaterals(
+ body: types.PostPrivateGetCollateralsBodyParam,
+ ): Promise> {
+ return this.core.fetch('/private/get_collaterals', 'post', body)
+ }
+
+ /**
+ * Get active positions of a subaccount
+ *
+ * @summary Get Positions
+ */
+ postPrivateGet_positions(
+ body: types.PostPrivateGetPositionsBodyParam,
+ ): Promise> {
+ return this.core.fetch('/private/get_positions', 'post', body)
+ }
+
+ /**
+ * Get expired option settlement history for a subaccount
+ *
+ * @summary Get Option Settlement History
+ */
+ postPrivateGet_option_settlement_history(
+ body: types.PostPrivateGetOptionSettlementHistoryBodyParam,
+ ): Promise> {
+ return this.core.fetch('/private/get_option_settlement_history', 'post', body)
+ }
+
+ /**
+ * Get the value history of a subaccount
+ *
+ * @summary Get Subaccount Value History
+ */
+ postPrivateGet_subaccount_value_history(
+ body: types.PostPrivateGetSubaccountValueHistoryBodyParam,
+ ): Promise> {
+ return this.core.fetch('/private/get_subaccount_value_history', 'post', body)
+ }
+
+ /**
+ * Generate a list of URLs to retrieve archived orders
+ *
+ * @summary Expired And Cancelled History
+ */
+ postPrivateExpired_and_cancelled_history(
+ body: types.PostPrivateExpiredAndCancelledHistoryBodyParam,
+ ): Promise> {
+ return this.core.fetch('/private/expired_and_cancelled_history', 'post', body)
+ }
+
+ /**
+ * Get subaccount funding history.
+ *
+ * @summary Get Funding History
+ */
+ postPrivateGet_funding_history(
+ body: types.PostPrivateGetFundingHistoryBodyParam,
+ ): Promise> {
+ return this.core.fetch('/private/get_funding_history', 'post', body)
+ }
+
+ /**
+ * Get subaccount interest payment history.
+ *
+ * @summary Get Interest History
+ */
+ postPrivateGet_interest_history(
+ body: types.PostPrivateGetInterestHistoryBodyParam,
+ ): Promise> {
+ return this.core.fetch('/private/get_interest_history', 'post', body)
+ }
+
+ /**
+ * Get subaccount erc20 transfer history.
+ *
+ * Position transfers (e.g. options or perps) are treated as trades. Use
+ * `private/get_trade_history` for position transfer history.
+ *
+ * @summary Get Erc20 Transfer History
+ */
+ postPrivateGet_erc20_transfer_history(
+ body: types.PostPrivateGetErc20TransferHistoryBodyParam,
+ ): Promise> {
+ return this.core.fetch('/private/get_erc20_transfer_history', 'post', body)
+ }
+
+ /**
+ * Get Liquidation History
+ *
+ */
+ postPrivateGet_liquidation_history(
+ body: types.PostPrivateGetLiquidationHistoryBodyParam,
+ ): Promise> {
+ return this.core.fetch('/private/get_liquidation_history', 'post', body)
+ }
+
+ /**
+ * Session Keys
+ *
+ */
+ postPrivateSession_keys(
+ body: types.PostPrivateSessionKeysBodyParam,
+ ): Promise> {
+ return this.core.fetch('/private/session_keys', 'post', body)
+ }
+
+ /**
+ * Change Session Key Label
+ *
+ */
+ postPrivateChange_session_key_label(
+ body: types.PostPrivateChangeSessionKeyLabelBodyParam,
+ ): Promise> {
+ return this.core.fetch('/private/change_session_key_label', 'post', body)
+ }
+
+ /**
+ * Get the current mmp config for a subaccount (optionally filtered by currency)
+ *
+ * @summary Get Mmp Config
+ */
+ postPrivateGet_mmp_config(
+ body: types.PostPrivateGetMmpConfigBodyParam,
+ ): Promise> {
+ return this.core.fetch('/private/get_mmp_config', 'post', body)
+ }
+
+ /**
+ * Set the mmp config for the subaccount and currency
+ *
+ * @summary Set Mmp Config
+ */
+ postPrivateSet_mmp_config(
+ body: types.PostPrivateSetMmpConfigBodyParam,
+ ): Promise> {
+ return this.core.fetch('/private/set_mmp_config', 'post', body)
+ }
+
+ /**
+ * Resets (unfreezes) the mmp state for a subaccount (optionally filtered by currency)
+ *
+ * @summary Reset Mmp
+ */
+ postPrivateReset_mmp(
+ body: types.PostPrivateResetMmpBodyParam,
+ ): Promise> {
+ return this.core.fetch('/private/reset_mmp', 'post', body)
+ }
+
+ /**
+ * Enables cancel on disconnect for the account
+ *
+ * @summary Set Cancel On Disconnect
+ */
+ postPrivateSet_cancel_on_disconnect(
+ body: types.PostPrivateSetCancelOnDisconnectBodyParam,
+ ): Promise> {
+ return this.core.fetch('/private/set_cancel_on_disconnect', 'post', body)
+ }
+
+ /**
+ * Get Time
+ *
+ */
+ postPublicGet_time(
+ body: types.PostPublicGetTimeBodyParam,
+ ): Promise> {
+ return this.core.fetch('/public/get_time', 'post', body)
+ }
+}
+
+const createSDK = (() => {
+ return new SDK()
+})()
+export default createSDK
+
+export type {
+ PostPrivateCancelAllBodyParam,
+ PostPrivateCancelAllResponse200,
+ PostPrivateCancelBodyParam,
+ PostPrivateCancelByInstrumentBodyParam,
+ PostPrivateCancelByInstrumentResponse200,
+ PostPrivateCancelByLabelBodyParam,
+ PostPrivateCancelByLabelResponse200,
+ PostPrivateCancelByNonceBodyParam,
+ PostPrivateCancelByNonceResponse200,
+ PostPrivateCancelResponse200,
+ PostPrivateChangeSessionKeyLabelBodyParam,
+ PostPrivateChangeSessionKeyLabelResponse200,
+ PostPrivateChangeSubaccountLabelBodyParam,
+ PostPrivateChangeSubaccountLabelResponse200,
+ PostPrivateCreateSubaccountBodyParam,
+ PostPrivateCreateSubaccountResponse200,
+ PostPrivateDepositBodyParam,
+ PostPrivateDepositResponse200,
+ PostPrivateExpiredAndCancelledHistoryBodyParam,
+ PostPrivateExpiredAndCancelledHistoryResponse200,
+ PostPrivateGetAccountBodyParam,
+ PostPrivateGetAccountResponse200,
+ PostPrivateGetCollateralsBodyParam,
+ PostPrivateGetCollateralsResponse200,
+ PostPrivateGetDepositHistoryBodyParam,
+ PostPrivateGetDepositHistoryResponse200,
+ PostPrivateGetErc20TransferHistoryBodyParam,
+ PostPrivateGetErc20TransferHistoryResponse200,
+ PostPrivateGetFundingHistoryBodyParam,
+ PostPrivateGetFundingHistoryResponse200,
+ PostPrivateGetInterestHistoryBodyParam,
+ PostPrivateGetInterestHistoryResponse200,
+ PostPrivateGetLiquidationHistoryBodyParam,
+ PostPrivateGetLiquidationHistoryResponse200,
+ PostPrivateGetMarginBodyParam,
+ PostPrivateGetMarginResponse200,
+ PostPrivateGetMmpConfigBodyParam,
+ PostPrivateGetMmpConfigResponse200,
+ PostPrivateGetNotificationsBodyParam,
+ PostPrivateGetNotificationsResponse200,
+ PostPrivateGetOpenOrdersBodyParam,
+ PostPrivateGetOpenOrdersResponse200,
+ PostPrivateGetOptionSettlementHistoryBodyParam,
+ PostPrivateGetOptionSettlementHistoryResponse200,
+ PostPrivateGetOrderBodyParam,
+ PostPrivateGetOrderHistoryBodyParam,
+ PostPrivateGetOrderHistoryResponse200,
+ PostPrivateGetOrderResponse200,
+ PostPrivateGetOrdersBodyParam,
+ PostPrivateGetOrdersResponse200,
+ PostPrivateGetPositionsBodyParam,
+ PostPrivateGetPositionsResponse200,
+ PostPrivateGetSubaccountBodyParam,
+ PostPrivateGetSubaccountResponse200,
+ PostPrivateGetSubaccountValueHistoryBodyParam,
+ PostPrivateGetSubaccountValueHistoryResponse200,
+ PostPrivateGetSubaccountsBodyParam,
+ PostPrivateGetSubaccountsResponse200,
+ PostPrivateGetTradeHistoryBodyParam,
+ PostPrivateGetTradeHistoryResponse200,
+ PostPrivateGetWithdrawalHistoryBodyParam,
+ PostPrivateGetWithdrawalHistoryResponse200,
+ PostPrivateOrderBodyParam,
+ PostPrivateOrderDebugBodyParam,
+ PostPrivateOrderDebugResponse200,
+ PostPrivateOrderResponse200,
+ PostPrivateResetMmpBodyParam,
+ PostPrivateResetMmpResponse200,
+ PostPrivateSessionKeysBodyParam,
+ PostPrivateSessionKeysResponse200,
+ PostPrivateSetCancelOnDisconnectBodyParam,
+ PostPrivateSetCancelOnDisconnectResponse200,
+ PostPrivateSetMmpConfigBodyParam,
+ PostPrivateSetMmpConfigResponse200,
+ PostPrivateTransferErc20BodyParam,
+ PostPrivateTransferErc20Response200,
+ PostPrivateTransferPositionBodyParam,
+ PostPrivateTransferPositionResponse200,
+ PostPrivateUpdateNotificationsBodyParam,
+ PostPrivateUpdateNotificationsResponse200,
+ PostPrivateWithdrawBodyParam,
+ PostPrivateWithdrawResponse200,
+ PostPublicBuildRegisterSessionKeyTxBodyParam,
+ PostPublicBuildRegisterSessionKeyTxResponse200,
+ PostPublicCreateAccountBodyParam,
+ PostPublicCreateAccountResponse200,
+ PostPublicCreateSubaccountDebugBodyParam,
+ PostPublicCreateSubaccountDebugResponse200,
+ PostPublicDeregisterSessionKeyBodyParam,
+ PostPublicDeregisterSessionKeyResponse200,
+ PostPublicGetInstrumentBodyParam,
+ PostPublicGetInstrumentResponse200,
+ PostPublicGetInstrumentsBodyParam,
+ PostPublicGetInstrumentsResponse200,
+ PostPublicGetLatestSignedFeedsBodyParam,
+ PostPublicGetLatestSignedFeedsResponse200,
+ PostPublicGetMarginBodyParam,
+ PostPublicGetMarginResponse200,
+ PostPublicGetSpotFeedHistoryBodyParam,
+ PostPublicGetSpotFeedHistoryResponse200,
+ PostPublicGetTickerBodyParam,
+ PostPublicGetTickerResponse200,
+ PostPublicGetTimeBodyParam,
+ PostPublicGetTimeResponse200,
+ PostPublicGetTradeHistoryBodyParam,
+ PostPublicGetTradeHistoryResponse200,
+ PostPublicGetTransactionBodyParam,
+ PostPublicGetTransactionResponse200,
+ PostPublicLoginBodyParam,
+ PostPublicLoginResponse200,
+ PostPublicMarginWatchBodyParam,
+ PostPublicMarginWatchResponse200,
+ PostPublicRegisterSessionKeyBodyParam,
+ PostPublicRegisterSessionKeyResponse200,
+} from './types'
diff --git a/app/src/api/openapi.json b/app/src/api/openapi.json
new file mode 100644
index 0000000..6a7fb76
--- /dev/null
+++ b/app/src/api/openapi.json
@@ -0,0 +1,25032 @@
+{
+ "openapi": "3.0.0",
+ "info": {
+ "version": "1.0.0",
+ "title": "REST API"
+ },
+ "servers": [
+ {
+ "url": "https://api.lyra.finance"
+ }
+ ],
+ "paths": {
+ "/public/create_account": {
+ "post": {
+ "tags": ["Public"],
+ "summary": "Create Account",
+ "description": "Create a new account",
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["status", "wallet"],
+ "properties": {
+ "status": {
+ "title": "status",
+ "type": "string",
+ "description": "`created` or `exists`"
+ },
+ "wallet": {
+ "title": "wallet",
+ "type": "string",
+ "description": "Ethereum wallet address"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ },
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["wallet"],
+ "properties": {
+ "wallet": {
+ "title": "wallet",
+ "type": "string",
+ "description": "Ethereum wallet address"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ }
+ },
+ "/public/build_register_session_key_tx": {
+ "post": {
+ "tags": ["Public"],
+ "summary": "Build Register Session Key Tx",
+ "description": "Build a signable transaction params dictionary.",
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["tx_params"],
+ "properties": {
+ "tx_params": {
+ "title": "tx_params",
+ "type": "object",
+ "description": "Transaction params in dictionary form, same as `TxParams` in `web3.py`",
+ "additionalProperties": {}
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ },
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["expiry_sec", "gas", "nonce", "public_session_key", "wallet"],
+ "properties": {
+ "expiry_sec": {
+ "title": "expiry_sec",
+ "type": "integer",
+ "description": "Expiry of the session key"
+ },
+ "gas": {
+ "title": "gas",
+ "type": "integer",
+ "default": null,
+ "description": "Gas allowance for transaction. If none, will use estimateGas * 150%",
+ "nullable": true
+ },
+ "nonce": {
+ "title": "nonce",
+ "type": "integer",
+ "default": null,
+ "description": "Wallet's transaction count, If none, will use eth.getTransactionCount()",
+ "nullable": true
+ },
+ "public_session_key": {
+ "title": "public_session_key",
+ "type": "string",
+ "description": "Session key in the form of an Ethereum EOA"
+ },
+ "wallet": {
+ "title": "wallet",
+ "type": "string",
+ "description": "Ethereum wallet address of account"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ }
+ },
+ "/public/register_session_key": {
+ "post": {
+ "tags": ["Public"],
+ "summary": "Register Session Key",
+ "description": "Register or update expiry of an existing session key.",
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["label", "public_session_key", "transaction_id"],
+ "properties": {
+ "label": {
+ "title": "label",
+ "type": "string",
+ "description": "User-defined session key label"
+ },
+ "public_session_key": {
+ "title": "public_session_key",
+ "type": "string",
+ "description": "Session key in the form of an Ethereum EOA"
+ },
+ "transaction_id": {
+ "title": "transaction_id",
+ "type": "string",
+ "format": "uuid",
+ "description": "ID to lookup status of transaction"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ },
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["expiry_sec", "label", "public_session_key", "signed_raw_tx", "wallet"],
+ "properties": {
+ "expiry_sec": {
+ "title": "expiry_sec",
+ "type": "integer",
+ "description": "Expiry of the session key"
+ },
+ "label": {
+ "title": "label",
+ "type": "string",
+ "description": "Ethereum wallet address"
+ },
+ "public_session_key": {
+ "title": "public_session_key",
+ "type": "string",
+ "description": "Session key in the form of an Ethereum EOA"
+ },
+ "signed_raw_tx": {
+ "title": "signed_raw_tx",
+ "type": "string",
+ "description": "A signed RLP encoded ETH transaction in form of a hex string (same as `w3.eth.account.sign_transaction(unsigned_tx, private_key).rawTransaction.hex()`)"
+ },
+ "wallet": {
+ "title": "wallet",
+ "type": "string",
+ "description": "Ethereum wallet address of account"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ }
+ },
+ "/public/deregister_session_key": {
+ "post": {
+ "tags": ["Public"],
+ "summary": "Deregister Session Key",
+ "description": "",
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["public_session_key", "transaction_id"],
+ "properties": {
+ "public_session_key": {
+ "title": "public_session_key",
+ "type": "string",
+ "description": "Session key in the form of an Ethereum EOA"
+ },
+ "transaction_id": {
+ "title": "transaction_id",
+ "type": "string",
+ "format": "uuid",
+ "description": "ID to lookup status of transaction"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ },
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["public_session_key", "signed_raw_tx", "wallet"],
+ "properties": {
+ "public_session_key": {
+ "title": "public_session_key",
+ "type": "string",
+ "description": "Session key in the form of an Ethereum EOA"
+ },
+ "signed_raw_tx": {
+ "title": "signed_raw_tx",
+ "type": "string",
+ "description": "A signed RLP encoded ETH transaction in form of a hex string (same as `w3.eth.account.sign_transaction(unsigned_tx, private_key).rawTransaction.hex()`)"
+ },
+ "wallet": {
+ "title": "wallet",
+ "type": "string",
+ "description": "Ethereum wallet address of account"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ }
+ },
+ "/public/login": {
+ "post": {
+ "tags": ["Public"],
+ "summary": "Login",
+ "description": "Authenticate a websocket connection. Unavailable via HTTP.",
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "title": "result",
+ "type": "array",
+ "description": "List of subaccount IDs that have been authenticated",
+ "items": {
+ "title": "result",
+ "type": "integer"
+ }
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ },
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["signature", "timestamp", "wallet"],
+ "properties": {
+ "signature": {
+ "title": "signature",
+ "type": "string",
+ "description": "Signature of the timestamp, signed with the wallet's private key or a session key"
+ },
+ "timestamp": {
+ "title": "timestamp",
+ "type": "string",
+ "description": "Message that was signed, in the form of a timestamp in ms since Unix epoch"
+ },
+ "wallet": {
+ "title": "wallet",
+ "type": "string",
+ "description": "Public key (wallet) of the account"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ }
+ },
+ "/public/get_instrument": {
+ "post": {
+ "tags": ["Public"],
+ "summary": "Get Instrument",
+ "description": "Get single instrument by asset name",
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": [
+ "amount_step",
+ "base_asset_address",
+ "base_asset_sub_id",
+ "base_currency",
+ "base_fee",
+ "instrument_name",
+ "instrument_type",
+ "is_active",
+ "maker_fee_rate",
+ "maximum_amount",
+ "minimum_amount",
+ "option_details",
+ "perp_details",
+ "quote_currency",
+ "scheduled_activation",
+ "scheduled_deactivation",
+ "taker_fee_rate",
+ "tick_size"
+ ],
+ "properties": {
+ "amount_step": {
+ "title": "amount_step",
+ "type": "string",
+ "format": "decimal",
+ "description": "Minimum valid increment of order amount"
+ },
+ "base_asset_address": {
+ "title": "base_asset_address",
+ "type": "string",
+ "description": "Blockchain address of the base asset"
+ },
+ "base_asset_sub_id": {
+ "title": "base_asset_sub_id",
+ "type": "string",
+ "description": "Sub ID of the specific base asset as defined in Asset.sol"
+ },
+ "base_currency": {
+ "title": "base_currency",
+ "type": "string",
+ "description": "Underlying currency of base asset (`ETH`, `BTC`, etc)"
+ },
+ "base_fee": {
+ "title": "base_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "$ base fee added to every taker order"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ },
+ "instrument_type": {
+ "title": "instrument_type",
+ "type": "string",
+ "enum": ["erc20", "option", "perp"],
+ "description": "`erc20`, `option`, or `perp`"
+ },
+ "is_active": {
+ "title": "is_active",
+ "type": "boolean",
+ "description": "If `True`: instrument is tradeable within `activation` and `deactivation` timestamps"
+ },
+ "maker_fee_rate": {
+ "title": "maker_fee_rate",
+ "type": "string",
+ "format": "decimal",
+ "description": "Percent of spot price fee rate for makers"
+ },
+ "mark_price_fee_rate_cap": {
+ "title": "mark_price_fee_rate_cap",
+ "type": "string",
+ "format": "decimal",
+ "default": null,
+ "description": "Percent of option price fee cap, e.g. 12.5%, null if not applicable",
+ "nullable": true
+ },
+ "maximum_amount": {
+ "title": "maximum_amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Maximum valid amount of contracts / tokens per trade"
+ },
+ "minimum_amount": {
+ "title": "minimum_amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Minimum valid amount of contracts / tokens per trade"
+ },
+ "option_details": {
+ "required": ["expiry", "index", "option_type", "strike"],
+ "properties": {
+ "expiry": {
+ "title": "expiry",
+ "type": "integer",
+ "description": "Unix timestamp of expiry date (in seconds)"
+ },
+ "index": {
+ "title": "index",
+ "type": "string",
+ "description": "Underlying settlement price index"
+ },
+ "option_type": {
+ "title": "option_type",
+ "type": "string",
+ "enum": ["C", "P"]
+ },
+ "settlement_price": {
+ "title": "settlement_price",
+ "type": "string",
+ "format": "decimal",
+ "default": null,
+ "description": "Settlement price of the option",
+ "nullable": true
+ },
+ "strike": {
+ "title": "strike",
+ "type": "string",
+ "format": "decimal"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "perp_details": {
+ "required": [
+ "aggregate_funding",
+ "funding_rate",
+ "index",
+ "max_rate_per_hour",
+ "min_rate_per_hour",
+ "static_interest_rate"
+ ],
+ "properties": {
+ "aggregate_funding": {
+ "title": "aggregate_funding",
+ "type": "string",
+ "format": "decimal",
+ "description": "Latest aggregated funding as per `PerpAsset.sol`"
+ },
+ "funding_rate": {
+ "title": "funding_rate",
+ "type": "string",
+ "format": "decimal",
+ "description": "Current hourly funding rate as per `PerpAsset.sol`"
+ },
+ "index": {
+ "title": "index",
+ "type": "string",
+ "description": "Underlying spot price index for funding rate"
+ },
+ "max_rate_per_hour": {
+ "title": "max_rate_per_hour",
+ "type": "string",
+ "format": "decimal",
+ "description": "Max rate per hour as per `PerpAsset.sol`"
+ },
+ "min_rate_per_hour": {
+ "title": "min_rate_per_hour",
+ "type": "string",
+ "format": "decimal",
+ "description": "Min rate per hour as per `PerpAsset.sol`"
+ },
+ "static_interest_rate": {
+ "title": "static_interest_rate",
+ "type": "string",
+ "format": "decimal",
+ "description": "Static interest rate as per `PerpAsset.sol`"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "quote_currency": {
+ "title": "quote_currency",
+ "type": "string",
+ "description": "Quote currency (`USD` for perps, `USDC` for options)"
+ },
+ "scheduled_activation": {
+ "title": "scheduled_activation",
+ "type": "integer",
+ "description": "Timestamp at which became or will become active (if applicable)"
+ },
+ "scheduled_deactivation": {
+ "title": "scheduled_deactivation",
+ "type": "integer",
+ "description": "Scheduled deactivation time for instrument (if applicable)"
+ },
+ "taker_fee_rate": {
+ "title": "taker_fee_rate",
+ "type": "string",
+ "format": "decimal",
+ "description": "Percent of spot price fee rate for takers"
+ },
+ "tick_size": {
+ "title": "tick_size",
+ "type": "string",
+ "format": "decimal",
+ "description": "Tick size of the instrument, i.e. minimum price increment"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ },
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["instrument_name"],
+ "properties": {
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ }
+ },
+ "/public/get_instruments": {
+ "post": {
+ "tags": ["Public"],
+ "summary": "Get Instruments",
+ "description": "Get all active instruments for a given `currency` and `type`",
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "title": "result",
+ "type": "array",
+ "description": "",
+ "items": {
+ "required": [
+ "amount_step",
+ "base_asset_address",
+ "base_asset_sub_id",
+ "base_currency",
+ "base_fee",
+ "instrument_name",
+ "instrument_type",
+ "is_active",
+ "maker_fee_rate",
+ "maximum_amount",
+ "minimum_amount",
+ "option_details",
+ "perp_details",
+ "quote_currency",
+ "scheduled_activation",
+ "scheduled_deactivation",
+ "taker_fee_rate",
+ "tick_size"
+ ],
+ "properties": {
+ "amount_step": {
+ "title": "amount_step",
+ "type": "string",
+ "format": "decimal",
+ "description": "Minimum valid increment of order amount"
+ },
+ "base_asset_address": {
+ "title": "base_asset_address",
+ "type": "string",
+ "description": "Blockchain address of the base asset"
+ },
+ "base_asset_sub_id": {
+ "title": "base_asset_sub_id",
+ "type": "string",
+ "description": "Sub ID of the specific base asset as defined in Asset.sol"
+ },
+ "base_currency": {
+ "title": "base_currency",
+ "type": "string",
+ "description": "Underlying currency of base asset (`ETH`, `BTC`, etc)"
+ },
+ "base_fee": {
+ "title": "base_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "$ base fee added to every taker order"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ },
+ "instrument_type": {
+ "title": "instrument_type",
+ "type": "string",
+ "enum": ["erc20", "option", "perp"],
+ "description": "`erc20`, `option`, or `perp`"
+ },
+ "is_active": {
+ "title": "is_active",
+ "type": "boolean",
+ "description": "If `True`: instrument is tradeable within `activation` and `deactivation` timestamps"
+ },
+ "maker_fee_rate": {
+ "title": "maker_fee_rate",
+ "type": "string",
+ "format": "decimal",
+ "description": "Percent of spot price fee rate for makers"
+ },
+ "mark_price_fee_rate_cap": {
+ "title": "mark_price_fee_rate_cap",
+ "type": "string",
+ "format": "decimal",
+ "default": null,
+ "description": "Percent of option price fee cap, e.g. 12.5%, null if not applicable",
+ "nullable": true
+ },
+ "maximum_amount": {
+ "title": "maximum_amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Maximum valid amount of contracts / tokens per trade"
+ },
+ "minimum_amount": {
+ "title": "minimum_amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Minimum valid amount of contracts / tokens per trade"
+ },
+ "option_details": {
+ "required": ["expiry", "index", "option_type", "strike"],
+ "properties": {
+ "expiry": {
+ "title": "expiry",
+ "type": "integer",
+ "description": "Unix timestamp of expiry date (in seconds)"
+ },
+ "index": {
+ "title": "index",
+ "type": "string",
+ "description": "Underlying settlement price index"
+ },
+ "option_type": {
+ "title": "option_type",
+ "type": "string",
+ "enum": ["C", "P"]
+ },
+ "settlement_price": {
+ "title": "settlement_price",
+ "type": "string",
+ "format": "decimal",
+ "default": null,
+ "description": "Settlement price of the option",
+ "nullable": true
+ },
+ "strike": {
+ "title": "strike",
+ "type": "string",
+ "format": "decimal"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "perp_details": {
+ "required": [
+ "aggregate_funding",
+ "funding_rate",
+ "index",
+ "max_rate_per_hour",
+ "min_rate_per_hour",
+ "static_interest_rate"
+ ],
+ "properties": {
+ "aggregate_funding": {
+ "title": "aggregate_funding",
+ "type": "string",
+ "format": "decimal",
+ "description": "Latest aggregated funding as per `PerpAsset.sol`"
+ },
+ "funding_rate": {
+ "title": "funding_rate",
+ "type": "string",
+ "format": "decimal",
+ "description": "Current hourly funding rate as per `PerpAsset.sol`"
+ },
+ "index": {
+ "title": "index",
+ "type": "string",
+ "description": "Underlying spot price index for funding rate"
+ },
+ "max_rate_per_hour": {
+ "title": "max_rate_per_hour",
+ "type": "string",
+ "format": "decimal",
+ "description": "Max rate per hour as per `PerpAsset.sol`"
+ },
+ "min_rate_per_hour": {
+ "title": "min_rate_per_hour",
+ "type": "string",
+ "format": "decimal",
+ "description": "Min rate per hour as per `PerpAsset.sol`"
+ },
+ "static_interest_rate": {
+ "title": "static_interest_rate",
+ "type": "string",
+ "format": "decimal",
+ "description": "Static interest rate as per `PerpAsset.sol`"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "quote_currency": {
+ "title": "quote_currency",
+ "type": "string",
+ "description": "Quote currency (`USD` for perps, `USDC` for options)"
+ },
+ "scheduled_activation": {
+ "title": "scheduled_activation",
+ "type": "integer",
+ "description": "Timestamp at which became or will become active (if applicable)"
+ },
+ "scheduled_deactivation": {
+ "title": "scheduled_deactivation",
+ "type": "integer",
+ "description": "Scheduled deactivation time for instrument (if applicable)"
+ },
+ "taker_fee_rate": {
+ "title": "taker_fee_rate",
+ "type": "string",
+ "format": "decimal",
+ "description": "Percent of spot price fee rate for takers"
+ },
+ "tick_size": {
+ "title": "tick_size",
+ "type": "string",
+ "format": "decimal",
+ "description": "Tick size of the instrument, i.e. minimum price increment"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ },
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["currency", "expired", "instrument_type"],
+ "properties": {
+ "currency": {
+ "title": "currency",
+ "type": "string",
+ "description": "Underlying currency of asset (`ETH`, `BTC`, etc)"
+ },
+ "expired": {
+ "title": "expired",
+ "type": "boolean",
+ "description": "If `True`: include expired assets"
+ },
+ "instrument_type": {
+ "title": "instrument_type",
+ "type": "string",
+ "enum": ["erc20", "option", "perp"],
+ "description": "`erc20`, `option`, or `perp`"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ }
+ },
+ "/public/get_ticker": {
+ "post": {
+ "tags": ["Public"],
+ "summary": "Get Ticker",
+ "description": "Get all active instrument tickers for a given `currency` and `type`",
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": [
+ "amount_step",
+ "base_asset_address",
+ "base_asset_sub_id",
+ "base_currency",
+ "base_fee",
+ "best_ask_amount",
+ "best_ask_price",
+ "best_bid_amount",
+ "best_bid_price",
+ "index_price",
+ "instrument_name",
+ "instrument_type",
+ "is_active",
+ "maker_fee_rate",
+ "mark_price",
+ "max_price",
+ "maximum_amount",
+ "min_price",
+ "minimum_amount",
+ "option_details",
+ "option_pricing",
+ "perp_details",
+ "quote_currency",
+ "scheduled_activation",
+ "scheduled_deactivation",
+ "stats",
+ "taker_fee_rate",
+ "tick_size",
+ "timestamp"
+ ],
+ "properties": {
+ "amount_step": {
+ "title": "amount_step",
+ "type": "string",
+ "format": "decimal",
+ "description": "Minimum valid increment of order amount"
+ },
+ "base_asset_address": {
+ "title": "base_asset_address",
+ "type": "string",
+ "description": "Blockchain address of the base asset"
+ },
+ "base_asset_sub_id": {
+ "title": "base_asset_sub_id",
+ "type": "string",
+ "description": "Sub ID of the specific base asset as defined in Asset.sol"
+ },
+ "base_currency": {
+ "title": "base_currency",
+ "type": "string",
+ "description": "Underlying currency of base asset (`ETH`, `BTC`, etc)"
+ },
+ "base_fee": {
+ "title": "base_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "$ base fee added to every taker order"
+ },
+ "best_ask_amount": {
+ "title": "best_ask_amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Amount of contracts / tokens available at best ask price"
+ },
+ "best_ask_price": {
+ "title": "best_ask_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Best ask price"
+ },
+ "best_bid_amount": {
+ "title": "best_bid_amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Amount of contracts / tokens available at best bid price"
+ },
+ "best_bid_price": {
+ "title": "best_bid_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Best bid price"
+ },
+ "index_price": {
+ "title": "index_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Index price"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ },
+ "instrument_type": {
+ "title": "instrument_type",
+ "type": "string",
+ "enum": ["erc20", "option", "perp"],
+ "description": "`erc20`, `option`, or `perp`"
+ },
+ "is_active": {
+ "title": "is_active",
+ "type": "boolean",
+ "description": "If `True`: instrument is tradeable within `activation` and `deactivation` timestamps"
+ },
+ "maker_fee_rate": {
+ "title": "maker_fee_rate",
+ "type": "string",
+ "format": "decimal",
+ "description": "Percent of spot price fee rate for makers"
+ },
+ "mark_price": {
+ "title": "mark_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Mark price"
+ },
+ "mark_price_fee_rate_cap": {
+ "title": "mark_price_fee_rate_cap",
+ "type": "string",
+ "format": "decimal",
+ "default": null,
+ "description": "Percent of option price fee cap, e.g. 12.5%, null if not applicable",
+ "nullable": true
+ },
+ "max_price": {
+ "title": "max_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Maximum price at which an agressive buyer can be matched. Any portion of a market order that would execute above this price will be cancelled. A limit buy order with limit price above this value is treated as post only (i.e. it will be rejected if it would cross any existing resting order)."
+ },
+ "maximum_amount": {
+ "title": "maximum_amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Maximum valid amount of contracts / tokens per trade"
+ },
+ "min_price": {
+ "title": "min_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Minimum price at which an agressive seller can be matched. Any portion of a market order that would execute below this price will be cancelled. A limit sell order with limit price below this value is treated as post only (i.e. it will be rejected if it would cross any existing resting order)."
+ },
+ "minimum_amount": {
+ "title": "minimum_amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Minimum valid amount of contracts / tokens per trade"
+ },
+ "option_details": {
+ "required": ["expiry", "index", "option_type", "strike"],
+ "properties": {
+ "expiry": {
+ "title": "expiry",
+ "type": "integer",
+ "description": "Unix timestamp of expiry date (in seconds)"
+ },
+ "index": {
+ "title": "index",
+ "type": "string",
+ "description": "Underlying settlement price index"
+ },
+ "option_type": {
+ "title": "option_type",
+ "type": "string",
+ "enum": ["C", "P"]
+ },
+ "settlement_price": {
+ "title": "settlement_price",
+ "type": "string",
+ "format": "decimal",
+ "default": null,
+ "description": "Settlement price of the option",
+ "nullable": true
+ },
+ "strike": {
+ "title": "strike",
+ "type": "string",
+ "format": "decimal"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "option_pricing": {
+ "required": [
+ "ask_iv",
+ "bid_iv",
+ "delta",
+ "forward_price",
+ "gamma",
+ "iv",
+ "mark_price",
+ "rho",
+ "theta",
+ "vega"
+ ],
+ "properties": {
+ "ask_iv": {
+ "title": "ask_iv",
+ "type": "string",
+ "format": "decimal",
+ "description": "Implied volatility of the current best ask"
+ },
+ "bid_iv": {
+ "title": "bid_iv",
+ "type": "string",
+ "format": "decimal",
+ "description": "Implied volatility of the current best bid"
+ },
+ "delta": {
+ "title": "delta",
+ "type": "string",
+ "format": "decimal",
+ "description": "Delta of the option"
+ },
+ "forward_price": {
+ "title": "forward_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Forward price used to calculate option premium"
+ },
+ "gamma": {
+ "title": "gamma",
+ "type": "string",
+ "format": "decimal",
+ "description": "Gamma of the option"
+ },
+ "iv": {
+ "title": "iv",
+ "type": "string",
+ "format": "decimal",
+ "description": "Implied volatility of the option"
+ },
+ "mark_price": {
+ "title": "mark_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Mark price of the option"
+ },
+ "rho": {
+ "title": "rho",
+ "type": "string",
+ "format": "decimal",
+ "description": "Rho of the option"
+ },
+ "theta": {
+ "title": "theta",
+ "type": "string",
+ "format": "decimal",
+ "description": "Theta of the option"
+ },
+ "vega": {
+ "title": "vega",
+ "type": "string",
+ "format": "decimal",
+ "description": "Vega of the option"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "perp_details": {
+ "required": [
+ "aggregate_funding",
+ "funding_rate",
+ "index",
+ "max_rate_per_hour",
+ "min_rate_per_hour",
+ "static_interest_rate"
+ ],
+ "properties": {
+ "aggregate_funding": {
+ "title": "aggregate_funding",
+ "type": "string",
+ "format": "decimal",
+ "description": "Latest aggregated funding as per `PerpAsset.sol`"
+ },
+ "funding_rate": {
+ "title": "funding_rate",
+ "type": "string",
+ "format": "decimal",
+ "description": "Current hourly funding rate as per `PerpAsset.sol`"
+ },
+ "index": {
+ "title": "index",
+ "type": "string",
+ "description": "Underlying spot price index for funding rate"
+ },
+ "max_rate_per_hour": {
+ "title": "max_rate_per_hour",
+ "type": "string",
+ "format": "decimal",
+ "description": "Max rate per hour as per `PerpAsset.sol`"
+ },
+ "min_rate_per_hour": {
+ "title": "min_rate_per_hour",
+ "type": "string",
+ "format": "decimal",
+ "description": "Min rate per hour as per `PerpAsset.sol`"
+ },
+ "static_interest_rate": {
+ "title": "static_interest_rate",
+ "type": "string",
+ "format": "decimal",
+ "description": "Static interest rate as per `PerpAsset.sol`"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "quote_currency": {
+ "title": "quote_currency",
+ "type": "string",
+ "description": "Quote currency (`USD` for perps, `USDC` for options)"
+ },
+ "scheduled_activation": {
+ "title": "scheduled_activation",
+ "type": "integer",
+ "description": "Timestamp at which became or will become active (if applicable)"
+ },
+ "scheduled_deactivation": {
+ "title": "scheduled_deactivation",
+ "type": "integer",
+ "description": "Scheduled deactivation time for instrument (if applicable)"
+ },
+ "stats": {
+ "required": [
+ "contract_volume",
+ "high",
+ "low",
+ "num_trades",
+ "open_interest",
+ "percent_change",
+ "usd_change"
+ ],
+ "properties": {
+ "contract_volume": {
+ "title": "contract_volume",
+ "type": "string",
+ "format": "decimal",
+ "description": "Number of contracts traded during last 24 hours"
+ },
+ "high": {
+ "title": "high",
+ "type": "string",
+ "format": "decimal",
+ "description": "Highest trade price during last 24h"
+ },
+ "low": {
+ "title": "low",
+ "type": "string",
+ "format": "decimal",
+ "description": "Lowest trade price during last 24h"
+ },
+ "num_trades": {
+ "title": "num_trades",
+ "type": "string",
+ "format": "decimal",
+ "description": "Number of trades during last 24h "
+ },
+ "open_interest": {
+ "title": "open_interest",
+ "type": "string",
+ "format": "decimal",
+ "description": "Current total open interest"
+ },
+ "percent_change": {
+ "title": "percent_change",
+ "type": "string",
+ "format": "decimal",
+ "description": "24-hour price change expressed as a percentage. Options: percent change in vol; Perps: percent change in mark price"
+ },
+ "usd_change": {
+ "title": "usd_change",
+ "type": "string",
+ "format": "decimal",
+ "description": "24-hour price change in USD."
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "taker_fee_rate": {
+ "title": "taker_fee_rate",
+ "type": "string",
+ "format": "decimal",
+ "description": "Percent of spot price fee rate for takers"
+ },
+ "tick_size": {
+ "title": "tick_size",
+ "type": "string",
+ "format": "decimal",
+ "description": "Tick size of the instrument, i.e. minimum price increment"
+ },
+ "timestamp": {
+ "title": "timestamp",
+ "type": "integer",
+ "description": "Timestamp of the ticker feed snapshot"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ },
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["instrument_name"],
+ "properties": {
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ }
+ },
+ "/public/get_latest_signed_feeds": {
+ "post": {
+ "tags": ["Public"],
+ "summary": "Get Latest Signed Feeds",
+ "description": "Get latest signed data feeds",
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["fwd_data", "perp_data", "spot_data", "vol_data"],
+ "properties": {
+ "fwd_data": {
+ "title": "fwd_data",
+ "type": "object",
+ "description": "currency -> expiry -> latest forward feed data",
+ "additionalProperties": {
+ "title": "fwd_data",
+ "type": "object",
+ "additionalProperties": {
+ "required": [
+ "confidence",
+ "currency",
+ "deadline",
+ "expiry",
+ "fwd_diff",
+ "signatures",
+ "spot_aggregate_latest",
+ "spot_aggregate_start",
+ "timestamp"
+ ],
+ "properties": {
+ "confidence": {
+ "title": "confidence",
+ "type": "string",
+ "format": "decimal",
+ "description": "The confidence score of the price"
+ },
+ "currency": {
+ "title": "currency",
+ "type": "string",
+ "description": "The currency for which the spot feed represents"
+ },
+ "deadline": {
+ "title": "deadline",
+ "type": "integer",
+ "description": "The latest time the data can be submitted on chain"
+ },
+ "expiry": {
+ "title": "expiry",
+ "type": "integer",
+ "description": "The expiry for the forward feed"
+ },
+ "fwd_diff": {
+ "title": "fwd_diff",
+ "type": "string",
+ "format": "decimal",
+ "description": "difference of forward price from current spot price"
+ },
+ "signatures": {
+ "properties": {
+ "signatures": {
+ "title": "signatures",
+ "type": "array",
+ "description": "The signatures of the given signers",
+ "items": {
+ "title": "signatures",
+ "type": "string"
+ }
+ },
+ "signers": {
+ "title": "signers",
+ "type": "array",
+ "description": "The signers who verify the data integrity",
+ "items": {
+ "title": "signers",
+ "type": "string"
+ }
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "spot_aggregate_latest": {
+ "title": "spot_aggregate_latest",
+ "type": "string",
+ "format": "decimal",
+ "description": "expiry -> spot * time value at the latest timestamp"
+ },
+ "spot_aggregate_start": {
+ "title": "spot_aggregate_start",
+ "type": "string",
+ "format": "decimal",
+ "description": "spot * time value at the start of the settlement period"
+ },
+ "timestamp": {
+ "title": "timestamp",
+ "type": "integer",
+ "description": "The timestamp for which the data was created"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ },
+ "perp_data": {
+ "title": "perp_data",
+ "type": "object",
+ "description": "currency -> feed type -> latest perp feed data",
+ "additionalProperties": {
+ "title": "perp_data",
+ "type": "object",
+ "additionalProperties": {
+ "required": [
+ "confidence",
+ "currency",
+ "deadline",
+ "signatures",
+ "spot_diff_value",
+ "timestamp",
+ "type"
+ ],
+ "properties": {
+ "confidence": {
+ "title": "confidence",
+ "type": "string",
+ "format": "decimal",
+ "description": "The confidence score of the price"
+ },
+ "currency": {
+ "title": "currency",
+ "type": "string",
+ "description": "The currency for which the spot feed represents"
+ },
+ "deadline": {
+ "title": "deadline",
+ "type": "integer",
+ "description": "The latest time the data can be submitted on chain"
+ },
+ "signatures": {
+ "properties": {
+ "signatures": {
+ "title": "signatures",
+ "type": "array",
+ "description": "The signatures of the given signers",
+ "items": {
+ "title": "signatures",
+ "type": "string"
+ }
+ },
+ "signers": {
+ "title": "signers",
+ "type": "array",
+ "description": "The signers who verify the data integrity",
+ "items": {
+ "title": "signers",
+ "type": "string"
+ }
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "spot_diff_value": {
+ "title": "spot_diff_value",
+ "type": "string",
+ "format": "decimal",
+ "description": "The difference between the spot price and the perp price"
+ },
+ "timestamp": {
+ "title": "timestamp",
+ "type": "integer",
+ "description": "The timestamp for which the data was created"
+ },
+ "type": {
+ "title": "type",
+ "type": "string",
+ "enum": ["P", "A", "B"],
+ "description": "The type of perp feed; mid price, ask impact or bid impact"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ },
+ "spot_data": {
+ "title": "spot_data",
+ "type": "object",
+ "description": "currency -> latest spot feed data",
+ "additionalProperties": {
+ "required": ["confidence", "currency", "deadline", "price", "signatures", "timestamp"],
+ "properties": {
+ "confidence": {
+ "title": "confidence",
+ "type": "string",
+ "format": "decimal",
+ "description": "The confidence score of the price"
+ },
+ "currency": {
+ "title": "currency",
+ "type": "string",
+ "description": "The currency for which the spot feed represents"
+ },
+ "deadline": {
+ "title": "deadline",
+ "type": "integer",
+ "description": "The latest time the data can be submitted on chain"
+ },
+ "price": {
+ "title": "price",
+ "type": "string",
+ "format": "decimal",
+ "description": "The price of the currency in USD"
+ },
+ "signatures": {
+ "properties": {
+ "signatures": {
+ "title": "signatures",
+ "type": "array",
+ "description": "The signatures of the given signers",
+ "items": {
+ "title": "signatures",
+ "type": "string"
+ }
+ },
+ "signers": {
+ "title": "signers",
+ "type": "array",
+ "description": "The signers who verify the data integrity",
+ "items": {
+ "title": "signers",
+ "type": "string"
+ }
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "timestamp": {
+ "title": "timestamp",
+ "type": "integer",
+ "description": "The timestamp for which the data was created"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "vol_data": {
+ "title": "vol_data",
+ "type": "object",
+ "description": "currency -> expiry -> latest vol feed data",
+ "additionalProperties": {
+ "title": "vol_data",
+ "type": "object",
+ "additionalProperties": {
+ "required": [
+ "confidence",
+ "currency",
+ "deadline",
+ "expiry",
+ "signatures",
+ "timestamp",
+ "vol_data"
+ ],
+ "properties": {
+ "confidence": {
+ "title": "confidence",
+ "type": "string",
+ "format": "decimal",
+ "description": "The confidence score of the price"
+ },
+ "currency": {
+ "title": "currency",
+ "type": "string",
+ "description": "The currency for which the spot feed represents"
+ },
+ "deadline": {
+ "title": "deadline",
+ "type": "integer",
+ "description": "The latest time the data can be submitted on chain"
+ },
+ "expiry": {
+ "title": "expiry",
+ "type": "integer",
+ "description": "The expiry for the options for the vol feed"
+ },
+ "signatures": {
+ "properties": {
+ "signatures": {
+ "title": "signatures",
+ "type": "array",
+ "description": "The signatures of the given signers",
+ "items": {
+ "title": "signatures",
+ "type": "string"
+ }
+ },
+ "signers": {
+ "title": "signers",
+ "type": "array",
+ "description": "The signers who verify the data integrity",
+ "items": {
+ "title": "signers",
+ "type": "string"
+ }
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "timestamp": {
+ "title": "timestamp",
+ "type": "integer",
+ "description": "The timestamp for which the data was created"
+ },
+ "vol_data": {
+ "required": [
+ "SVI_a",
+ "SVI_b",
+ "SVI_fwd",
+ "SVI_m",
+ "SVI_refTau",
+ "SVI_rho",
+ "SVI_sigma"
+ ],
+ "properties": {
+ "SVI_a": {
+ "title": "SVI_a",
+ "type": "string",
+ "format": "decimal"
+ },
+ "SVI_b": {
+ "title": "SVI_b",
+ "type": "string",
+ "format": "decimal"
+ },
+ "SVI_fwd": {
+ "title": "SVI_fwd",
+ "type": "string",
+ "format": "decimal"
+ },
+ "SVI_m": {
+ "title": "SVI_m",
+ "type": "string",
+ "format": "decimal"
+ },
+ "SVI_refTau": {
+ "title": "SVI_refTau",
+ "type": "string",
+ "format": "decimal"
+ },
+ "SVI_rho": {
+ "title": "SVI_rho",
+ "type": "string",
+ "format": "decimal"
+ },
+ "SVI_sigma": {
+ "title": "SVI_sigma",
+ "type": "string",
+ "format": "decimal"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ },
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "properties": {
+ "currency": {
+ "title": "currency",
+ "type": "string",
+ "default": null,
+ "description": "Currency filter, (defaults to all currencies)",
+ "nullable": true
+ },
+ "expiry": {
+ "title": "expiry",
+ "type": "integer",
+ "default": null,
+ "description": "Expiry filter for options and forward data (defaults to all expiries). Use `0` to get data only for spot and perpetuals",
+ "nullable": true
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ }
+ },
+ "/public/get_spot_feed_history": {
+ "post": {
+ "tags": ["Public"],
+ "summary": "Get Spot Feed History",
+ "description": "Get spot feed history by currency",
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["currency", "spot_feed_history"],
+ "properties": {
+ "currency": {
+ "title": "currency",
+ "type": "string",
+ "description": "Currency"
+ },
+ "spot_feed_history": {
+ "title": "spot_feed_history",
+ "type": "array",
+ "description": "Spot feed history",
+ "items": {
+ "required": ["confidence", "price", "timestamp", "timestamp_bucket"],
+ "properties": {
+ "confidence": {
+ "title": "confidence",
+ "type": "string",
+ "format": "decimal",
+ "description": "Confidence score of the spot price"
+ },
+ "price": {
+ "title": "price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Spot price"
+ },
+ "timestamp": {
+ "title": "timestamp",
+ "type": "integer",
+ "description": "Timestamp of when the spot price was recored into the database"
+ },
+ "timestamp_bucket": {
+ "title": "timestamp_bucket",
+ "type": "integer",
+ "description": "Timestamp bucket; this value is regularly spaced out with `period` seconds between data points, missing values are forward-filled from earlier data where possible, if no earlier data is available, values are back-filled from the first observed data point"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ },
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["currency", "end_timestamp", "period", "start_timestamp"],
+ "properties": {
+ "currency": {
+ "title": "currency",
+ "type": "string",
+ "description": "Currency"
+ },
+ "end_timestamp": {
+ "title": "end_timestamp",
+ "type": "integer",
+ "description": "End timestamp"
+ },
+ "period": {
+ "title": "period",
+ "type": "integer",
+ "description": "Period"
+ },
+ "start_timestamp": {
+ "title": "start_timestamp",
+ "type": "integer",
+ "description": "Start timestamp"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ }
+ },
+ "/public/get_trade_history": {
+ "post": {
+ "tags": ["Public"],
+ "summary": "Get Trade History",
+ "description": "Get trade history for a subaccount, with filter parameters.",
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["pagination", "trades"],
+ "properties": {
+ "pagination": {
+ "required": ["count", "num_pages"],
+ "properties": {
+ "count": {
+ "title": "count",
+ "type": "integer",
+ "description": "Total number of items, across all pages"
+ },
+ "num_pages": {
+ "title": "num_pages",
+ "type": "integer",
+ "description": "Number of pages"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "trades": {
+ "title": "trades",
+ "type": "array",
+ "description": "List of trades",
+ "items": {
+ "required": [
+ "direction",
+ "index_price",
+ "instrument_name",
+ "liquidity_role",
+ "mark_price",
+ "subaccount_id",
+ "timestamp",
+ "trade_amount",
+ "trade_fee",
+ "trade_id",
+ "trade_price",
+ "tx_hash",
+ "tx_status",
+ "wallet"
+ ],
+ "properties": {
+ "direction": {
+ "title": "direction",
+ "type": "string",
+ "enum": ["buy", "sell"],
+ "description": "Order direction"
+ },
+ "index_price": {
+ "title": "index_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Index price of the underlying at the time of the trade"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ },
+ "liquidity_role": {
+ "title": "liquidity_role",
+ "type": "string",
+ "enum": ["maker", "taker"],
+ "description": "Role of the user in the trade"
+ },
+ "mark_price": {
+ "title": "mark_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Mark price of the instrument at the time of the trade"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount ID"
+ },
+ "timestamp": {
+ "title": "timestamp",
+ "type": "integer",
+ "description": "Trade timestamp (in ms since Unix epoch)"
+ },
+ "trade_amount": {
+ "title": "trade_amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Amount filled in this trade"
+ },
+ "trade_fee": {
+ "title": "trade_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Fee for this trade"
+ },
+ "trade_id": {
+ "title": "trade_id",
+ "type": "string",
+ "description": "Trade ID"
+ },
+ "trade_price": {
+ "title": "trade_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Price at which the trade was filled"
+ },
+ "tx_hash": {
+ "title": "tx_hash",
+ "type": "string",
+ "description": "Blockchain transaction hash"
+ },
+ "tx_status": {
+ "title": "tx_status",
+ "type": "string",
+ "enum": ["settled", "reverted"],
+ "description": "Blockchain transaction status"
+ },
+ "wallet": {
+ "title": "wallet",
+ "type": "string",
+ "description": "Wallet address (owner) of the subaccount"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ },
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "properties": {
+ "currency": {
+ "title": "currency",
+ "type": "string",
+ "default": null,
+ "description": "Currency to filter by (defaults to all)",
+ "nullable": true
+ },
+ "from_timestamp": {
+ "title": "from_timestamp",
+ "type": "integer",
+ "default": 0,
+ "description": "Earliest timestamp to filter by (in ms since Unix epoch). If not provied, defaults to 0."
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "default": null,
+ "description": "Instrument name to filter by (defaults to all)",
+ "nullable": true
+ },
+ "instrument_type": {
+ "title": "instrument_type",
+ "type": "string",
+ "default": null,
+ "enum": ["erc20", "option", "perp"],
+ "description": "Instrument type to filter by (defaults to all)",
+ "nullable": true
+ },
+ "page": {
+ "title": "page",
+ "type": "integer",
+ "default": 1,
+ "description": "Page number of results to return (default 1, returns last if above `num_pages`)"
+ },
+ "page_size": {
+ "title": "page_size",
+ "type": "integer",
+ "default": 100,
+ "description": "Number of results per page (default 100, max 1000)"
+ },
+ "to_timestamp": {
+ "title": "to_timestamp",
+ "type": "integer",
+ "default": 18446744073709552000,
+ "description": "Latest timestamp to filter by (in ms since Unix epoch). If not provied, defaults to returning all data up to current time."
+ },
+ "tx_status": {
+ "title": "tx_status",
+ "type": "string",
+ "default": "settled",
+ "enum": ["settled", "reverted"],
+ "description": "Transaction status to filter by (default `settled`)."
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ }
+ },
+ "/public/get_transaction": {
+ "post": {
+ "tags": ["Public"],
+ "summary": "Get Transaction",
+ "description": "Used for getting a transaction by its transaction id",
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["status", "transaction_hash"],
+ "properties": {
+ "status": {
+ "title": "status",
+ "type": "string",
+ "enum": ["requested", "pending", "settled", "reverted", "ignored"],
+ "description": "Status of the transaction"
+ },
+ "transaction_hash": {
+ "title": "transaction_hash",
+ "type": "string",
+ "default": null,
+ "description": "Transaction hash of a pending tx",
+ "nullable": true
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ },
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["transaction_id"],
+ "properties": {
+ "transaction_id": {
+ "title": "transaction_id",
+ "type": "string",
+ "format": "uuid",
+ "description": "transaction_id of the transaction to get"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ }
+ },
+ "/public/get_margin": {
+ "post": {
+ "tags": ["Public"],
+ "summary": "Get Margin",
+ "description": "Calculates margin for a given portfolio and (optionally) a simulated state change. Does not take into account\nopen orders margin requirements.",
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": [
+ "is_valid_trade",
+ "post_initial_margin",
+ "post_maintenance_margin",
+ "pre_initial_margin",
+ "pre_maintenance_margin",
+ "subaccount_id"
+ ],
+ "properties": {
+ "is_valid_trade": {
+ "title": "is_valid_trade",
+ "type": "boolean",
+ "description": "True if trade passes margin requirement"
+ },
+ "post_initial_margin": {
+ "title": "post_initial_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "Initial margin requirement post trade"
+ },
+ "post_maintenance_margin": {
+ "title": "post_maintenance_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "Maintenance margin requirement post trade"
+ },
+ "pre_initial_margin": {
+ "title": "pre_initial_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "Initial margin requirement before trade"
+ },
+ "pre_maintenance_margin": {
+ "title": "pre_maintenance_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "Maintenance margin requirement before trade"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ },
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["margin_type", "simulated_positions"],
+ "properties": {
+ "margin_type": {
+ "title": "margin_type",
+ "type": "string",
+ "enum": ["PM", "SM"],
+ "description": "`PM` (Portfolio Margin) or `SM` (Standard Margin)"
+ },
+ "simulated_position_changes": {
+ "title": "simulated_position_changes",
+ "type": "array",
+ "default": null,
+ "description": "Optional, add positions to simulate a trade",
+ "items": {
+ "required": ["amount", "instrument_name"],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Position amount to simulate"
+ },
+ "entry_price": {
+ "title": "entry_price",
+ "type": "string",
+ "format": "decimal",
+ "default": null,
+ "description": "Only for perps. Entry price to use in the simulation. Mark price is used if not provided.",
+ "nullable": true
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "nullable": true
+ },
+ "simulated_positions": {
+ "title": "simulated_positions",
+ "type": "array",
+ "description": "List of positions in a simulated portfolio",
+ "items": {
+ "required": ["amount", "instrument_name"],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Position amount to simulate"
+ },
+ "entry_price": {
+ "title": "entry_price",
+ "type": "string",
+ "format": "decimal",
+ "default": null,
+ "description": "Only for perps. Entry price to use in the simulation. Mark price is used if not provided.",
+ "nullable": true
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ }
+ },
+ "/public/margin_watch": {
+ "post": {
+ "tags": ["Public"],
+ "summary": "Margin Watch",
+ "description": "Calculates MtM and maintenance margin for a given subaccount.",
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": [
+ "currency",
+ "maintenance_margin",
+ "margin_type",
+ "subaccount_id",
+ "subaccount_value",
+ "valuation_timestamp"
+ ],
+ "properties": {
+ "currency": {
+ "title": "currency",
+ "type": "string",
+ "description": "Currency of subaccount"
+ },
+ "maintenance_margin": {
+ "title": "maintenance_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total maintenance margin requirement of all positions and collaterals.If this value falls below zero, the subaccount will be flagged for liquidation."
+ },
+ "margin_type": {
+ "title": "margin_type",
+ "type": "string",
+ "enum": ["PM", "SM"],
+ "description": "Margin type of subaccount (`PM` (Portfolio Margin) or `SM` (Standard Margin))"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id"
+ },
+ "subaccount_value": {
+ "title": "subaccount_value",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total mark-to-market value of all positions and collaterals"
+ },
+ "valuation_timestamp": {
+ "title": "valuation_timestamp",
+ "type": "integer",
+ "description": "Timestamp (in seconds since epoch) of when margin and MtM were computed."
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ },
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["subaccount_id"],
+ "properties": {
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount ID to get margin for."
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ }
+ },
+ "/private/get_account": {
+ "post": {
+ "tags": ["Private"],
+ "summary": "Get Account",
+ "description": "Account details getter",
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": [
+ "cancel_on_disconnect",
+ "subaccount_ids",
+ "wallet",
+ "websocket_matching_tps",
+ "websocket_non_matching_tps"
+ ],
+ "properties": {
+ "cancel_on_disconnect": {
+ "title": "cancel_on_disconnect",
+ "type": "boolean",
+ "description": "Whether cancel on disconnect is enabled for the account"
+ },
+ "subaccount_ids": {
+ "title": "subaccount_ids",
+ "type": "array",
+ "description": "List of subaccount_ids owned by the wallet in `SubAccounts.sol`",
+ "items": {
+ "title": "subaccount_ids",
+ "type": "integer"
+ }
+ },
+ "wallet": {
+ "title": "wallet",
+ "type": "string",
+ "description": "Ethereum wallet address"
+ },
+ "websocket_matching_tps": {
+ "title": "websocket_matching_tps",
+ "type": "integer",
+ "description": "Max transactions per second for matching requests over websocket (see `Rate Limiting` in docs)"
+ },
+ "websocket_non_matching_tps": {
+ "title": "websocket_non_matching_tps",
+ "type": "integer",
+ "description": "Max transactions per second for non-matching requests over websocket (see `Rate Limiting` in docs)"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ },
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["wallet"],
+ "properties": {
+ "wallet": {
+ "title": "wallet",
+ "type": "string",
+ "description": "Ethereum wallet address of account"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ }
+ },
+ "/private/create_subaccount": {
+ "post": {
+ "tags": ["Private"],
+ "summary": "Create Subaccount",
+ "description": "Create a new subaccount under a given wallet, and deposit an asset into that subaccount.",
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["status", "transaction_id"],
+ "properties": {
+ "status": {
+ "title": "status",
+ "type": "string",
+ "description": "`requested`"
+ },
+ "transaction_id": {
+ "title": "transaction_id",
+ "type": "string",
+ "format": "uuid",
+ "description": "Transaction id of the request"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ },
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": [
+ "amount",
+ "asset_name",
+ "margin_type",
+ "nonce",
+ "signature",
+ "signature_expiry_sec",
+ "signer",
+ "wallet"
+ ],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Amount of the asset to deposit"
+ },
+ "asset_name": {
+ "title": "asset_name",
+ "type": "string",
+ "description": "Name of asset to deposit"
+ },
+ "currency": {
+ "title": "currency",
+ "type": "string",
+ "default": null,
+ "description": "Base currency of the subaccount (only for `PM`)",
+ "nullable": true
+ },
+ "margin_type": {
+ "title": "margin_type",
+ "type": "string",
+ "enum": ["PM", "SM"],
+ "description": "`PM` (Portfolio Margin) or `SM` (Standard Margin)"
+ },
+ "nonce": {
+ "title": "nonce",
+ "type": "integer",
+ "description": "Unique nonce defined as (e.g. 1695836058725001, where 001 is the random number)"
+ },
+ "signature": {
+ "title": "signature",
+ "type": "string",
+ "description": "Ethereum signature of the deposit"
+ },
+ "signature_expiry_sec": {
+ "title": "signature_expiry_sec",
+ "type": "integer",
+ "description": "Unix timestamp in seconds. Expiry MUST be >5min from now"
+ },
+ "signer": {
+ "title": "signer",
+ "type": "string",
+ "description": "Ethereum wallet address that is signing the deposit"
+ },
+ "wallet": {
+ "title": "wallet",
+ "type": "string",
+ "description": "Ethereum wallet address"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ }
+ },
+ "/public/create_subaccount_debug": {
+ "post": {
+ "tags": ["Public"],
+ "summary": "Create Subaccount Debug",
+ "description": "Used for debugging only, do not use in production. Will return the incremental encoded and hashed data.",
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["action_hash", "encoded_data", "encoded_data_hashed", "typed_data_hash"],
+ "properties": {
+ "action_hash": {
+ "title": "action_hash",
+ "type": "string",
+ "description": "Keccak hashed action data"
+ },
+ "encoded_data": {
+ "title": "encoded_data",
+ "type": "string",
+ "description": "ABI encoded deposit data"
+ },
+ "encoded_data_hashed": {
+ "title": "encoded_data_hashed",
+ "type": "string",
+ "description": "Keccak hashed encoded_data"
+ },
+ "typed_data_hash": {
+ "title": "typed_data_hash",
+ "type": "string",
+ "description": "EIP 712 typed data hash"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ },
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": [
+ "amount",
+ "asset_name",
+ "margin_type",
+ "nonce",
+ "signature_expiry_sec",
+ "signer",
+ "wallet"
+ ],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Amount of the asset to deposit"
+ },
+ "asset_name": {
+ "title": "asset_name",
+ "type": "string",
+ "description": "Name of asset to deposit"
+ },
+ "currency": {
+ "title": "currency",
+ "type": "string",
+ "default": null,
+ "description": "Base currency of the subaccount (only for `PM`)",
+ "nullable": true
+ },
+ "margin_type": {
+ "title": "margin_type",
+ "type": "string",
+ "enum": ["PM", "SM"],
+ "description": "`PM` (Portfolio Margin) or `SM` (Standard Margin)"
+ },
+ "nonce": {
+ "title": "nonce",
+ "type": "integer",
+ "description": "Unique nonce defined as (e.g. 1695836058725001, where 001 is the random number)"
+ },
+ "signature_expiry_sec": {
+ "title": "signature_expiry_sec",
+ "type": "integer",
+ "description": "Unix timestamp in seconds. Expiry MUST be >5min from now"
+ },
+ "signer": {
+ "title": "signer",
+ "type": "string",
+ "description": "Ethereum wallet address that is signing the deposit"
+ },
+ "wallet": {
+ "title": "wallet",
+ "type": "string",
+ "description": "Ethereum wallet address"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ }
+ },
+ "/private/get_subaccount": {
+ "post": {
+ "tags": ["Private"],
+ "summary": "Get Subaccount",
+ "description": "Get open orders, active positions, and collaterals of a subaccount",
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": [
+ "collaterals",
+ "collaterals_initial_margin",
+ "collaterals_maintenance_margin",
+ "collaterals_value",
+ "currency",
+ "initial_margin",
+ "maintenance_margin",
+ "margin_type",
+ "open_orders",
+ "open_orders_margin",
+ "positions",
+ "positions_initial_margin",
+ "positions_maintenance_margin",
+ "positions_value",
+ "subaccount_id",
+ "subaccount_value"
+ ],
+ "properties": {
+ "collaterals": {
+ "title": "collaterals",
+ "type": "array",
+ "description": "All collaterals that count towards margin of subaccount",
+ "items": {
+ "required": [
+ "amount",
+ "asset_name",
+ "asset_type",
+ "cumulative_interest",
+ "currency",
+ "initial_margin",
+ "maintenance_margin",
+ "mark_price",
+ "mark_value",
+ "pending_interest"
+ ],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Asset amount of given collateral"
+ },
+ "asset_name": {
+ "title": "asset_name",
+ "type": "string",
+ "description": "Asset name"
+ },
+ "asset_type": {
+ "title": "asset_type",
+ "type": "string",
+ "enum": ["erc20", "option", "perp"],
+ "description": "Type of asset collateral (currently always `erc20`)"
+ },
+ "cumulative_interest": {
+ "title": "cumulative_interest",
+ "type": "string",
+ "format": "decimal",
+ "description": "Cumulative interest earned on supplying collateral or paid for borrowing"
+ },
+ "currency": {
+ "title": "currency",
+ "type": "string",
+ "description": "Underlying currency of asset (`ETH`, `BTC`, etc)"
+ },
+ "initial_margin": {
+ "title": "initial_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "USD value of collateral that contributes to initial margin"
+ },
+ "maintenance_margin": {
+ "title": "maintenance_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "USD value of collateral that contributes to maintenance margin"
+ },
+ "mark_price": {
+ "title": "mark_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Current mark price of the asset"
+ },
+ "mark_value": {
+ "title": "mark_value",
+ "type": "string",
+ "format": "decimal",
+ "description": "USD value of the collateral (amount * mark price)"
+ },
+ "pending_interest": {
+ "title": "pending_interest",
+ "type": "string",
+ "format": "decimal",
+ "description": "Portion of interest that has not yet been settled on-chain. This number is added to the portfolio value for margin calculations purposes."
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "collaterals_initial_margin": {
+ "title": "collaterals_initial_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total initial margin credit contributed by collaterals"
+ },
+ "collaterals_maintenance_margin": {
+ "title": "collaterals_maintenance_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total maintenance margin credit contributed by collaterals"
+ },
+ "collaterals_value": {
+ "title": "collaterals_value",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total mark-to-market value of all collaterals"
+ },
+ "currency": {
+ "title": "currency",
+ "type": "string",
+ "description": "Currency of subaccount"
+ },
+ "initial_margin": {
+ "title": "initial_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total initial margin requirement of all positions and collaterals.Trades will be rejected if this value falls below zero after the trade."
+ },
+ "maintenance_margin": {
+ "title": "maintenance_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total maintenance margin requirement of all positions and collaterals.If this value falls below zero, the subaccount will be flagged for liquidation."
+ },
+ "margin_type": {
+ "title": "margin_type",
+ "type": "string",
+ "enum": ["PM", "SM"],
+ "description": "Margin type of subaccount (`PM` (Portfolio Margin) or `SM` (Standard Margin))"
+ },
+ "open_orders": {
+ "title": "open_orders",
+ "type": "array",
+ "description": "All open orders of subaccount",
+ "items": {
+ "required": [
+ "amount",
+ "average_price",
+ "cancel_reason",
+ "creation_timestamp",
+ "direction",
+ "filled_amount",
+ "instrument_name",
+ "is_transfer",
+ "label",
+ "last_update_timestamp",
+ "limit_price",
+ "max_fee",
+ "mmp",
+ "nonce",
+ "order_fee",
+ "order_id",
+ "order_status",
+ "order_type",
+ "signature",
+ "signature_expiry_sec",
+ "signer",
+ "subaccount_id",
+ "time_in_force"
+ ],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Order amount in units of the base"
+ },
+ "average_price": {
+ "title": "average_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Average fill price"
+ },
+ "cancel_reason": {
+ "title": "cancel_reason",
+ "type": "string",
+ "enum": [
+ "",
+ "user_request",
+ "mmp_trigger",
+ "insufficient_margin",
+ "signed_max_fee_too_low",
+ "cancel_on_disconnect",
+ "ioc_or_market_partial_fill",
+ "session_key_deregistered",
+ "subaccount_withdrawn",
+ "compliance"
+ ],
+ "description": "If cancelled, reason behind order cancellation"
+ },
+ "creation_timestamp": {
+ "title": "creation_timestamp",
+ "type": "integer",
+ "description": "Creation timestamp (in ms since Unix epoch)"
+ },
+ "direction": {
+ "title": "direction",
+ "type": "string",
+ "enum": ["buy", "sell"],
+ "description": "Order direction"
+ },
+ "filled_amount": {
+ "title": "filled_amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total filled amount for the order"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ },
+ "is_transfer": {
+ "title": "is_transfer",
+ "type": "boolean",
+ "description": "Whether the order was generated through `private/transfer_position`"
+ },
+ "label": {
+ "title": "label",
+ "type": "string",
+ "description": "Optional user-defined label for the order"
+ },
+ "last_update_timestamp": {
+ "title": "last_update_timestamp",
+ "type": "integer",
+ "description": "Last update timestamp (in ms since Unix epoch)"
+ },
+ "limit_price": {
+ "title": "limit_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Limit price in quote currency"
+ },
+ "max_fee": {
+ "title": "max_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Max fee in units of the quote currency"
+ },
+ "mmp": {
+ "title": "mmp",
+ "type": "boolean",
+ "description": "Whether the order is tagged for market maker protections"
+ },
+ "nonce": {
+ "title": "nonce",
+ "type": "integer",
+ "description": "Unique nonce defined as (e.g. 1695836058725001, where 001 is the random number)"
+ },
+ "order_fee": {
+ "title": "order_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total order fee paid so far"
+ },
+ "order_id": {
+ "title": "order_id",
+ "type": "string",
+ "description": "Order ID"
+ },
+ "order_status": {
+ "title": "order_status",
+ "type": "string",
+ "enum": ["open", "filled", "rejected", "cancelled", "expired"],
+ "description": "Order status"
+ },
+ "order_type": {
+ "title": "order_type",
+ "type": "string",
+ "enum": ["limit", "market"],
+ "description": "Order type"
+ },
+ "signature": {
+ "title": "signature",
+ "type": "string",
+ "description": "Ethereum signature of the order"
+ },
+ "signature_expiry_sec": {
+ "title": "signature_expiry_sec",
+ "type": "integer",
+ "description": "Signature expiry timestamp"
+ },
+ "signer": {
+ "title": "signer",
+ "type": "string",
+ "description": "Owner wallet address or registered session key that signed order"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount ID"
+ },
+ "time_in_force": {
+ "title": "time_in_force",
+ "type": "string",
+ "enum": ["gtc", "post_only", "fok", "ioc"],
+ "description": "Time in force"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "open_orders_margin": {
+ "title": "open_orders_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total margin requirement of all open orders.Orders will be rejected if this value plus initial margin are below zero after the order."
+ },
+ "positions": {
+ "title": "positions",
+ "type": "array",
+ "description": "All active positions of subaccount",
+ "items": {
+ "required": [
+ "amount",
+ "average_price",
+ "cumulative_funding",
+ "delta",
+ "gamma",
+ "index_price",
+ "initial_margin",
+ "instrument_name",
+ "instrument_type",
+ "leverage",
+ "liquidation_price",
+ "maintenance_margin",
+ "mark_price",
+ "mark_value",
+ "net_settlements",
+ "open_orders_margin",
+ "pending_funding",
+ "realized_pnl",
+ "theta",
+ "unrealized_pnl",
+ "vega"
+ ],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Position amount held by subaccount"
+ },
+ "average_price": {
+ "title": "average_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Average price of whole position"
+ },
+ "cumulative_funding": {
+ "title": "cumulative_funding",
+ "type": "string",
+ "format": "decimal",
+ "description": "Cumulative funding for the position (only for perpetuals)."
+ },
+ "delta": {
+ "title": "delta",
+ "type": "string",
+ "format": "decimal",
+ "description": "Asset delta (w.r.t. forward price for options, `1.0` for perps)"
+ },
+ "gamma": {
+ "title": "gamma",
+ "type": "string",
+ "format": "decimal",
+ "description": "Asset gamma (zero for non-options)"
+ },
+ "index_price": {
+ "title": "index_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Current index (oracle) price for position's currency"
+ },
+ "initial_margin": {
+ "title": "initial_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "USD initial margin requirement for this position"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name (same as the base Asset name)"
+ },
+ "instrument_type": {
+ "title": "instrument_type",
+ "type": "string",
+ "enum": ["erc20", "option", "perp"],
+ "description": "`erc20`, `option`, or `perp`"
+ },
+ "leverage": {
+ "title": "leverage",
+ "type": "string",
+ "format": "decimal",
+ "default": null,
+ "description": "Only for perps. Leverage of the position, defined as `abs(notional) / collateral net of options margin`",
+ "nullable": true
+ },
+ "liquidation_price": {
+ "title": "liquidation_price",
+ "type": "string",
+ "format": "decimal",
+ "default": null,
+ "description": "Index price at which position will be liquidated",
+ "nullable": true
+ },
+ "maintenance_margin": {
+ "title": "maintenance_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "USD maintenance margin requirement for this position"
+ },
+ "mark_price": {
+ "title": "mark_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Current mark price for position's instrument"
+ },
+ "mark_value": {
+ "title": "mark_value",
+ "type": "string",
+ "format": "decimal",
+ "description": "USD value of the position; this represents how much USD can be recieved by fully closing the position at the current oracle price"
+ },
+ "net_settlements": {
+ "title": "net_settlements",
+ "type": "string",
+ "format": "decimal",
+ "description": "Net amount of USD from position settlements that has been paid to the user's subaccount. This number is subtracted from the portfolio value for margin calculations purposes.
Positive values mean the user has recieved USD from settlements, or is awaiting settlement of USD losses. Negative values mean the user has paid USD for settlements, or is awaiting settlement of USD gains."
+ },
+ "open_orders_margin": {
+ "title": "open_orders_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "USD margin requirement for all open orders for this asset / instrument"
+ },
+ "pending_funding": {
+ "title": "pending_funding",
+ "type": "string",
+ "format": "decimal",
+ "description": "A portion of funding payments that has not yet been settled into cash balance (only for perpetuals). This number is added to the portfolio value for margin calculations purposes."
+ },
+ "realized_pnl": {
+ "title": "realized_pnl",
+ "type": "string",
+ "format": "decimal",
+ "description": "Realized trading profit or loss of the position."
+ },
+ "theta": {
+ "title": "theta",
+ "type": "string",
+ "format": "decimal",
+ "description": "Asset theta (zero for non-options)"
+ },
+ "unrealized_pnl": {
+ "title": "unrealized_pnl",
+ "type": "string",
+ "format": "decimal",
+ "description": "Unrealized trading profit or loss of the position."
+ },
+ "vega": {
+ "title": "vega",
+ "type": "string",
+ "format": "decimal",
+ "description": "Asset vega (zero for non-options)"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "positions_initial_margin": {
+ "title": "positions_initial_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total initial margin requirement of all positions"
+ },
+ "positions_maintenance_margin": {
+ "title": "positions_maintenance_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total maintenance margin requirement of all positions"
+ },
+ "positions_value": {
+ "title": "positions_value",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total mark-to-market value of all positions"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id"
+ },
+ "subaccount_value": {
+ "title": "subaccount_value",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total mark-to-market value of all positions and collaterals"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ },
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["subaccount_id"],
+ "properties": {
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ }
+ },
+ "/private/get_subaccounts": {
+ "post": {
+ "tags": ["Private"],
+ "summary": "Get Subaccounts",
+ "description": "Get all subaccounts of an account / wallet",
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["subaccount_ids", "wallet"],
+ "properties": {
+ "subaccount_ids": {
+ "title": "subaccount_ids",
+ "type": "array",
+ "description": "List of subaccount_ids owned by the wallet in `SubAccounts.sol`",
+ "items": {
+ "title": "subaccount_ids",
+ "type": "integer"
+ }
+ },
+ "wallet": {
+ "title": "wallet",
+ "type": "string",
+ "description": "Ethereum wallet address"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ },
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["wallet"],
+ "properties": {
+ "wallet": {
+ "title": "wallet",
+ "type": "string",
+ "description": "Ethereum wallet address of account"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ }
+ },
+ "/private/change_subaccount_label": {
+ "post": {
+ "tags": ["Private"],
+ "summary": "Change Subaccount Label",
+ "description": "Change a user defined label for given subaccount",
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["label", "subaccount_id"],
+ "properties": {
+ "label": {
+ "title": "label",
+ "type": "string",
+ "description": "User defined label"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ },
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["label", "subaccount_id"],
+ "properties": {
+ "label": {
+ "title": "label",
+ "type": "string",
+ "description": "User defined label"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ }
+ },
+ "/private/get_notifications": {
+ "post": {
+ "tags": ["Private"],
+ "summary": "Get Notifications",
+ "description": "Get the notifications related to a subaccount.",
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["notifications", "subaccount_id"],
+ "properties": {
+ "notifications": {
+ "title": "notifications",
+ "type": "array",
+ "description": "Notification response",
+ "items": {
+ "required": ["event", "event_details", "id", "status", "subaccount_id", "timestamp"],
+ "properties": {
+ "event": {
+ "title": "event",
+ "type": "string",
+ "description": "The specific event leading to the notification."
+ },
+ "event_details": {
+ "title": "event_details",
+ "type": "object",
+ "description": "A JSON-structured dictionary containing detailed data or context about the event.",
+ "additionalProperties": {}
+ },
+ "id": {
+ "title": "id",
+ "type": "integer",
+ "description": "The unique identifier for the notification."
+ },
+ "status": {
+ "title": "status",
+ "type": "string",
+ "description": "The status of the notification, indicating if it has been read, pending, or processed."
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "The subaccount_id associated with the notification."
+ },
+ "timestamp": {
+ "title": "timestamp",
+ "type": "integer",
+ "description": "The timestamp indicating when the notification was created or triggered."
+ },
+ "transaction_id": {
+ "title": "transaction_id",
+ "type": "integer",
+ "default": null,
+ "description": "The transaction id associated with the notification.",
+ "nullable": true
+ },
+ "tx_hash": {
+ "title": "tx_hash",
+ "type": "string",
+ "default": null,
+ "description": "The transaction hash associated with the notification.",
+ "nullable": true
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ },
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["subaccount_id"],
+ "properties": {
+ "page": {
+ "title": "page",
+ "type": "integer",
+ "default": 1,
+ "description": "Page number of results to return"
+ },
+ "page_size": {
+ "title": "page_size",
+ "type": "integer",
+ "default": 20,
+ "description": "Number of results per page"
+ },
+ "status": {
+ "title": "status",
+ "type": "string",
+ "default": null,
+ "enum": ["unseen", "seen", "hidden"],
+ "description": "Status of the notification",
+ "nullable": true
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id"
+ },
+ "type": {
+ "title": "type",
+ "type": "string",
+ "default": null,
+ "enum": ["deposit", "withdraw", "transfer", "trade", "settlement", "liquidation", "custom"],
+ "description": "Status of the notification",
+ "nullable": true
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ }
+ },
+ "/private/update_notifications": {
+ "post": {
+ "tags": ["Private"],
+ "summary": "Update Notifications",
+ "description": "RPC to mark specified notifications as seen for a given subaccount.",
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["updated_count"],
+ "properties": {
+ "updated_count": {
+ "title": "updated_count",
+ "type": "integer",
+ "description": "Number of notifications marked as seen"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ },
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["notification_ids", "subaccount_id"],
+ "properties": {
+ "notification_ids": {
+ "title": "notification_ids",
+ "type": "array",
+ "description": "List of notification IDs to be marked as seen",
+ "items": {
+ "title": "notification_ids",
+ "type": "integer"
+ }
+ },
+ "status": {
+ "title": "status",
+ "type": "string",
+ "default": "seen",
+ "enum": ["unseen", "seen", "hidden"],
+ "description": "Status of the notification"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ }
+ },
+ "/private/deposit": {
+ "post": {
+ "tags": ["Private"],
+ "summary": "Deposit",
+ "description": "Deposit an asset to a subaccount.",
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["status", "transaction_id"],
+ "properties": {
+ "status": {
+ "title": "status",
+ "type": "string",
+ "description": "`requested`"
+ },
+ "transaction_id": {
+ "title": "transaction_id",
+ "type": "string",
+ "format": "uuid",
+ "description": "Transaction id of the deposit"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ },
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": [
+ "amount",
+ "asset_name",
+ "nonce",
+ "signature",
+ "signature_expiry_sec",
+ "signer",
+ "subaccount_id"
+ ],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Amount of the asset to deposit"
+ },
+ "asset_name": {
+ "title": "asset_name",
+ "type": "string",
+ "description": "Name of asset to deposit"
+ },
+ "nonce": {
+ "title": "nonce",
+ "type": "integer",
+ "description": "Unique nonce defined as (e.g. 1695836058725001, where 001 is the random number)"
+ },
+ "signature": {
+ "title": "signature",
+ "type": "string",
+ "description": "Ethereum signature of the deposit"
+ },
+ "signature_expiry_sec": {
+ "title": "signature_expiry_sec",
+ "type": "integer",
+ "description": "Unix timestamp in seconds. Expiry MUST be >5min from now"
+ },
+ "signer": {
+ "title": "signer",
+ "type": "string",
+ "description": "Ethereum wallet address that is signing the deposit"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ }
+ },
+ "/private/withdraw": {
+ "post": {
+ "tags": ["Private"],
+ "summary": "Withdraw",
+ "description": "Withdraw an asset to wallet.",
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["status", "transaction_id"],
+ "properties": {
+ "status": {
+ "title": "status",
+ "type": "string",
+ "description": "`requested`"
+ },
+ "transaction_id": {
+ "title": "transaction_id",
+ "type": "string",
+ "format": "uuid",
+ "description": "Transaction id of the withdrawal"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ },
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": [
+ "amount",
+ "asset_name",
+ "nonce",
+ "signature",
+ "signature_expiry_sec",
+ "signer",
+ "subaccount_id"
+ ],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Amount of the asset to withdraw"
+ },
+ "asset_name": {
+ "title": "asset_name",
+ "type": "string",
+ "description": "Name of asset to withdraw"
+ },
+ "nonce": {
+ "title": "nonce",
+ "type": "integer",
+ "description": "Unique nonce defined as (e.g. 1695836058725001, where 001 is the random number)"
+ },
+ "signature": {
+ "title": "signature",
+ "type": "string",
+ "description": "Ethereum signature of the withdraw"
+ },
+ "signature_expiry_sec": {
+ "title": "signature_expiry_sec",
+ "type": "integer",
+ "description": "Unix timestamp in seconds. Expiry MUST be >5min from now"
+ },
+ "signer": {
+ "title": "signer",
+ "type": "string",
+ "description": "Ethereum wallet address that is signing the withdraw"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ }
+ },
+ "/private/transfer_erc20": {
+ "post": {
+ "tags": ["Private"],
+ "summary": "Transfer Erc20",
+ "description": "Transfer ERC20 assets from one subaccount to another (e.g. USDC or ETH).\n\nFor transfering positions (e.g. options or perps), use `private/transfer_position` instead.",
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["status", "transaction_id"],
+ "properties": {
+ "status": {
+ "title": "status",
+ "type": "string",
+ "description": "`requested`"
+ },
+ "transaction_id": {
+ "title": "transaction_id",
+ "type": "string",
+ "format": "uuid",
+ "description": "Transaction id of the transfer"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ },
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": [
+ "recipient_details",
+ "recipient_subaccount_id",
+ "sender_details",
+ "subaccount_id",
+ "transfer"
+ ],
+ "properties": {
+ "recipient_details": {
+ "required": ["nonce", "signature", "signature_expiry_sec", "signer"],
+ "properties": {
+ "nonce": {
+ "title": "nonce",
+ "type": "integer",
+ "description": "Unique nonce defined as (e.g. 1695836058725001, where 001 is the random number)"
+ },
+ "signature": {
+ "title": "signature",
+ "type": "string",
+ "description": "Ethereum signature of the transfer"
+ },
+ "signature_expiry_sec": {
+ "title": "signature_expiry_sec",
+ "type": "integer",
+ "description": "Unix timestamp in seconds. Expiry MUST be >5min from now"
+ },
+ "signer": {
+ "title": "signer",
+ "type": "string",
+ "description": "Ethereum wallet address that is signing the transfer"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "recipient_subaccount_id": {
+ "title": "recipient_subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id of the recipient"
+ },
+ "sender_details": {
+ "required": ["nonce", "signature", "signature_expiry_sec", "signer"],
+ "properties": {
+ "nonce": {
+ "title": "nonce",
+ "type": "integer",
+ "description": "Unique nonce defined as (e.g. 1695836058725001, where 001 is the random number)"
+ },
+ "signature": {
+ "title": "signature",
+ "type": "string",
+ "description": "Ethereum signature of the transfer"
+ },
+ "signature_expiry_sec": {
+ "title": "signature_expiry_sec",
+ "type": "integer",
+ "description": "Unix timestamp in seconds. Expiry MUST be >5min from now"
+ },
+ "signer": {
+ "title": "signer",
+ "type": "string",
+ "description": "Ethereum wallet address that is signing the transfer"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id"
+ },
+ "transfer": {
+ "required": ["address", "amount", "sub_id"],
+ "properties": {
+ "address": {
+ "title": "address",
+ "type": "string",
+ "description": "Ethereum address of the asset being transferred"
+ },
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Amount to transfer"
+ },
+ "sub_id": {
+ "title": "sub_id",
+ "type": "integer",
+ "description": "Sub ID of the asset being transferred"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ }
+ },
+ "/private/transfer_position": {
+ "post": {
+ "tags": ["Private"],
+ "summary": "Transfer Position",
+ "description": "Transfers a positions from one subaccount to another, owned by the same wallet.\n\nThe transfer is executed as a pair of orders crossing each other.\nThe maker order is created first, followed by a taker order crossing it.\nThe order amounts, limit prices and instrument name must be the same for both orders.\nFee is not charged and a zero `max_fee` must be signed.\nThe maker order is forcibly considered to be `reduce_only`, meaning it can only reduce the position size.\n\nHistory: For position transfer history, use the `private/get_trade_history` RPC (not `private/get_erc20_transfer_history`).",
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["maker_order", "maker_trade", "taker_order", "taker_trade"],
+ "properties": {
+ "maker_order": {
+ "required": [
+ "amount",
+ "average_price",
+ "cancel_reason",
+ "creation_timestamp",
+ "direction",
+ "filled_amount",
+ "instrument_name",
+ "is_transfer",
+ "label",
+ "last_update_timestamp",
+ "limit_price",
+ "max_fee",
+ "mmp",
+ "nonce",
+ "order_fee",
+ "order_id",
+ "order_status",
+ "order_type",
+ "signature",
+ "signature_expiry_sec",
+ "signer",
+ "subaccount_id",
+ "time_in_force"
+ ],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Order amount in units of the base"
+ },
+ "average_price": {
+ "title": "average_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Average fill price"
+ },
+ "cancel_reason": {
+ "title": "cancel_reason",
+ "type": "string",
+ "enum": [
+ "",
+ "user_request",
+ "mmp_trigger",
+ "insufficient_margin",
+ "signed_max_fee_too_low",
+ "cancel_on_disconnect",
+ "ioc_or_market_partial_fill",
+ "session_key_deregistered",
+ "subaccount_withdrawn",
+ "compliance"
+ ],
+ "description": "If cancelled, reason behind order cancellation"
+ },
+ "creation_timestamp": {
+ "title": "creation_timestamp",
+ "type": "integer",
+ "description": "Creation timestamp (in ms since Unix epoch)"
+ },
+ "direction": {
+ "title": "direction",
+ "type": "string",
+ "enum": ["buy", "sell"],
+ "description": "Order direction"
+ },
+ "filled_amount": {
+ "title": "filled_amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total filled amount for the order"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ },
+ "is_transfer": {
+ "title": "is_transfer",
+ "type": "boolean",
+ "description": "Whether the order was generated through `private/transfer_position`"
+ },
+ "label": {
+ "title": "label",
+ "type": "string",
+ "description": "Optional user-defined label for the order"
+ },
+ "last_update_timestamp": {
+ "title": "last_update_timestamp",
+ "type": "integer",
+ "description": "Last update timestamp (in ms since Unix epoch)"
+ },
+ "limit_price": {
+ "title": "limit_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Limit price in quote currency"
+ },
+ "max_fee": {
+ "title": "max_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Max fee in units of the quote currency"
+ },
+ "mmp": {
+ "title": "mmp",
+ "type": "boolean",
+ "description": "Whether the order is tagged for market maker protections"
+ },
+ "nonce": {
+ "title": "nonce",
+ "type": "integer",
+ "description": "Unique nonce defined as (e.g. 1695836058725001, where 001 is the random number)"
+ },
+ "order_fee": {
+ "title": "order_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total order fee paid so far"
+ },
+ "order_id": {
+ "title": "order_id",
+ "type": "string",
+ "description": "Order ID"
+ },
+ "order_status": {
+ "title": "order_status",
+ "type": "string",
+ "enum": ["open", "filled", "rejected", "cancelled", "expired"],
+ "description": "Order status"
+ },
+ "order_type": {
+ "title": "order_type",
+ "type": "string",
+ "enum": ["limit", "market"],
+ "description": "Order type"
+ },
+ "signature": {
+ "title": "signature",
+ "type": "string",
+ "description": "Ethereum signature of the order"
+ },
+ "signature_expiry_sec": {
+ "title": "signature_expiry_sec",
+ "type": "integer",
+ "description": "Signature expiry timestamp"
+ },
+ "signer": {
+ "title": "signer",
+ "type": "string",
+ "description": "Owner wallet address or registered session key that signed order"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount ID"
+ },
+ "time_in_force": {
+ "title": "time_in_force",
+ "type": "string",
+ "enum": ["gtc", "post_only", "fok", "ioc"],
+ "description": "Time in force"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "maker_trade": {
+ "required": [
+ "direction",
+ "index_price",
+ "instrument_name",
+ "is_transfer",
+ "label",
+ "liquidity_role",
+ "mark_price",
+ "order_id",
+ "realized_pnl",
+ "subaccount_id",
+ "timestamp",
+ "trade_amount",
+ "trade_fee",
+ "trade_id",
+ "trade_price",
+ "tx_hash",
+ "tx_status"
+ ],
+ "properties": {
+ "direction": {
+ "title": "direction",
+ "type": "string",
+ "enum": ["buy", "sell"],
+ "description": "Order direction"
+ },
+ "index_price": {
+ "title": "index_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Index price of the underlying at the time of the trade"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ },
+ "is_transfer": {
+ "title": "is_transfer",
+ "type": "boolean",
+ "description": "Whether the trade was generated through `private/transfer_position`"
+ },
+ "label": {
+ "title": "label",
+ "type": "string",
+ "description": "Optional user-defined label for the order"
+ },
+ "liquidity_role": {
+ "title": "liquidity_role",
+ "type": "string",
+ "enum": ["maker", "taker"],
+ "description": "Role of the user in the trade"
+ },
+ "mark_price": {
+ "title": "mark_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Mark price of the instrument at the time of the trade"
+ },
+ "order_id": {
+ "title": "order_id",
+ "type": "string",
+ "description": "Order ID"
+ },
+ "realized_pnl": {
+ "title": "realized_pnl",
+ "type": "string",
+ "format": "decimal",
+ "description": "Realized PnL for this trade"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount ID"
+ },
+ "timestamp": {
+ "title": "timestamp",
+ "type": "integer",
+ "description": "Trade timestamp (in ms since Unix epoch)"
+ },
+ "trade_amount": {
+ "title": "trade_amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Amount filled in this trade"
+ },
+ "trade_fee": {
+ "title": "trade_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Fee for this trade"
+ },
+ "trade_id": {
+ "title": "trade_id",
+ "type": "string",
+ "description": "Trade ID"
+ },
+ "trade_price": {
+ "title": "trade_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Price at which the trade was filled"
+ },
+ "tx_hash": {
+ "title": "tx_hash",
+ "type": "string",
+ "default": null,
+ "description": "Blockchain transaction hash",
+ "nullable": true
+ },
+ "tx_status": {
+ "title": "tx_status",
+ "type": "string",
+ "enum": ["requested", "pending", "settled", "reverted", "ignored"],
+ "description": "Blockchain transaction status"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "taker_order": {
+ "required": [
+ "amount",
+ "average_price",
+ "cancel_reason",
+ "creation_timestamp",
+ "direction",
+ "filled_amount",
+ "instrument_name",
+ "is_transfer",
+ "label",
+ "last_update_timestamp",
+ "limit_price",
+ "max_fee",
+ "mmp",
+ "nonce",
+ "order_fee",
+ "order_id",
+ "order_status",
+ "order_type",
+ "signature",
+ "signature_expiry_sec",
+ "signer",
+ "subaccount_id",
+ "time_in_force"
+ ],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Order amount in units of the base"
+ },
+ "average_price": {
+ "title": "average_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Average fill price"
+ },
+ "cancel_reason": {
+ "title": "cancel_reason",
+ "type": "string",
+ "enum": [
+ "",
+ "user_request",
+ "mmp_trigger",
+ "insufficient_margin",
+ "signed_max_fee_too_low",
+ "cancel_on_disconnect",
+ "ioc_or_market_partial_fill",
+ "session_key_deregistered",
+ "subaccount_withdrawn",
+ "compliance"
+ ],
+ "description": "If cancelled, reason behind order cancellation"
+ },
+ "creation_timestamp": {
+ "title": "creation_timestamp",
+ "type": "integer",
+ "description": "Creation timestamp (in ms since Unix epoch)"
+ },
+ "direction": {
+ "title": "direction",
+ "type": "string",
+ "enum": ["buy", "sell"],
+ "description": "Order direction"
+ },
+ "filled_amount": {
+ "title": "filled_amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total filled amount for the order"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ },
+ "is_transfer": {
+ "title": "is_transfer",
+ "type": "boolean",
+ "description": "Whether the order was generated through `private/transfer_position`"
+ },
+ "label": {
+ "title": "label",
+ "type": "string",
+ "description": "Optional user-defined label for the order"
+ },
+ "last_update_timestamp": {
+ "title": "last_update_timestamp",
+ "type": "integer",
+ "description": "Last update timestamp (in ms since Unix epoch)"
+ },
+ "limit_price": {
+ "title": "limit_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Limit price in quote currency"
+ },
+ "max_fee": {
+ "title": "max_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Max fee in units of the quote currency"
+ },
+ "mmp": {
+ "title": "mmp",
+ "type": "boolean",
+ "description": "Whether the order is tagged for market maker protections"
+ },
+ "nonce": {
+ "title": "nonce",
+ "type": "integer",
+ "description": "Unique nonce defined as (e.g. 1695836058725001, where 001 is the random number)"
+ },
+ "order_fee": {
+ "title": "order_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total order fee paid so far"
+ },
+ "order_id": {
+ "title": "order_id",
+ "type": "string",
+ "description": "Order ID"
+ },
+ "order_status": {
+ "title": "order_status",
+ "type": "string",
+ "enum": ["open", "filled", "rejected", "cancelled", "expired"],
+ "description": "Order status"
+ },
+ "order_type": {
+ "title": "order_type",
+ "type": "string",
+ "enum": ["limit", "market"],
+ "description": "Order type"
+ },
+ "signature": {
+ "title": "signature",
+ "type": "string",
+ "description": "Ethereum signature of the order"
+ },
+ "signature_expiry_sec": {
+ "title": "signature_expiry_sec",
+ "type": "integer",
+ "description": "Signature expiry timestamp"
+ },
+ "signer": {
+ "title": "signer",
+ "type": "string",
+ "description": "Owner wallet address or registered session key that signed order"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount ID"
+ },
+ "time_in_force": {
+ "title": "time_in_force",
+ "type": "string",
+ "enum": ["gtc", "post_only", "fok", "ioc"],
+ "description": "Time in force"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "taker_trade": {
+ "required": [
+ "direction",
+ "index_price",
+ "instrument_name",
+ "is_transfer",
+ "label",
+ "liquidity_role",
+ "mark_price",
+ "order_id",
+ "realized_pnl",
+ "subaccount_id",
+ "timestamp",
+ "trade_amount",
+ "trade_fee",
+ "trade_id",
+ "trade_price",
+ "tx_hash",
+ "tx_status"
+ ],
+ "properties": {
+ "direction": {
+ "title": "direction",
+ "type": "string",
+ "enum": ["buy", "sell"],
+ "description": "Order direction"
+ },
+ "index_price": {
+ "title": "index_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Index price of the underlying at the time of the trade"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ },
+ "is_transfer": {
+ "title": "is_transfer",
+ "type": "boolean",
+ "description": "Whether the trade was generated through `private/transfer_position`"
+ },
+ "label": {
+ "title": "label",
+ "type": "string",
+ "description": "Optional user-defined label for the order"
+ },
+ "liquidity_role": {
+ "title": "liquidity_role",
+ "type": "string",
+ "enum": ["maker", "taker"],
+ "description": "Role of the user in the trade"
+ },
+ "mark_price": {
+ "title": "mark_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Mark price of the instrument at the time of the trade"
+ },
+ "order_id": {
+ "title": "order_id",
+ "type": "string",
+ "description": "Order ID"
+ },
+ "realized_pnl": {
+ "title": "realized_pnl",
+ "type": "string",
+ "format": "decimal",
+ "description": "Realized PnL for this trade"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount ID"
+ },
+ "timestamp": {
+ "title": "timestamp",
+ "type": "integer",
+ "description": "Trade timestamp (in ms since Unix epoch)"
+ },
+ "trade_amount": {
+ "title": "trade_amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Amount filled in this trade"
+ },
+ "trade_fee": {
+ "title": "trade_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Fee for this trade"
+ },
+ "trade_id": {
+ "title": "trade_id",
+ "type": "string",
+ "description": "Trade ID"
+ },
+ "trade_price": {
+ "title": "trade_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Price at which the trade was filled"
+ },
+ "tx_hash": {
+ "title": "tx_hash",
+ "type": "string",
+ "default": null,
+ "description": "Blockchain transaction hash",
+ "nullable": true
+ },
+ "tx_status": {
+ "title": "tx_status",
+ "type": "string",
+ "enum": ["requested", "pending", "settled", "reverted", "ignored"],
+ "description": "Blockchain transaction status"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ },
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["maker_params", "taker_params", "wallet"],
+ "properties": {
+ "maker_params": {
+ "required": [
+ "amount",
+ "direction",
+ "instrument_name",
+ "limit_price",
+ "max_fee",
+ "nonce",
+ "signature",
+ "signature_expiry_sec",
+ "signer",
+ "subaccount_id"
+ ],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Order amount in units of the base"
+ },
+ "direction": {
+ "title": "direction",
+ "type": "string",
+ "enum": ["buy", "sell"],
+ "description": "Order direction"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ },
+ "limit_price": {
+ "title": "limit_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Limit price in quote currency.
This field is still required for market orders because it is a component of the signature. However, market orders will not leave a resting order in the book in case of a partial fill."
+ },
+ "max_fee": {
+ "title": "max_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Max fee in units of the quote currency. Order will be rejected if the supplied max fee is below the estimated fee for this order."
+ },
+ "nonce": {
+ "title": "nonce",
+ "type": "integer",
+ "description": "Unique nonce defined as (e.g. 1695836058725001, where 001 is the random number)"
+ },
+ "signature": {
+ "title": "signature",
+ "type": "string",
+ "description": "Etherium signature of the order"
+ },
+ "signature_expiry_sec": {
+ "title": "signature_expiry_sec",
+ "type": "integer",
+ "description": "Unix timestamp in seconds. Order signature becomes invalid after this time, and the system will cancel the order.Expiry MUST be at least 5 min from now."
+ },
+ "signer": {
+ "title": "signer",
+ "type": "string",
+ "description": "Owner wallet address or registered session key that signed order"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount ID"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "taker_params": {
+ "required": [
+ "amount",
+ "direction",
+ "instrument_name",
+ "limit_price",
+ "max_fee",
+ "nonce",
+ "signature",
+ "signature_expiry_sec",
+ "signer",
+ "subaccount_id"
+ ],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Order amount in units of the base"
+ },
+ "direction": {
+ "title": "direction",
+ "type": "string",
+ "enum": ["buy", "sell"],
+ "description": "Order direction"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ },
+ "limit_price": {
+ "title": "limit_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Limit price in quote currency.
This field is still required for market orders because it is a component of the signature. However, market orders will not leave a resting order in the book in case of a partial fill."
+ },
+ "max_fee": {
+ "title": "max_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Max fee in units of the quote currency. Order will be rejected if the supplied max fee is below the estimated fee for this order."
+ },
+ "nonce": {
+ "title": "nonce",
+ "type": "integer",
+ "description": "Unique nonce defined as (e.g. 1695836058725001, where 001 is the random number)"
+ },
+ "signature": {
+ "title": "signature",
+ "type": "string",
+ "description": "Etherium signature of the order"
+ },
+ "signature_expiry_sec": {
+ "title": "signature_expiry_sec",
+ "type": "integer",
+ "description": "Unix timestamp in seconds. Order signature becomes invalid after this time, and the system will cancel the order.Expiry MUST be at least 5 min from now."
+ },
+ "signer": {
+ "title": "signer",
+ "type": "string",
+ "description": "Owner wallet address or registered session key that signed order"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount ID"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "wallet": {
+ "title": "wallet",
+ "type": "string",
+ "description": "Public key (wallet) of the account"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ }
+ },
+ "/private/order": {
+ "post": {
+ "tags": ["Private"],
+ "summary": "Order",
+ "description": "Create a new order",
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["order", "trades"],
+ "properties": {
+ "order": {
+ "required": [
+ "amount",
+ "average_price",
+ "cancel_reason",
+ "creation_timestamp",
+ "direction",
+ "filled_amount",
+ "instrument_name",
+ "is_transfer",
+ "label",
+ "last_update_timestamp",
+ "limit_price",
+ "max_fee",
+ "mmp",
+ "nonce",
+ "order_fee",
+ "order_id",
+ "order_status",
+ "order_type",
+ "signature",
+ "signature_expiry_sec",
+ "signer",
+ "subaccount_id",
+ "time_in_force"
+ ],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Order amount in units of the base"
+ },
+ "average_price": {
+ "title": "average_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Average fill price"
+ },
+ "cancel_reason": {
+ "title": "cancel_reason",
+ "type": "string",
+ "enum": [
+ "",
+ "user_request",
+ "mmp_trigger",
+ "insufficient_margin",
+ "signed_max_fee_too_low",
+ "cancel_on_disconnect",
+ "ioc_or_market_partial_fill",
+ "session_key_deregistered",
+ "subaccount_withdrawn",
+ "compliance"
+ ],
+ "description": "If cancelled, reason behind order cancellation"
+ },
+ "creation_timestamp": {
+ "title": "creation_timestamp",
+ "type": "integer",
+ "description": "Creation timestamp (in ms since Unix epoch)"
+ },
+ "direction": {
+ "title": "direction",
+ "type": "string",
+ "enum": ["buy", "sell"],
+ "description": "Order direction"
+ },
+ "filled_amount": {
+ "title": "filled_amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total filled amount for the order"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ },
+ "is_transfer": {
+ "title": "is_transfer",
+ "type": "boolean",
+ "description": "Whether the order was generated through `private/transfer_position`"
+ },
+ "label": {
+ "title": "label",
+ "type": "string",
+ "description": "Optional user-defined label for the order"
+ },
+ "last_update_timestamp": {
+ "title": "last_update_timestamp",
+ "type": "integer",
+ "description": "Last update timestamp (in ms since Unix epoch)"
+ },
+ "limit_price": {
+ "title": "limit_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Limit price in quote currency"
+ },
+ "max_fee": {
+ "title": "max_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Max fee in units of the quote currency"
+ },
+ "mmp": {
+ "title": "mmp",
+ "type": "boolean",
+ "description": "Whether the order is tagged for market maker protections"
+ },
+ "nonce": {
+ "title": "nonce",
+ "type": "integer",
+ "description": "Unique nonce defined as (e.g. 1695836058725001, where 001 is the random number)"
+ },
+ "order_fee": {
+ "title": "order_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total order fee paid so far"
+ },
+ "order_id": {
+ "title": "order_id",
+ "type": "string",
+ "description": "Order ID"
+ },
+ "order_status": {
+ "title": "order_status",
+ "type": "string",
+ "enum": ["open", "filled", "rejected", "cancelled", "expired"],
+ "description": "Order status"
+ },
+ "order_type": {
+ "title": "order_type",
+ "type": "string",
+ "enum": ["limit", "market"],
+ "description": "Order type"
+ },
+ "signature": {
+ "title": "signature",
+ "type": "string",
+ "description": "Ethereum signature of the order"
+ },
+ "signature_expiry_sec": {
+ "title": "signature_expiry_sec",
+ "type": "integer",
+ "description": "Signature expiry timestamp"
+ },
+ "signer": {
+ "title": "signer",
+ "type": "string",
+ "description": "Owner wallet address or registered session key that signed order"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount ID"
+ },
+ "time_in_force": {
+ "title": "time_in_force",
+ "type": "string",
+ "enum": ["gtc", "post_only", "fok", "ioc"],
+ "description": "Time in force"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "trades": {
+ "title": "trades",
+ "type": "array",
+ "items": {
+ "required": [
+ "direction",
+ "index_price",
+ "instrument_name",
+ "is_transfer",
+ "label",
+ "liquidity_role",
+ "mark_price",
+ "order_id",
+ "realized_pnl",
+ "subaccount_id",
+ "timestamp",
+ "trade_amount",
+ "trade_fee",
+ "trade_id",
+ "trade_price",
+ "tx_hash",
+ "tx_status"
+ ],
+ "properties": {
+ "direction": {
+ "title": "direction",
+ "type": "string",
+ "enum": ["buy", "sell"],
+ "description": "Order direction"
+ },
+ "index_price": {
+ "title": "index_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Index price of the underlying at the time of the trade"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ },
+ "is_transfer": {
+ "title": "is_transfer",
+ "type": "boolean",
+ "description": "Whether the trade was generated through `private/transfer_position`"
+ },
+ "label": {
+ "title": "label",
+ "type": "string",
+ "description": "Optional user-defined label for the order"
+ },
+ "liquidity_role": {
+ "title": "liquidity_role",
+ "type": "string",
+ "enum": ["maker", "taker"],
+ "description": "Role of the user in the trade"
+ },
+ "mark_price": {
+ "title": "mark_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Mark price of the instrument at the time of the trade"
+ },
+ "order_id": {
+ "title": "order_id",
+ "type": "string",
+ "description": "Order ID"
+ },
+ "realized_pnl": {
+ "title": "realized_pnl",
+ "type": "string",
+ "format": "decimal",
+ "description": "Realized PnL for this trade"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount ID"
+ },
+ "timestamp": {
+ "title": "timestamp",
+ "type": "integer",
+ "description": "Trade timestamp (in ms since Unix epoch)"
+ },
+ "trade_amount": {
+ "title": "trade_amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Amount filled in this trade"
+ },
+ "trade_fee": {
+ "title": "trade_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Fee for this trade"
+ },
+ "trade_id": {
+ "title": "trade_id",
+ "type": "string",
+ "description": "Trade ID"
+ },
+ "trade_price": {
+ "title": "trade_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Price at which the trade was filled"
+ },
+ "tx_hash": {
+ "title": "tx_hash",
+ "type": "string",
+ "default": null,
+ "description": "Blockchain transaction hash",
+ "nullable": true
+ },
+ "tx_status": {
+ "title": "tx_status",
+ "type": "string",
+ "enum": ["requested", "pending", "settled", "reverted", "ignored"],
+ "description": "Blockchain transaction status"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ },
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": [
+ "amount",
+ "direction",
+ "instrument_name",
+ "limit_price",
+ "max_fee",
+ "nonce",
+ "signature",
+ "signature_expiry_sec",
+ "signer",
+ "subaccount_id"
+ ],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Order amount in units of the base"
+ },
+ "direction": {
+ "title": "direction",
+ "type": "string",
+ "enum": ["buy", "sell"],
+ "description": "Order direction"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ },
+ "label": {
+ "title": "label",
+ "type": "string",
+ "default": "",
+ "description": "Optional user-defined label for the order"
+ },
+ "limit_price": {
+ "title": "limit_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Limit price in quote currency.
This field is still required for market orders because it is a component of the signature. However, market orders will not leave a resting order in the book in case of a partial fill."
+ },
+ "max_fee": {
+ "title": "max_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Max fee in units of the quote currency. Order will be rejected if the supplied max fee is below the estimated fee for this order."
+ },
+ "mmp": {
+ "title": "mmp",
+ "type": "boolean",
+ "default": false,
+ "description": "Whether the order is tagged for market maker protections (default false)"
+ },
+ "nonce": {
+ "title": "nonce",
+ "type": "integer",
+ "description": "Unique nonce defined as (e.g. 1695836058725001, where 001 is the random number)"
+ },
+ "order_type": {
+ "title": "order_type",
+ "type": "string",
+ "default": "limit",
+ "enum": ["limit", "market"],
+ "description": "Order type:
- `limit`: limit order (default)
- `market`: market order, note that limit_price is still required for market orders, but unfilled order portion will be marked as cancelled"
+ },
+ "reduce_only": {
+ "title": "reduce_only",
+ "type": "boolean",
+ "default": false,
+ "description": "If true, the order will not be able to increase position's size (default false). If the order amount exceeds available position size, the order will be filled up to the position size and the remainder will be cancelled. This flag is only supported for market orders or non-resting limit orders (IOC or FOK)"
+ },
+ "referral_code": {
+ "title": "referral_code",
+ "type": "string",
+ "default": "",
+ "description": "Optional referral code for the order"
+ },
+ "reject_timestamp": {
+ "title": "reject_timestamp",
+ "type": "integer",
+ "default": 9223372036854776000,
+ "description": "UTC timestamp in ms, if provided the matching engine will reject the order with an error if `reject_timestamp` < `server_time`. Note that the timestamp must be consistent with the server time: use `public/get_time` method to obtain current server time."
+ },
+ "signature": {
+ "title": "signature",
+ "type": "string",
+ "description": "Etherium signature of the order"
+ },
+ "signature_expiry_sec": {
+ "title": "signature_expiry_sec",
+ "type": "integer",
+ "description": "Unix timestamp in seconds. Order signature becomes invalid after this time, and the system will cancel the order.Expiry MUST be at least 5 min from now."
+ },
+ "signer": {
+ "title": "signer",
+ "type": "string",
+ "description": "Owner wallet address or registered session key that signed order"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount ID"
+ },
+ "time_in_force": {
+ "title": "time_in_force",
+ "type": "string",
+ "default": "gtc",
+ "enum": ["gtc", "post_only", "fok", "ioc"],
+ "description": "Time in force behaviour:
- `gtc`: good til cancelled (default)
- `post_only`: a limit order that will be rejected if it crosses any order in the book, i.e. acts as a taker order
- `fok`: fill or kill, will be rejected if it is not fully filled
- `ioc`: immediate or cancel, fill at best bid/ask (market) or at limit price (limit), the unfilled portion is cancelled
Note that the order will still expire on the `signature_expiry_sec` timestamp."
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ }
+ },
+ "/private/order_debug": {
+ "post": {
+ "tags": ["Private"],
+ "summary": "Order Debug",
+ "description": "Debug a new order",
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["action_hash", "encoded_data", "encoded_data_hashed", "raw_data", "typed_data_hash"],
+ "properties": {
+ "action_hash": {
+ "title": "action_hash",
+ "type": "string",
+ "description": "Keccak hashed action data"
+ },
+ "encoded_data": {
+ "title": "encoded_data",
+ "type": "string",
+ "description": "ABI encoded order data"
+ },
+ "encoded_data_hashed": {
+ "title": "encoded_data_hashed",
+ "type": "string",
+ "description": "Keccak hashed encoded_data"
+ },
+ "raw_data": {
+ "required": [
+ "data",
+ "expiry",
+ "module",
+ "nonce",
+ "owner",
+ "signature",
+ "signer",
+ "subaccount_id"
+ ],
+ "properties": {
+ "data": {
+ "required": [
+ "asset",
+ "desired_amount",
+ "is_bid",
+ "limit_price",
+ "recipient_id",
+ "sub_id",
+ "trade_id",
+ "worst_fee"
+ ],
+ "properties": {
+ "asset": {
+ "title": "asset",
+ "type": "string"
+ },
+ "desired_amount": {
+ "title": "desired_amount",
+ "type": "string",
+ "format": "decimal"
+ },
+ "is_bid": {
+ "title": "is_bid",
+ "type": "boolean"
+ },
+ "limit_price": {
+ "title": "limit_price",
+ "type": "string",
+ "format": "decimal"
+ },
+ "recipient_id": {
+ "title": "recipient_id",
+ "type": "integer"
+ },
+ "sub_id": {
+ "title": "sub_id",
+ "type": "integer"
+ },
+ "trade_id": {
+ "title": "trade_id",
+ "type": "string"
+ },
+ "worst_fee": {
+ "title": "worst_fee",
+ "type": "string",
+ "format": "decimal"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "expiry": {
+ "title": "expiry",
+ "type": "integer"
+ },
+ "module": {
+ "title": "module",
+ "type": "string"
+ },
+ "nonce": {
+ "title": "nonce",
+ "type": "integer"
+ },
+ "owner": {
+ "title": "owner",
+ "type": "string"
+ },
+ "signature": {
+ "title": "signature",
+ "type": "string"
+ },
+ "signer": {
+ "title": "signer",
+ "type": "string"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "typed_data_hash": {
+ "title": "typed_data_hash",
+ "type": "string",
+ "description": "EIP 712 typed data hash"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ },
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": [
+ "amount",
+ "direction",
+ "instrument_name",
+ "limit_price",
+ "max_fee",
+ "nonce",
+ "signature",
+ "signature_expiry_sec",
+ "signer",
+ "subaccount_id"
+ ],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Order amount in units of the base"
+ },
+ "direction": {
+ "title": "direction",
+ "type": "string",
+ "enum": ["buy", "sell"],
+ "description": "Order direction"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ },
+ "label": {
+ "title": "label",
+ "type": "string",
+ "default": "",
+ "description": "Optional user-defined label for the order"
+ },
+ "limit_price": {
+ "title": "limit_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Limit price in quote currency.
This field is still required for market orders because it is a component of the signature. However, market orders will not leave a resting order in the book in case of a partial fill."
+ },
+ "max_fee": {
+ "title": "max_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Max fee in units of the quote currency. Order will be rejected if the supplied max fee is below the estimated fee for this order."
+ },
+ "mmp": {
+ "title": "mmp",
+ "type": "boolean",
+ "default": false,
+ "description": "Whether the order is tagged for market maker protections (default false)"
+ },
+ "nonce": {
+ "title": "nonce",
+ "type": "integer",
+ "description": "Unique nonce defined as (e.g. 1695836058725001, where 001 is the random number)"
+ },
+ "order_type": {
+ "title": "order_type",
+ "type": "string",
+ "default": "limit",
+ "enum": ["limit", "market"],
+ "description": "Order type:
- `limit`: limit order (default)
- `market`: market order, note that limit_price is still required for market orders, but unfilled order portion will be marked as cancelled"
+ },
+ "reduce_only": {
+ "title": "reduce_only",
+ "type": "boolean",
+ "default": false,
+ "description": "If true, the order will not be able to increase position's size (default false). If the order amount exceeds available position size, the order will be filled up to the position size and the remainder will be cancelled. This flag is only supported for market orders or non-resting limit orders (IOC or FOK)"
+ },
+ "referral_code": {
+ "title": "referral_code",
+ "type": "string",
+ "default": "",
+ "description": "Optional referral code for the order"
+ },
+ "reject_timestamp": {
+ "title": "reject_timestamp",
+ "type": "integer",
+ "default": 9223372036854776000,
+ "description": "UTC timestamp in ms, if provided the matching engine will reject the order with an error if `reject_timestamp` < `server_time`. Note that the timestamp must be consistent with the server time: use `public/get_time` method to obtain current server time."
+ },
+ "signature": {
+ "title": "signature",
+ "type": "string",
+ "description": "Etherium signature of the order"
+ },
+ "signature_expiry_sec": {
+ "title": "signature_expiry_sec",
+ "type": "integer",
+ "description": "Unix timestamp in seconds. Order signature becomes invalid after this time, and the system will cancel the order.Expiry MUST be at least 5 min from now."
+ },
+ "signer": {
+ "title": "signer",
+ "type": "string",
+ "description": "Owner wallet address or registered session key that signed order"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount ID"
+ },
+ "time_in_force": {
+ "title": "time_in_force",
+ "type": "string",
+ "default": "gtc",
+ "enum": ["gtc", "post_only", "fok", "ioc"],
+ "description": "Time in force behaviour:
- `gtc`: good til cancelled (default)
- `post_only`: a limit order that will be rejected if it crosses any order in the book, i.e. acts as a taker order
- `fok`: fill or kill, will be rejected if it is not fully filled
- `ioc`: immediate or cancel, fill at best bid/ask (market) or at limit price (limit), the unfilled portion is cancelled
Note that the order will still expire on the `signature_expiry_sec` timestamp."
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ }
+ },
+ "/private/get_order": {
+ "post": {
+ "tags": ["Private"],
+ "summary": "Get Order",
+ "description": "Get state of an order by order id",
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": [
+ "amount",
+ "average_price",
+ "cancel_reason",
+ "creation_timestamp",
+ "direction",
+ "filled_amount",
+ "instrument_name",
+ "is_transfer",
+ "label",
+ "last_update_timestamp",
+ "limit_price",
+ "max_fee",
+ "mmp",
+ "nonce",
+ "order_fee",
+ "order_id",
+ "order_status",
+ "order_type",
+ "signature",
+ "signature_expiry_sec",
+ "signer",
+ "subaccount_id",
+ "time_in_force"
+ ],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Order amount in units of the base"
+ },
+ "average_price": {
+ "title": "average_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Average fill price"
+ },
+ "cancel_reason": {
+ "title": "cancel_reason",
+ "type": "string",
+ "enum": [
+ "",
+ "user_request",
+ "mmp_trigger",
+ "insufficient_margin",
+ "signed_max_fee_too_low",
+ "cancel_on_disconnect",
+ "ioc_or_market_partial_fill",
+ "session_key_deregistered",
+ "subaccount_withdrawn",
+ "compliance"
+ ],
+ "description": "If cancelled, reason behind order cancellation"
+ },
+ "creation_timestamp": {
+ "title": "creation_timestamp",
+ "type": "integer",
+ "description": "Creation timestamp (in ms since Unix epoch)"
+ },
+ "direction": {
+ "title": "direction",
+ "type": "string",
+ "enum": ["buy", "sell"],
+ "description": "Order direction"
+ },
+ "filled_amount": {
+ "title": "filled_amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total filled amount for the order"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ },
+ "is_transfer": {
+ "title": "is_transfer",
+ "type": "boolean",
+ "description": "Whether the order was generated through `private/transfer_position`"
+ },
+ "label": {
+ "title": "label",
+ "type": "string",
+ "description": "Optional user-defined label for the order"
+ },
+ "last_update_timestamp": {
+ "title": "last_update_timestamp",
+ "type": "integer",
+ "description": "Last update timestamp (in ms since Unix epoch)"
+ },
+ "limit_price": {
+ "title": "limit_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Limit price in quote currency"
+ },
+ "max_fee": {
+ "title": "max_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Max fee in units of the quote currency"
+ },
+ "mmp": {
+ "title": "mmp",
+ "type": "boolean",
+ "description": "Whether the order is tagged for market maker protections"
+ },
+ "nonce": {
+ "title": "nonce",
+ "type": "integer",
+ "description": "Unique nonce defined as (e.g. 1695836058725001, where 001 is the random number)"
+ },
+ "order_fee": {
+ "title": "order_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total order fee paid so far"
+ },
+ "order_id": {
+ "title": "order_id",
+ "type": "string",
+ "description": "Order ID"
+ },
+ "order_status": {
+ "title": "order_status",
+ "type": "string",
+ "enum": ["open", "filled", "rejected", "cancelled", "expired"],
+ "description": "Order status"
+ },
+ "order_type": {
+ "title": "order_type",
+ "type": "string",
+ "enum": ["limit", "market"],
+ "description": "Order type"
+ },
+ "signature": {
+ "title": "signature",
+ "type": "string",
+ "description": "Ethereum signature of the order"
+ },
+ "signature_expiry_sec": {
+ "title": "signature_expiry_sec",
+ "type": "integer",
+ "description": "Signature expiry timestamp"
+ },
+ "signer": {
+ "title": "signer",
+ "type": "string",
+ "description": "Owner wallet address or registered session key that signed order"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount ID"
+ },
+ "time_in_force": {
+ "title": "time_in_force",
+ "type": "string",
+ "enum": ["gtc", "post_only", "fok", "ioc"],
+ "description": "Time in force"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ },
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["order_id", "subaccount_id"],
+ "properties": {
+ "order_id": {
+ "title": "order_id",
+ "type": "string",
+ "description": "Order ID"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount ID"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ }
+ },
+ "/private/get_orders": {
+ "post": {
+ "tags": ["Private"],
+ "summary": "Get Orders",
+ "description": "Get orders for a subaccount, with optional filtering.",
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["orders", "pagination", "subaccount_id"],
+ "properties": {
+ "orders": {
+ "title": "orders",
+ "type": "array",
+ "description": "List of open orders",
+ "items": {
+ "required": [
+ "amount",
+ "average_price",
+ "cancel_reason",
+ "creation_timestamp",
+ "direction",
+ "filled_amount",
+ "instrument_name",
+ "is_transfer",
+ "label",
+ "last_update_timestamp",
+ "limit_price",
+ "max_fee",
+ "mmp",
+ "nonce",
+ "order_fee",
+ "order_id",
+ "order_status",
+ "order_type",
+ "signature",
+ "signature_expiry_sec",
+ "signer",
+ "subaccount_id",
+ "time_in_force"
+ ],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Order amount in units of the base"
+ },
+ "average_price": {
+ "title": "average_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Average fill price"
+ },
+ "cancel_reason": {
+ "title": "cancel_reason",
+ "type": "string",
+ "enum": [
+ "",
+ "user_request",
+ "mmp_trigger",
+ "insufficient_margin",
+ "signed_max_fee_too_low",
+ "cancel_on_disconnect",
+ "ioc_or_market_partial_fill",
+ "session_key_deregistered",
+ "subaccount_withdrawn",
+ "compliance"
+ ],
+ "description": "If cancelled, reason behind order cancellation"
+ },
+ "creation_timestamp": {
+ "title": "creation_timestamp",
+ "type": "integer",
+ "description": "Creation timestamp (in ms since Unix epoch)"
+ },
+ "direction": {
+ "title": "direction",
+ "type": "string",
+ "enum": ["buy", "sell"],
+ "description": "Order direction"
+ },
+ "filled_amount": {
+ "title": "filled_amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total filled amount for the order"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ },
+ "is_transfer": {
+ "title": "is_transfer",
+ "type": "boolean",
+ "description": "Whether the order was generated through `private/transfer_position`"
+ },
+ "label": {
+ "title": "label",
+ "type": "string",
+ "description": "Optional user-defined label for the order"
+ },
+ "last_update_timestamp": {
+ "title": "last_update_timestamp",
+ "type": "integer",
+ "description": "Last update timestamp (in ms since Unix epoch)"
+ },
+ "limit_price": {
+ "title": "limit_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Limit price in quote currency"
+ },
+ "max_fee": {
+ "title": "max_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Max fee in units of the quote currency"
+ },
+ "mmp": {
+ "title": "mmp",
+ "type": "boolean",
+ "description": "Whether the order is tagged for market maker protections"
+ },
+ "nonce": {
+ "title": "nonce",
+ "type": "integer",
+ "description": "Unique nonce defined as (e.g. 1695836058725001, where 001 is the random number)"
+ },
+ "order_fee": {
+ "title": "order_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total order fee paid so far"
+ },
+ "order_id": {
+ "title": "order_id",
+ "type": "string",
+ "description": "Order ID"
+ },
+ "order_status": {
+ "title": "order_status",
+ "type": "string",
+ "enum": ["open", "filled", "rejected", "cancelled", "expired"],
+ "description": "Order status"
+ },
+ "order_type": {
+ "title": "order_type",
+ "type": "string",
+ "enum": ["limit", "market"],
+ "description": "Order type"
+ },
+ "signature": {
+ "title": "signature",
+ "type": "string",
+ "description": "Ethereum signature of the order"
+ },
+ "signature_expiry_sec": {
+ "title": "signature_expiry_sec",
+ "type": "integer",
+ "description": "Signature expiry timestamp"
+ },
+ "signer": {
+ "title": "signer",
+ "type": "string",
+ "description": "Owner wallet address or registered session key that signed order"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount ID"
+ },
+ "time_in_force": {
+ "title": "time_in_force",
+ "type": "string",
+ "enum": ["gtc", "post_only", "fok", "ioc"],
+ "description": "Time in force"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "pagination": {
+ "required": ["count", "num_pages"],
+ "properties": {
+ "count": {
+ "title": "count",
+ "type": "integer",
+ "description": "Total number of items, across all pages"
+ },
+ "num_pages": {
+ "title": "num_pages",
+ "type": "integer",
+ "description": "Number of pages"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id for which to get open orders"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ },
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["subaccount_id"],
+ "properties": {
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "default": null,
+ "description": "Filter by instrument name",
+ "nullable": true
+ },
+ "label": {
+ "title": "label",
+ "type": "string",
+ "default": null,
+ "description": "Filter by label",
+ "nullable": true
+ },
+ "page": {
+ "title": "page",
+ "type": "integer",
+ "default": 1,
+ "description": "Page number of results to return (default 1, returns last if above `num_pages`)"
+ },
+ "page_size": {
+ "title": "page_size",
+ "type": "integer",
+ "default": 100,
+ "description": "Number of results per page (default 100, max 1000)"
+ },
+ "status": {
+ "title": "status",
+ "type": "string",
+ "default": null,
+ "enum": ["open", "filled", "rejected", "cancelled", "expired"],
+ "description": "Filter by order status",
+ "nullable": true
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id for which to get open orders"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ }
+ },
+ "/private/get_open_orders": {
+ "post": {
+ "tags": ["Private"],
+ "summary": "Get Open Orders",
+ "description": "Get all open orders of a subacccount",
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["orders", "subaccount_id"],
+ "properties": {
+ "orders": {
+ "title": "orders",
+ "type": "array",
+ "description": "List of open orders",
+ "items": {
+ "required": [
+ "amount",
+ "average_price",
+ "cancel_reason",
+ "creation_timestamp",
+ "direction",
+ "filled_amount",
+ "instrument_name",
+ "is_transfer",
+ "label",
+ "last_update_timestamp",
+ "limit_price",
+ "max_fee",
+ "mmp",
+ "nonce",
+ "order_fee",
+ "order_id",
+ "order_status",
+ "order_type",
+ "signature",
+ "signature_expiry_sec",
+ "signer",
+ "subaccount_id",
+ "time_in_force"
+ ],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Order amount in units of the base"
+ },
+ "average_price": {
+ "title": "average_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Average fill price"
+ },
+ "cancel_reason": {
+ "title": "cancel_reason",
+ "type": "string",
+ "enum": [
+ "",
+ "user_request",
+ "mmp_trigger",
+ "insufficient_margin",
+ "signed_max_fee_too_low",
+ "cancel_on_disconnect",
+ "ioc_or_market_partial_fill",
+ "session_key_deregistered",
+ "subaccount_withdrawn",
+ "compliance"
+ ],
+ "description": "If cancelled, reason behind order cancellation"
+ },
+ "creation_timestamp": {
+ "title": "creation_timestamp",
+ "type": "integer",
+ "description": "Creation timestamp (in ms since Unix epoch)"
+ },
+ "direction": {
+ "title": "direction",
+ "type": "string",
+ "enum": ["buy", "sell"],
+ "description": "Order direction"
+ },
+ "filled_amount": {
+ "title": "filled_amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total filled amount for the order"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ },
+ "is_transfer": {
+ "title": "is_transfer",
+ "type": "boolean",
+ "description": "Whether the order was generated through `private/transfer_position`"
+ },
+ "label": {
+ "title": "label",
+ "type": "string",
+ "description": "Optional user-defined label for the order"
+ },
+ "last_update_timestamp": {
+ "title": "last_update_timestamp",
+ "type": "integer",
+ "description": "Last update timestamp (in ms since Unix epoch)"
+ },
+ "limit_price": {
+ "title": "limit_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Limit price in quote currency"
+ },
+ "max_fee": {
+ "title": "max_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Max fee in units of the quote currency"
+ },
+ "mmp": {
+ "title": "mmp",
+ "type": "boolean",
+ "description": "Whether the order is tagged for market maker protections"
+ },
+ "nonce": {
+ "title": "nonce",
+ "type": "integer",
+ "description": "Unique nonce defined as (e.g. 1695836058725001, where 001 is the random number)"
+ },
+ "order_fee": {
+ "title": "order_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total order fee paid so far"
+ },
+ "order_id": {
+ "title": "order_id",
+ "type": "string",
+ "description": "Order ID"
+ },
+ "order_status": {
+ "title": "order_status",
+ "type": "string",
+ "enum": ["open", "filled", "rejected", "cancelled", "expired"],
+ "description": "Order status"
+ },
+ "order_type": {
+ "title": "order_type",
+ "type": "string",
+ "enum": ["limit", "market"],
+ "description": "Order type"
+ },
+ "signature": {
+ "title": "signature",
+ "type": "string",
+ "description": "Ethereum signature of the order"
+ },
+ "signature_expiry_sec": {
+ "title": "signature_expiry_sec",
+ "type": "integer",
+ "description": "Signature expiry timestamp"
+ },
+ "signer": {
+ "title": "signer",
+ "type": "string",
+ "description": "Owner wallet address or registered session key that signed order"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount ID"
+ },
+ "time_in_force": {
+ "title": "time_in_force",
+ "type": "string",
+ "enum": ["gtc", "post_only", "fok", "ioc"],
+ "description": "Time in force"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id for which to get open orders"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ },
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["subaccount_id"],
+ "properties": {
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id for which to get open orders"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ }
+ },
+ "/private/cancel": {
+ "post": {
+ "tags": ["Private"],
+ "summary": "Cancel",
+ "description": "Cancel a single order.",
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": [
+ "amount",
+ "average_price",
+ "cancel_reason",
+ "creation_timestamp",
+ "direction",
+ "filled_amount",
+ "instrument_name",
+ "is_transfer",
+ "label",
+ "last_update_timestamp",
+ "limit_price",
+ "max_fee",
+ "mmp",
+ "nonce",
+ "order_fee",
+ "order_id",
+ "order_status",
+ "order_type",
+ "signature",
+ "signature_expiry_sec",
+ "signer",
+ "subaccount_id",
+ "time_in_force"
+ ],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Order amount in units of the base"
+ },
+ "average_price": {
+ "title": "average_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Average fill price"
+ },
+ "cancel_reason": {
+ "title": "cancel_reason",
+ "type": "string",
+ "enum": [
+ "",
+ "user_request",
+ "mmp_trigger",
+ "insufficient_margin",
+ "signed_max_fee_too_low",
+ "cancel_on_disconnect",
+ "ioc_or_market_partial_fill",
+ "session_key_deregistered",
+ "subaccount_withdrawn",
+ "compliance"
+ ],
+ "description": "If cancelled, reason behind order cancellation"
+ },
+ "creation_timestamp": {
+ "title": "creation_timestamp",
+ "type": "integer",
+ "description": "Creation timestamp (in ms since Unix epoch)"
+ },
+ "direction": {
+ "title": "direction",
+ "type": "string",
+ "enum": ["buy", "sell"],
+ "description": "Order direction"
+ },
+ "filled_amount": {
+ "title": "filled_amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total filled amount for the order"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ },
+ "is_transfer": {
+ "title": "is_transfer",
+ "type": "boolean",
+ "description": "Whether the order was generated through `private/transfer_position`"
+ },
+ "label": {
+ "title": "label",
+ "type": "string",
+ "description": "Optional user-defined label for the order"
+ },
+ "last_update_timestamp": {
+ "title": "last_update_timestamp",
+ "type": "integer",
+ "description": "Last update timestamp (in ms since Unix epoch)"
+ },
+ "limit_price": {
+ "title": "limit_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Limit price in quote currency"
+ },
+ "max_fee": {
+ "title": "max_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Max fee in units of the quote currency"
+ },
+ "mmp": {
+ "title": "mmp",
+ "type": "boolean",
+ "description": "Whether the order is tagged for market maker protections"
+ },
+ "nonce": {
+ "title": "nonce",
+ "type": "integer",
+ "description": "Unique nonce defined as (e.g. 1695836058725001, where 001 is the random number)"
+ },
+ "order_fee": {
+ "title": "order_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total order fee paid so far"
+ },
+ "order_id": {
+ "title": "order_id",
+ "type": "string",
+ "description": "Order ID"
+ },
+ "order_status": {
+ "title": "order_status",
+ "type": "string",
+ "enum": ["open", "filled", "rejected", "cancelled", "expired"],
+ "description": "Order status"
+ },
+ "order_type": {
+ "title": "order_type",
+ "type": "string",
+ "enum": ["limit", "market"],
+ "description": "Order type"
+ },
+ "signature": {
+ "title": "signature",
+ "type": "string",
+ "description": "Ethereum signature of the order"
+ },
+ "signature_expiry_sec": {
+ "title": "signature_expiry_sec",
+ "type": "integer",
+ "description": "Signature expiry timestamp"
+ },
+ "signer": {
+ "title": "signer",
+ "type": "string",
+ "description": "Owner wallet address or registered session key that signed order"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount ID"
+ },
+ "time_in_force": {
+ "title": "time_in_force",
+ "type": "string",
+ "enum": ["gtc", "post_only", "fok", "ioc"],
+ "description": "Time in force"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ },
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["instrument_name", "order_id", "subaccount_id"],
+ "properties": {
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string"
+ },
+ "order_id": {
+ "title": "order_id",
+ "type": "string",
+ "format": "uuid"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ }
+ },
+ "/private/cancel_by_label": {
+ "post": {
+ "tags": ["Private"],
+ "summary": "Cancel By Label",
+ "description": "Cancel all open orders for a given subaccount and a given label.",
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["cancelled_orders"],
+ "properties": {
+ "cancelled_orders": {
+ "title": "cancelled_orders",
+ "type": "integer",
+ "description": "Number of cancelled orders"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ },
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["label", "subaccount_id"],
+ "properties": {
+ "label": {
+ "title": "label",
+ "type": "string",
+ "description": "Cancel all orders for this label"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount ID"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ }
+ },
+ "/private/cancel_by_nonce": {
+ "post": {
+ "tags": ["Private"],
+ "summary": "Cancel By Nonce",
+ "description": "Cancel an order with a given subaccount and a given nonce.",
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["cancelled_orders"],
+ "properties": {
+ "cancelled_orders": {
+ "title": "cancelled_orders",
+ "type": "integer",
+ "description": "Number of cancelled orders"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ },
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["nonce", "subaccount_id"],
+ "properties": {
+ "nonce": {
+ "title": "nonce",
+ "type": "integer",
+ "description": "Cancel an order with this nonce"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount ID"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ }
+ },
+ "/private/cancel_by_instrument": {
+ "post": {
+ "tags": ["Private"],
+ "summary": "Cancel By Instrument",
+ "description": "Cancel all open orders for a given subaccount and a given instrument.",
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["cancelled_orders"],
+ "properties": {
+ "cancelled_orders": {
+ "title": "cancelled_orders",
+ "type": "integer",
+ "description": "Number of cancelled orders"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ },
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["instrument_name", "subaccount_id"],
+ "properties": {
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Cancel all orders for this instrument"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount ID"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ }
+ },
+ "/private/cancel_all": {
+ "post": {
+ "tags": ["Private"],
+ "summary": "Cancel All",
+ "description": "Cancel all open orders for a given subaccount.",
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["cancelled_orders"],
+ "properties": {
+ "cancelled_orders": {
+ "title": "cancelled_orders",
+ "type": "integer",
+ "description": "Number of cancelled orders"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ },
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["subaccount_id"],
+ "properties": {
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount ID"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ }
+ },
+ "/private/get_order_history": {
+ "post": {
+ "tags": ["Private"],
+ "summary": "Get Order History",
+ "description": "Get order history for a subaccount",
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["orders", "pagination", "subaccount_id"],
+ "properties": {
+ "orders": {
+ "title": "orders",
+ "type": "array",
+ "description": "List of open orders",
+ "items": {
+ "required": [
+ "amount",
+ "average_price",
+ "cancel_reason",
+ "creation_timestamp",
+ "direction",
+ "filled_amount",
+ "instrument_name",
+ "is_transfer",
+ "label",
+ "last_update_timestamp",
+ "limit_price",
+ "max_fee",
+ "mmp",
+ "nonce",
+ "order_fee",
+ "order_id",
+ "order_status",
+ "order_type",
+ "signature",
+ "signature_expiry_sec",
+ "signer",
+ "subaccount_id",
+ "time_in_force"
+ ],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Order amount in units of the base"
+ },
+ "average_price": {
+ "title": "average_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Average fill price"
+ },
+ "cancel_reason": {
+ "title": "cancel_reason",
+ "type": "string",
+ "enum": [
+ "",
+ "user_request",
+ "mmp_trigger",
+ "insufficient_margin",
+ "signed_max_fee_too_low",
+ "cancel_on_disconnect",
+ "ioc_or_market_partial_fill",
+ "session_key_deregistered",
+ "subaccount_withdrawn",
+ "compliance"
+ ],
+ "description": "If cancelled, reason behind order cancellation"
+ },
+ "creation_timestamp": {
+ "title": "creation_timestamp",
+ "type": "integer",
+ "description": "Creation timestamp (in ms since Unix epoch)"
+ },
+ "direction": {
+ "title": "direction",
+ "type": "string",
+ "enum": ["buy", "sell"],
+ "description": "Order direction"
+ },
+ "filled_amount": {
+ "title": "filled_amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total filled amount for the order"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ },
+ "is_transfer": {
+ "title": "is_transfer",
+ "type": "boolean",
+ "description": "Whether the order was generated through `private/transfer_position`"
+ },
+ "label": {
+ "title": "label",
+ "type": "string",
+ "description": "Optional user-defined label for the order"
+ },
+ "last_update_timestamp": {
+ "title": "last_update_timestamp",
+ "type": "integer",
+ "description": "Last update timestamp (in ms since Unix epoch)"
+ },
+ "limit_price": {
+ "title": "limit_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Limit price in quote currency"
+ },
+ "max_fee": {
+ "title": "max_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Max fee in units of the quote currency"
+ },
+ "mmp": {
+ "title": "mmp",
+ "type": "boolean",
+ "description": "Whether the order is tagged for market maker protections"
+ },
+ "nonce": {
+ "title": "nonce",
+ "type": "integer",
+ "description": "Unique nonce defined as (e.g. 1695836058725001, where 001 is the random number)"
+ },
+ "order_fee": {
+ "title": "order_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total order fee paid so far"
+ },
+ "order_id": {
+ "title": "order_id",
+ "type": "string",
+ "description": "Order ID"
+ },
+ "order_status": {
+ "title": "order_status",
+ "type": "string",
+ "enum": ["open", "filled", "rejected", "cancelled", "expired"],
+ "description": "Order status"
+ },
+ "order_type": {
+ "title": "order_type",
+ "type": "string",
+ "enum": ["limit", "market"],
+ "description": "Order type"
+ },
+ "signature": {
+ "title": "signature",
+ "type": "string",
+ "description": "Ethereum signature of the order"
+ },
+ "signature_expiry_sec": {
+ "title": "signature_expiry_sec",
+ "type": "integer",
+ "description": "Signature expiry timestamp"
+ },
+ "signer": {
+ "title": "signer",
+ "type": "string",
+ "description": "Owner wallet address or registered session key that signed order"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount ID"
+ },
+ "time_in_force": {
+ "title": "time_in_force",
+ "type": "string",
+ "enum": ["gtc", "post_only", "fok", "ioc"],
+ "description": "Time in force"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "pagination": {
+ "required": ["count", "num_pages"],
+ "properties": {
+ "count": {
+ "title": "count",
+ "type": "integer",
+ "description": "Total number of items, across all pages"
+ },
+ "num_pages": {
+ "title": "num_pages",
+ "type": "integer",
+ "description": "Number of pages"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id for which to get open orders"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ },
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["subaccount_id"],
+ "properties": {
+ "page": {
+ "title": "page",
+ "type": "integer",
+ "default": 1,
+ "description": "Page number of results to return (default 1, returns last if above `num_pages`)"
+ },
+ "page_size": {
+ "title": "page_size",
+ "type": "integer",
+ "default": 100,
+ "description": "Number of results per page (default 100, max 1000)"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id for which to get order history"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ }
+ },
+ "/private/get_trade_history": {
+ "post": {
+ "tags": ["Private"],
+ "summary": "Get Trade History",
+ "description": "Get trade history for a subaccount, with filter parameters.",
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["subaccount_id", "trades"],
+ "properties": {
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id for which to get the trade history"
+ },
+ "trades": {
+ "title": "trades",
+ "type": "array",
+ "description": "List of trades",
+ "items": {
+ "required": [
+ "direction",
+ "index_price",
+ "instrument_name",
+ "is_transfer",
+ "label",
+ "liquidity_role",
+ "mark_price",
+ "order_id",
+ "realized_pnl",
+ "subaccount_id",
+ "timestamp",
+ "trade_amount",
+ "trade_fee",
+ "trade_id",
+ "trade_price",
+ "tx_hash",
+ "tx_status"
+ ],
+ "properties": {
+ "direction": {
+ "title": "direction",
+ "type": "string",
+ "enum": ["buy", "sell"],
+ "description": "Order direction"
+ },
+ "index_price": {
+ "title": "index_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Index price of the underlying at the time of the trade"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ },
+ "is_transfer": {
+ "title": "is_transfer",
+ "type": "boolean",
+ "description": "Whether the trade was generated through `private/transfer_position`"
+ },
+ "label": {
+ "title": "label",
+ "type": "string",
+ "description": "Optional user-defined label for the order"
+ },
+ "liquidity_role": {
+ "title": "liquidity_role",
+ "type": "string",
+ "enum": ["maker", "taker"],
+ "description": "Role of the user in the trade"
+ },
+ "mark_price": {
+ "title": "mark_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Mark price of the instrument at the time of the trade"
+ },
+ "order_id": {
+ "title": "order_id",
+ "type": "string",
+ "description": "Order ID"
+ },
+ "realized_pnl": {
+ "title": "realized_pnl",
+ "type": "string",
+ "format": "decimal",
+ "description": "Realized PnL for this trade"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount ID"
+ },
+ "timestamp": {
+ "title": "timestamp",
+ "type": "integer",
+ "description": "Trade timestamp (in ms since Unix epoch)"
+ },
+ "trade_amount": {
+ "title": "trade_amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Amount filled in this trade"
+ },
+ "trade_fee": {
+ "title": "trade_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Fee for this trade"
+ },
+ "trade_id": {
+ "title": "trade_id",
+ "type": "string",
+ "description": "Trade ID"
+ },
+ "trade_price": {
+ "title": "trade_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Price at which the trade was filled"
+ },
+ "tx_hash": {
+ "title": "tx_hash",
+ "type": "string",
+ "default": null,
+ "description": "Blockchain transaction hash",
+ "nullable": true
+ },
+ "tx_status": {
+ "title": "tx_status",
+ "type": "string",
+ "enum": ["requested", "pending", "settled", "reverted", "ignored"],
+ "description": "Blockchain transaction status"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ },
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["subaccount_id"],
+ "properties": {
+ "from_timestamp": {
+ "title": "from_timestamp",
+ "type": "integer",
+ "default": 0,
+ "description": "Earliest timestamp to filter by (in ms since Unix epoch). If not provied, defaults to 0."
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "default": null,
+ "description": "Instrument name to filter by",
+ "nullable": true
+ },
+ "order_id": {
+ "title": "order_id",
+ "type": "string",
+ "default": null,
+ "description": "Order id to filter by",
+ "nullable": true
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id for which to get trades"
+ },
+ "to_timestamp": {
+ "title": "to_timestamp",
+ "type": "integer",
+ "default": 18446744073709552000,
+ "description": "Latest timestamp to filter by (in ms since Unix epoch). If not provied, defaults to returning all data up to current time."
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ }
+ },
+ "/private/get_deposit_history": {
+ "post": {
+ "tags": ["Private"],
+ "summary": "Get Deposit History",
+ "description": "Get subaccount deposit history.",
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["events"],
+ "properties": {
+ "events": {
+ "title": "events",
+ "type": "array",
+ "description": "List of deposit payments",
+ "items": {
+ "required": ["amount", "asset", "timestamp", "tx_hash"],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Amount deposited by the subaccount"
+ },
+ "asset": {
+ "title": "asset",
+ "type": "string",
+ "description": "Asset deposited"
+ },
+ "timestamp": {
+ "title": "timestamp",
+ "type": "integer",
+ "description": "Timestamp of the deposit (in ms since UNIX epoch)"
+ },
+ "tx_hash": {
+ "title": "tx_hash",
+ "type": "string",
+ "description": "Hash of the transaction that deposited the funds"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ },
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["subaccount_id"],
+ "properties": {
+ "end_timestamp": {
+ "title": "end_timestamp",
+ "type": "integer",
+ "default": 9223372036854776000,
+ "description": "End timestamp of the event history (default current time)"
+ },
+ "start_timestamp": {
+ "title": "start_timestamp",
+ "type": "integer",
+ "default": 0,
+ "description": "Start timestamp of the event history (default 0)"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount id"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ }
+ },
+ "/private/get_withdrawal_history": {
+ "post": {
+ "tags": ["Private"],
+ "summary": "Get Withdrawal History",
+ "description": "Get subaccount withdrawal history.",
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["events"],
+ "properties": {
+ "events": {
+ "title": "events",
+ "type": "array",
+ "description": "List of withdrawals",
+ "items": {
+ "required": ["amount", "asset", "timestamp", "tx_hash"],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Amount withdrawn by the subaccount"
+ },
+ "asset": {
+ "title": "asset",
+ "type": "string",
+ "description": "Asset withdrawn"
+ },
+ "timestamp": {
+ "title": "timestamp",
+ "type": "integer",
+ "description": "Timestamp of the withdrawal (in ms since UNIX epoch)"
+ },
+ "tx_hash": {
+ "title": "tx_hash",
+ "type": "string",
+ "description": "Hash of the transaction that withdrew the funds"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ },
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["subaccount_id"],
+ "properties": {
+ "end_timestamp": {
+ "title": "end_timestamp",
+ "type": "integer",
+ "default": 9223372036854776000,
+ "description": "End timestamp of the event history (default current time)"
+ },
+ "start_timestamp": {
+ "title": "start_timestamp",
+ "type": "integer",
+ "default": 0,
+ "description": "Start timestamp of the event history (default 0)"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount id"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ }
+ },
+ "/private/get_margin": {
+ "post": {
+ "tags": ["Private"],
+ "summary": "Get Margin",
+ "description": "Calculates margin for a given subaccount and (optionally) a simulated state change. Does not take into account\nopen orders margin requirements.",
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": [
+ "is_valid_trade",
+ "post_initial_margin",
+ "post_maintenance_margin",
+ "pre_initial_margin",
+ "pre_maintenance_margin",
+ "subaccount_id"
+ ],
+ "properties": {
+ "is_valid_trade": {
+ "title": "is_valid_trade",
+ "type": "boolean",
+ "description": "True if trade passes margin requirement"
+ },
+ "post_initial_margin": {
+ "title": "post_initial_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "Initial margin requirement post trade"
+ },
+ "post_maintenance_margin": {
+ "title": "post_maintenance_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "Maintenance margin requirement post trade"
+ },
+ "pre_initial_margin": {
+ "title": "pre_initial_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "Initial margin requirement before trade"
+ },
+ "pre_maintenance_margin": {
+ "title": "pre_maintenance_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "Maintenance margin requirement before trade"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ },
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["subaccount_id"],
+ "properties": {
+ "simulated_position_changes": {
+ "title": "simulated_position_changes",
+ "type": "array",
+ "default": null,
+ "description": "Optional, add positions to simulate a trade",
+ "items": {
+ "required": ["amount", "instrument_name"],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Position amount to simulate"
+ },
+ "entry_price": {
+ "title": "entry_price",
+ "type": "string",
+ "format": "decimal",
+ "default": null,
+ "description": "Only for perps. Entry price to use in the simulation. Mark price is used if not provided.",
+ "nullable": true
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "nullable": true
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ }
+ },
+ "/private/get_collaterals": {
+ "post": {
+ "tags": ["Private"],
+ "summary": "Get Collaterals",
+ "description": "Get collaterals of a subaccount",
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["collaterals", "subaccount_id"],
+ "properties": {
+ "collaterals": {
+ "title": "collaterals",
+ "type": "array",
+ "description": "All collaterals that count towards margin of subaccount",
+ "items": {
+ "required": [
+ "amount",
+ "asset_name",
+ "asset_type",
+ "cumulative_interest",
+ "currency",
+ "initial_margin",
+ "maintenance_margin",
+ "mark_price",
+ "mark_value",
+ "pending_interest"
+ ],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Asset amount of given collateral"
+ },
+ "asset_name": {
+ "title": "asset_name",
+ "type": "string",
+ "description": "Asset name"
+ },
+ "asset_type": {
+ "title": "asset_type",
+ "type": "string",
+ "enum": ["erc20", "option", "perp"],
+ "description": "Type of asset collateral (currently always `erc20`)"
+ },
+ "cumulative_interest": {
+ "title": "cumulative_interest",
+ "type": "string",
+ "format": "decimal",
+ "description": "Cumulative interest earned on supplying collateral or paid for borrowing"
+ },
+ "currency": {
+ "title": "currency",
+ "type": "string",
+ "description": "Underlying currency of asset (`ETH`, `BTC`, etc)"
+ },
+ "initial_margin": {
+ "title": "initial_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "USD value of collateral that contributes to initial margin"
+ },
+ "maintenance_margin": {
+ "title": "maintenance_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "USD value of collateral that contributes to maintenance margin"
+ },
+ "mark_price": {
+ "title": "mark_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Current mark price of the asset"
+ },
+ "mark_value": {
+ "title": "mark_value",
+ "type": "string",
+ "format": "decimal",
+ "description": "USD value of the collateral (amount * mark price)"
+ },
+ "pending_interest": {
+ "title": "pending_interest",
+ "type": "string",
+ "format": "decimal",
+ "description": "Portion of interest that has not yet been settled on-chain. This number is added to the portfolio value for margin calculations purposes."
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ },
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["subaccount_id"],
+ "properties": {
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ }
+ },
+ "/private/get_positions": {
+ "post": {
+ "tags": ["Private"],
+ "summary": "Get Positions",
+ "description": "Get active positions of a subaccount",
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["positions", "subaccount_id"],
+ "properties": {
+ "positions": {
+ "title": "positions",
+ "type": "array",
+ "description": "All active positions of subaccount",
+ "items": {
+ "required": [
+ "amount",
+ "average_price",
+ "cumulative_funding",
+ "delta",
+ "gamma",
+ "index_price",
+ "initial_margin",
+ "instrument_name",
+ "instrument_type",
+ "leverage",
+ "liquidation_price",
+ "maintenance_margin",
+ "mark_price",
+ "mark_value",
+ "net_settlements",
+ "open_orders_margin",
+ "pending_funding",
+ "realized_pnl",
+ "theta",
+ "unrealized_pnl",
+ "vega"
+ ],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Position amount held by subaccount"
+ },
+ "average_price": {
+ "title": "average_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Average price of whole position"
+ },
+ "cumulative_funding": {
+ "title": "cumulative_funding",
+ "type": "string",
+ "format": "decimal",
+ "description": "Cumulative funding for the position (only for perpetuals)."
+ },
+ "delta": {
+ "title": "delta",
+ "type": "string",
+ "format": "decimal",
+ "description": "Asset delta (w.r.t. forward price for options, `1.0` for perps)"
+ },
+ "gamma": {
+ "title": "gamma",
+ "type": "string",
+ "format": "decimal",
+ "description": "Asset gamma (zero for non-options)"
+ },
+ "index_price": {
+ "title": "index_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Current index (oracle) price for position's currency"
+ },
+ "initial_margin": {
+ "title": "initial_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "USD initial margin requirement for this position"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name (same as the base Asset name)"
+ },
+ "instrument_type": {
+ "title": "instrument_type",
+ "type": "string",
+ "enum": ["erc20", "option", "perp"],
+ "description": "`erc20`, `option`, or `perp`"
+ },
+ "leverage": {
+ "title": "leverage",
+ "type": "string",
+ "format": "decimal",
+ "default": null,
+ "description": "Only for perps. Leverage of the position, defined as `abs(notional) / collateral net of options margin`",
+ "nullable": true
+ },
+ "liquidation_price": {
+ "title": "liquidation_price",
+ "type": "string",
+ "format": "decimal",
+ "default": null,
+ "description": "Index price at which position will be liquidated",
+ "nullable": true
+ },
+ "maintenance_margin": {
+ "title": "maintenance_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "USD maintenance margin requirement for this position"
+ },
+ "mark_price": {
+ "title": "mark_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Current mark price for position's instrument"
+ },
+ "mark_value": {
+ "title": "mark_value",
+ "type": "string",
+ "format": "decimal",
+ "description": "USD value of the position; this represents how much USD can be recieved by fully closing the position at the current oracle price"
+ },
+ "net_settlements": {
+ "title": "net_settlements",
+ "type": "string",
+ "format": "decimal",
+ "description": "Net amount of USD from position settlements that has been paid to the user's subaccount. This number is subtracted from the portfolio value for margin calculations purposes.
Positive values mean the user has recieved USD from settlements, or is awaiting settlement of USD losses. Negative values mean the user has paid USD for settlements, or is awaiting settlement of USD gains."
+ },
+ "open_orders_margin": {
+ "title": "open_orders_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "USD margin requirement for all open orders for this asset / instrument"
+ },
+ "pending_funding": {
+ "title": "pending_funding",
+ "type": "string",
+ "format": "decimal",
+ "description": "A portion of funding payments that has not yet been settled into cash balance (only for perpetuals). This number is added to the portfolio value for margin calculations purposes."
+ },
+ "realized_pnl": {
+ "title": "realized_pnl",
+ "type": "string",
+ "format": "decimal",
+ "description": "Realized trading profit or loss of the position."
+ },
+ "theta": {
+ "title": "theta",
+ "type": "string",
+ "format": "decimal",
+ "description": "Asset theta (zero for non-options)"
+ },
+ "unrealized_pnl": {
+ "title": "unrealized_pnl",
+ "type": "string",
+ "format": "decimal",
+ "description": "Unrealized trading profit or loss of the position."
+ },
+ "vega": {
+ "title": "vega",
+ "type": "string",
+ "format": "decimal",
+ "description": "Asset vega (zero for non-options)"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ },
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["subaccount_id"],
+ "properties": {
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ }
+ },
+ "/private/get_option_settlement_history": {
+ "post": {
+ "tags": ["Private"],
+ "summary": "Get Option Settlement History",
+ "description": "Get expired option settlement history for a subaccount",
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["settlements", "subaccount_id"],
+ "properties": {
+ "settlements": {
+ "title": "settlements",
+ "type": "array",
+ "description": "List of expired option settlements",
+ "items": {
+ "required": [
+ "amount",
+ "expiry",
+ "instrument_name",
+ "option_settlement_pnl",
+ "settlement_price"
+ ],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Amount that was settled"
+ },
+ "expiry": {
+ "title": "expiry",
+ "type": "integer",
+ "description": "Expiry timestamp of the option"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ },
+ "option_settlement_pnl": {
+ "title": "option_settlement_pnl",
+ "type": "string",
+ "format": "decimal",
+ "description": "USD profit or loss from option settlements calculated as: settlement value - (average price x amount)"
+ },
+ "settlement_price": {
+ "title": "settlement_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Price of option settlement"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id for which to get expired option settlement history"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ },
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["subaccount_id"],
+ "properties": {
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id for which to get expired option settlement history"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ }
+ },
+ "/private/get_subaccount_value_history": {
+ "post": {
+ "tags": ["Private"],
+ "summary": "Get Subaccount Value History",
+ "description": "Get the value history of a subaccount",
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["subaccount_id", "subaccount_value_history"],
+ "properties": {
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id"
+ },
+ "subaccount_value_history": {
+ "title": "subaccount_value_history",
+ "type": "array",
+ "description": "Subaccount value history",
+ "items": {
+ "required": ["subaccount_value", "timestamp"],
+ "properties": {
+ "subaccount_value": {
+ "title": "subaccount_value",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total mark-to-market value of all positions and collaterals"
+ },
+ "timestamp": {
+ "title": "timestamp",
+ "type": "integer",
+ "description": "Timestamp of when the subaccount value was recorded into the database"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ },
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["end_timestamp", "period", "start_timestamp", "subaccount_id"],
+ "properties": {
+ "end_timestamp": {
+ "title": "end_timestamp",
+ "type": "integer",
+ "description": "End timestamp"
+ },
+ "period": {
+ "title": "period",
+ "type": "integer",
+ "description": "Period"
+ },
+ "start_timestamp": {
+ "title": "start_timestamp",
+ "type": "integer",
+ "description": "Start timestamp"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ }
+ },
+ "/private/expired_and_cancelled_history": {
+ "post": {
+ "tags": ["Private"],
+ "summary": "Expired And Cancelled History",
+ "description": "Generate a list of URLs to retrieve archived orders",
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["presigned_urls"],
+ "properties": {
+ "presigned_urls": {
+ "title": "presigned_urls",
+ "type": "array",
+ "description": "List of presigned URLs to the snapshots",
+ "items": {
+ "title": "presigned_urls",
+ "type": "string"
+ }
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ },
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["end_timestamp", "expiry", "start_timestamp", "subaccount_id", "wallet"],
+ "properties": {
+ "end_timestamp": {
+ "title": "end_timestamp",
+ "type": "integer",
+ "description": "End Unix timestamp"
+ },
+ "expiry": {
+ "title": "expiry",
+ "type": "integer",
+ "description": "Expiry of download link in seconds. Maximum of 604800."
+ },
+ "start_timestamp": {
+ "title": "start_timestamp",
+ "type": "integer",
+ "description": "Start Unix timestamp"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount to download data for"
+ },
+ "wallet": {
+ "title": "wallet",
+ "type": "string",
+ "description": "Wallet to download data for"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ }
+ },
+ "/private/get_funding_history": {
+ "post": {
+ "tags": ["Private"],
+ "summary": "Get Funding History",
+ "description": "Get subaccount funding history.",
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["events"],
+ "properties": {
+ "events": {
+ "title": "events",
+ "type": "array",
+ "description": "List of funding payments",
+ "items": {
+ "required": ["funding", "instrument_name", "timestamp"],
+ "properties": {
+ "funding": {
+ "title": "funding",
+ "type": "string",
+ "format": "decimal",
+ "description": "Dollar funding paid (if negative) or received (if positive) by the subaccount"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ },
+ "timestamp": {
+ "title": "timestamp",
+ "type": "integer",
+ "description": "Timestamp of the funding payment (in ms since UNIX epoch)"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ },
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["subaccount_id"],
+ "properties": {
+ "end_timestamp": {
+ "title": "end_timestamp",
+ "type": "integer",
+ "default": 9223372036854776000,
+ "description": "End timestamp of the event history (default current time)"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "default": null,
+ "description": "Instrument name (returns history for all perpetuals if not provided)",
+ "nullable": true
+ },
+ "start_timestamp": {
+ "title": "start_timestamp",
+ "type": "integer",
+ "default": 0,
+ "description": "Start timestamp of the event history (default 0)"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount id"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ }
+ },
+ "/private/get_interest_history": {
+ "post": {
+ "tags": ["Private"],
+ "summary": "Get Interest History",
+ "description": "Get subaccount interest payment history.",
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["events"],
+ "properties": {
+ "events": {
+ "title": "events",
+ "type": "array",
+ "description": "List of interest payments",
+ "items": {
+ "required": ["interest", "timestamp"],
+ "properties": {
+ "interest": {
+ "title": "interest",
+ "type": "string",
+ "format": "decimal",
+ "description": "Dollar interest paid (if negative) or received (if positive) by the subaccount"
+ },
+ "timestamp": {
+ "title": "timestamp",
+ "type": "integer",
+ "description": "Timestamp of the interest payment (in ms since UNIX epoch)"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ },
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["subaccount_id"],
+ "properties": {
+ "end_timestamp": {
+ "title": "end_timestamp",
+ "type": "integer",
+ "default": 9223372036854776000,
+ "description": "End timestamp of the event history (default current time)"
+ },
+ "start_timestamp": {
+ "title": "start_timestamp",
+ "type": "integer",
+ "default": 0,
+ "description": "Start timestamp of the event history (default 0)"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount id"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ }
+ },
+ "/private/get_erc20_transfer_history": {
+ "post": {
+ "tags": ["Private"],
+ "summary": "Get Erc20 Transfer History",
+ "description": "Get subaccount erc20 transfer history.\n\nPosition transfers (e.g. options or perps) are treated as trades. Use `private/get_trade_history` for position transfer history.",
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["events"],
+ "properties": {
+ "events": {
+ "title": "events",
+ "type": "array",
+ "description": "List of erc20 transfers",
+ "items": {
+ "required": [
+ "amount",
+ "asset",
+ "counterparty_subaccount_id",
+ "is_outgoing",
+ "timestamp",
+ "tx_hash"
+ ],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Amount withdrawn by the subaccount"
+ },
+ "asset": {
+ "title": "asset",
+ "type": "string",
+ "description": "Asset withdrawn"
+ },
+ "counterparty_subaccount_id": {
+ "title": "counterparty_subaccount_id",
+ "type": "integer",
+ "description": "Recipient or sender subaccount_id of transfer"
+ },
+ "is_outgoing": {
+ "title": "is_outgoing",
+ "type": "boolean",
+ "description": "True if the transfer was initiated by the subaccount, False otherwise"
+ },
+ "timestamp": {
+ "title": "timestamp",
+ "type": "integer",
+ "description": "Timestamp of the transfer (in ms since UNIX epoch)"
+ },
+ "tx_hash": {
+ "title": "tx_hash",
+ "type": "string",
+ "description": "Hash of the transaction that withdrew the funds"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ },
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["subaccount_id"],
+ "properties": {
+ "end_timestamp": {
+ "title": "end_timestamp",
+ "type": "integer",
+ "default": 9223372036854776000,
+ "description": "End timestamp of the event history (default current time)"
+ },
+ "start_timestamp": {
+ "title": "start_timestamp",
+ "type": "integer",
+ "default": 0,
+ "description": "Start timestamp of the event history (default 0)"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount id"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ }
+ },
+ "/private/get_liquidation_history": {
+ "post": {
+ "tags": ["Private"],
+ "summary": "Get Liquidation History",
+ "description": "",
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "title": "result",
+ "type": "array",
+ "description": "",
+ "items": {
+ "required": [
+ "auction_id",
+ "auction_type",
+ "bids",
+ "end_timestamp",
+ "fee",
+ "start_timestamp",
+ "tx_hash"
+ ],
+ "properties": {
+ "auction_id": {
+ "title": "auction_id",
+ "type": "string",
+ "description": "Unique ID of the auction"
+ },
+ "auction_type": {
+ "title": "auction_type",
+ "type": "string",
+ "enum": ["solvent", "insolvent"],
+ "description": "Type of auction"
+ },
+ "bids": {
+ "title": "bids",
+ "type": "array",
+ "description": "List of auction bid events",
+ "items": {
+ "required": [
+ "amounts_liquidated",
+ "cash_received",
+ "discount_pnl",
+ "percent_liquidated",
+ "positions_realized_pnl",
+ "realized_pnl",
+ "timestamp",
+ "tx_hash"
+ ],
+ "properties": {
+ "amounts_liquidated": {
+ "title": "amounts_liquidated",
+ "type": "object",
+ "description": "Amounts of each asset that were closed",
+ "additionalProperties": {
+ "title": "amounts_liquidated",
+ "type": "string",
+ "format": "decimal"
+ }
+ },
+ "cash_received": {
+ "title": "cash_received",
+ "type": "string",
+ "format": "decimal",
+ "description": "Cash received for auctioning off the percentage of the subaccount"
+ },
+ "discount_pnl": {
+ "title": "discount_pnl",
+ "type": "string",
+ "format": "decimal",
+ "description": "Realized PnL due to being liquidated at a discount to mark portfolio value"
+ },
+ "percent_liquidated": {
+ "title": "percent_liquidated",
+ "type": "string",
+ "format": "decimal",
+ "description": "Percent of the subaccount that was liquidated"
+ },
+ "positions_realized_pnl": {
+ "title": "positions_realized_pnl",
+ "type": "object",
+ "description": "Realized PnL of each position that was closed",
+ "additionalProperties": {
+ "title": "positions_realized_pnl",
+ "type": "string",
+ "format": "decimal"
+ }
+ },
+ "realized_pnl": {
+ "title": "realized_pnl",
+ "type": "string",
+ "format": "decimal",
+ "description": "Realized PnL of the auction bid, assuming positions are closed at mark price at the time of the liquidation"
+ },
+ "timestamp": {
+ "title": "timestamp",
+ "type": "integer",
+ "description": "Timestamp of the bid (in ms since UNIX epoch)"
+ },
+ "tx_hash": {
+ "title": "tx_hash",
+ "type": "string",
+ "description": "Hash of the bid transaction"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "end_timestamp": {
+ "title": "end_timestamp",
+ "type": "integer",
+ "default": null,
+ "description": "Timestamp of the auction end (in ms since UNIX epoch), or `null` if not ended",
+ "nullable": true
+ },
+ "fee": {
+ "title": "fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Fee paid by the subaccount"
+ },
+ "start_timestamp": {
+ "title": "start_timestamp",
+ "type": "integer",
+ "description": "Timestamp of the auction start (in ms since UNIX epoch)"
+ },
+ "tx_hash": {
+ "title": "tx_hash",
+ "type": "string",
+ "description": "Hash of the transaction that started the auction"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ },
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["subaccount_id"],
+ "properties": {
+ "end_timestamp": {
+ "title": "end_timestamp",
+ "type": "integer",
+ "default": 9223372036854776000,
+ "description": "End timestamp of the event history (default current time)"
+ },
+ "start_timestamp": {
+ "title": "start_timestamp",
+ "type": "integer",
+ "default": 0,
+ "description": "Start timestamp of the event history (default 0)"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount id"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ }
+ },
+ "/private/session_keys": {
+ "post": {
+ "tags": ["Private"],
+ "summary": "Session Keys",
+ "description": "",
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["public_session_keys"],
+ "properties": {
+ "public_session_keys": {
+ "title": "public_session_keys",
+ "type": "array",
+ "description": "List of session keys (includes unactivated and expired keys)",
+ "items": {
+ "required": ["expiry_sec", "public_session_key"],
+ "properties": {
+ "expiry_sec": {
+ "title": "expiry_sec",
+ "type": "integer",
+ "description": "Session key expiry timestamp in sec"
+ },
+ "label": {
+ "title": "label",
+ "type": "string",
+ "default": "",
+ "description": "User-defined session key label"
+ },
+ "public_session_key": {
+ "title": "public_session_key",
+ "type": "string",
+ "description": "Public session key address (Ethereum EOA)"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ },
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["wallet"],
+ "properties": {
+ "wallet": {
+ "title": "wallet",
+ "type": "string",
+ "description": "Ethereum wallet address of account"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ }
+ },
+ "/private/change_session_key_label": {
+ "post": {
+ "tags": ["Private"],
+ "summary": "Change Session Key Label",
+ "description": "",
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["label"],
+ "properties": {
+ "label": {
+ "title": "label",
+ "type": "string"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ },
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["label"],
+ "properties": {
+ "label": {
+ "title": "label",
+ "type": "string"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ }
+ },
+ "/private/get_mmp_config": {
+ "post": {
+ "tags": ["Private"],
+ "summary": "Get Mmp Config",
+ "description": "Get the current mmp config for a subaccount (optionally filtered by currency)",
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "title": "result",
+ "type": "array",
+ "description": "",
+ "items": {
+ "required": ["currency", "mmp_frozen_time", "mmp_interval", "subaccount_id"],
+ "properties": {
+ "currency": {
+ "title": "currency",
+ "type": "string",
+ "description": "Currency of this mmp config"
+ },
+ "mmp_amount_limit": {
+ "title": "mmp_amount_limit",
+ "type": "string",
+ "format": "decimal",
+ "default": "0",
+ "description": "Maximum total order amount that can be traded within the mmp_interval across all instruments of the provided currency. The amounts are not netted, so a filled bid of 1 and a filled ask of 2 would count as 3.
Default: 0 (no limit)"
+ },
+ "mmp_delta_limit": {
+ "title": "mmp_delta_limit",
+ "type": "string",
+ "format": "decimal",
+ "default": "0",
+ "description": "Maximum total delta that can be traded within the mmp_interval across all instruments of the provided currency. This quantity is netted, so a filled order with +1 delta and a filled order with -2 delta would count as -1
Default: 0 (no limit)"
+ },
+ "mmp_frozen_time": {
+ "title": "mmp_frozen_time",
+ "type": "integer",
+ "description": "Time interval in ms setting how long the subaccount is frozen after an mmp trigger, if 0 then a manual reset would be required via private/reset_mmp"
+ },
+ "mmp_interval": {
+ "title": "mmp_interval",
+ "type": "integer",
+ "description": "Time interval in ms over which the limits are monotored, if 0 then mmp is disabled"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id for which to set the config"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ },
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["subaccount_id"],
+ "properties": {
+ "currency": {
+ "title": "currency",
+ "type": "string",
+ "default": null,
+ "description": "Currency to get the config for. If not provided, returns all configs for the subaccount",
+ "nullable": true
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id for which to get the config"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ }
+ },
+ "/private/set_mmp_config": {
+ "post": {
+ "tags": ["Private"],
+ "summary": "Set Mmp Config",
+ "description": "Set the mmp config for the subaccount and currency",
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["currency", "mmp_frozen_time", "mmp_interval", "subaccount_id"],
+ "properties": {
+ "currency": {
+ "title": "currency",
+ "type": "string",
+ "description": "Currency of this mmp config"
+ },
+ "mmp_amount_limit": {
+ "title": "mmp_amount_limit",
+ "type": "string",
+ "format": "decimal",
+ "default": "0",
+ "description": "Maximum total order amount that can be traded within the mmp_interval across all instruments of the provided currency. The amounts are not netted, so a filled bid of 1 and a filled ask of 2 would count as 3.
Default: 0 (no limit)"
+ },
+ "mmp_delta_limit": {
+ "title": "mmp_delta_limit",
+ "type": "string",
+ "format": "decimal",
+ "default": "0",
+ "description": "Maximum total delta that can be traded within the mmp_interval across all instruments of the provided currency. This quantity is netted, so a filled order with +1 delta and a filled order with -2 delta would count as -1
Default: 0 (no limit)"
+ },
+ "mmp_frozen_time": {
+ "title": "mmp_frozen_time",
+ "type": "integer",
+ "description": "Time interval in ms setting how long the subaccount is frozen after an mmp trigger, if 0 then a manual reset would be required via private/reset_mmp"
+ },
+ "mmp_interval": {
+ "title": "mmp_interval",
+ "type": "integer",
+ "description": "Time interval in ms over which the limits are monotored, if 0 then mmp is disabled"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id for which to set the config"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ },
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["currency", "mmp_frozen_time", "mmp_interval", "subaccount_id"],
+ "properties": {
+ "currency": {
+ "title": "currency",
+ "type": "string",
+ "description": "Currency of this mmp config"
+ },
+ "mmp_amount_limit": {
+ "title": "mmp_amount_limit",
+ "type": "string",
+ "format": "decimal",
+ "default": "0",
+ "description": "Maximum total order amount that can be traded within the mmp_interval across all instruments of the provided currency. The amounts are not netted, so a filled bid of 1 and a filled ask of 2 would count as 3.
Default: 0 (no limit)"
+ },
+ "mmp_delta_limit": {
+ "title": "mmp_delta_limit",
+ "type": "string",
+ "format": "decimal",
+ "default": "0",
+ "description": "Maximum total delta that can be traded within the mmp_interval across all instruments of the provided currency. This quantity is netted, so a filled order with +1 delta and a filled order with -2 delta would count as -1
Default: 0 (no limit)"
+ },
+ "mmp_frozen_time": {
+ "title": "mmp_frozen_time",
+ "type": "integer",
+ "description": "Time interval in ms setting how long the subaccount is frozen after an mmp trigger, if 0 then a manual reset would be required via private/reset_mmp"
+ },
+ "mmp_interval": {
+ "title": "mmp_interval",
+ "type": "integer",
+ "description": "Time interval in ms over which the limits are monotored, if 0 then mmp is disabled"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id for which to set the config"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ }
+ },
+ "/private/reset_mmp": {
+ "post": {
+ "tags": ["Private"],
+ "summary": "Reset Mmp",
+ "description": "Resets (unfreezes) the mmp state for a subaccount (optionally filtered by currency)",
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "title": "result",
+ "type": "string",
+ "enum": ["ok"],
+ "description": "The result of this method call, `ok` if successful"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ },
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["subaccount_id"],
+ "properties": {
+ "currency": {
+ "title": "currency",
+ "type": "string",
+ "default": null,
+ "description": "Currency to reset the mmp for. If not provided, resets all configs for the subaccount",
+ "nullable": true
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id for which to reset the mmp state"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ }
+ },
+ "/private/set_cancel_on_disconnect": {
+ "post": {
+ "tags": ["Private"],
+ "summary": "Set Cancel On Disconnect",
+ "description": "Enables cancel on disconnect for the account",
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "title": "result",
+ "type": "string",
+ "enum": ["ok"],
+ "description": ""
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ },
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["enabled", "wallet"],
+ "properties": {
+ "enabled": {
+ "title": "enabled",
+ "type": "boolean",
+ "description": "Whether to enable or disable cancel on disconnect"
+ },
+ "wallet": {
+ "title": "wallet",
+ "type": "string",
+ "description": "Public key (wallet) of the account"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ }
+ },
+ "/public/get_time": {
+ "post": {
+ "tags": ["Public"],
+ "summary": "Get Time",
+ "description": "",
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "content": {
+ "application/json": {
+ "schema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "title": "result",
+ "type": "integer",
+ "description": "Current time in milliseconds since UNIX epoch"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ },
+ "parameters": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "properties": {},
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "components": {
+ "schemas": {
+ "PrivateTransferPositionParamsSchema": {
+ "required": ["maker_params", "taker_params", "wallet"],
+ "properties": {
+ "maker_params": {
+ "required": [
+ "amount",
+ "direction",
+ "instrument_name",
+ "limit_price",
+ "max_fee",
+ "nonce",
+ "signature",
+ "signature_expiry_sec",
+ "signer",
+ "subaccount_id"
+ ],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Order amount in units of the base"
+ },
+ "direction": {
+ "title": "direction",
+ "type": "string",
+ "enum": ["buy", "sell"],
+ "description": "Order direction"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ },
+ "limit_price": {
+ "title": "limit_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Limit price in quote currency.
This field is still required for market orders because it is a component of the signature. However, market orders will not leave a resting order in the book in case of a partial fill."
+ },
+ "max_fee": {
+ "title": "max_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Max fee in units of the quote currency. Order will be rejected if the supplied max fee is below the estimated fee for this order."
+ },
+ "nonce": {
+ "title": "nonce",
+ "type": "integer",
+ "description": "Unique nonce defined as (e.g. 1695836058725001, where 001 is the random number)"
+ },
+ "signature": {
+ "title": "signature",
+ "type": "string",
+ "description": "Etherium signature of the order"
+ },
+ "signature_expiry_sec": {
+ "title": "signature_expiry_sec",
+ "type": "integer",
+ "description": "Unix timestamp in seconds. Order signature becomes invalid after this time, and the system will cancel the order.Expiry MUST be at least 5 min from now."
+ },
+ "signer": {
+ "title": "signer",
+ "type": "string",
+ "description": "Owner wallet address or registered session key that signed order"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount ID"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "taker_params": {
+ "required": [
+ "amount",
+ "direction",
+ "instrument_name",
+ "limit_price",
+ "max_fee",
+ "nonce",
+ "signature",
+ "signature_expiry_sec",
+ "signer",
+ "subaccount_id"
+ ],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Order amount in units of the base"
+ },
+ "direction": {
+ "title": "direction",
+ "type": "string",
+ "enum": ["buy", "sell"],
+ "description": "Order direction"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ },
+ "limit_price": {
+ "title": "limit_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Limit price in quote currency.
This field is still required for market orders because it is a component of the signature. However, market orders will not leave a resting order in the book in case of a partial fill."
+ },
+ "max_fee": {
+ "title": "max_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Max fee in units of the quote currency. Order will be rejected if the supplied max fee is below the estimated fee for this order."
+ },
+ "nonce": {
+ "title": "nonce",
+ "type": "integer",
+ "description": "Unique nonce defined as (e.g. 1695836058725001, where 001 is the random number)"
+ },
+ "signature": {
+ "title": "signature",
+ "type": "string",
+ "description": "Etherium signature of the order"
+ },
+ "signature_expiry_sec": {
+ "title": "signature_expiry_sec",
+ "type": "integer",
+ "description": "Unix timestamp in seconds. Order signature becomes invalid after this time, and the system will cancel the order.Expiry MUST be at least 5 min from now."
+ },
+ "signer": {
+ "title": "signer",
+ "type": "string",
+ "description": "Owner wallet address or registered session key that signed order"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount ID"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "wallet": {
+ "title": "wallet",
+ "type": "string",
+ "description": "Public key (wallet) of the account"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "TradeModuleParamsSchema": {
+ "required": [
+ "amount",
+ "direction",
+ "instrument_name",
+ "limit_price",
+ "max_fee",
+ "nonce",
+ "signature",
+ "signature_expiry_sec",
+ "signer",
+ "subaccount_id"
+ ],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Order amount in units of the base"
+ },
+ "direction": {
+ "title": "direction",
+ "type": "string",
+ "enum": ["buy", "sell"],
+ "description": "Order direction"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ },
+ "limit_price": {
+ "title": "limit_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Limit price in quote currency.
This field is still required for market orders because it is a component of the signature. However, market orders will not leave a resting order in the book in case of a partial fill."
+ },
+ "max_fee": {
+ "title": "max_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Max fee in units of the quote currency. Order will be rejected if the supplied max fee is below the estimated fee for this order."
+ },
+ "nonce": {
+ "title": "nonce",
+ "type": "integer",
+ "description": "Unique nonce defined as (e.g. 1695836058725001, where 001 is the random number)"
+ },
+ "signature": {
+ "title": "signature",
+ "type": "string",
+ "description": "Etherium signature of the order"
+ },
+ "signature_expiry_sec": {
+ "title": "signature_expiry_sec",
+ "type": "integer",
+ "description": "Unix timestamp in seconds. Order signature becomes invalid after this time, and the system will cancel the order.Expiry MUST be at least 5 min from now."
+ },
+ "signer": {
+ "title": "signer",
+ "type": "string",
+ "description": "Owner wallet address or registered session key that signed order"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount ID"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateTransferPositionResponseSchema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["maker_order", "maker_trade", "taker_order", "taker_trade"],
+ "properties": {
+ "maker_order": {
+ "required": [
+ "amount",
+ "average_price",
+ "cancel_reason",
+ "creation_timestamp",
+ "direction",
+ "filled_amount",
+ "instrument_name",
+ "is_transfer",
+ "label",
+ "last_update_timestamp",
+ "limit_price",
+ "max_fee",
+ "mmp",
+ "nonce",
+ "order_fee",
+ "order_id",
+ "order_status",
+ "order_type",
+ "signature",
+ "signature_expiry_sec",
+ "signer",
+ "subaccount_id",
+ "time_in_force"
+ ],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Order amount in units of the base"
+ },
+ "average_price": {
+ "title": "average_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Average fill price"
+ },
+ "cancel_reason": {
+ "title": "cancel_reason",
+ "type": "string",
+ "enum": [
+ "",
+ "user_request",
+ "mmp_trigger",
+ "insufficient_margin",
+ "signed_max_fee_too_low",
+ "cancel_on_disconnect",
+ "ioc_or_market_partial_fill",
+ "session_key_deregistered",
+ "subaccount_withdrawn",
+ "compliance"
+ ],
+ "description": "If cancelled, reason behind order cancellation"
+ },
+ "creation_timestamp": {
+ "title": "creation_timestamp",
+ "type": "integer",
+ "description": "Creation timestamp (in ms since Unix epoch)"
+ },
+ "direction": {
+ "title": "direction",
+ "type": "string",
+ "enum": ["buy", "sell"],
+ "description": "Order direction"
+ },
+ "filled_amount": {
+ "title": "filled_amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total filled amount for the order"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ },
+ "is_transfer": {
+ "title": "is_transfer",
+ "type": "boolean",
+ "description": "Whether the order was generated through `private/transfer_position`"
+ },
+ "label": {
+ "title": "label",
+ "type": "string",
+ "description": "Optional user-defined label for the order"
+ },
+ "last_update_timestamp": {
+ "title": "last_update_timestamp",
+ "type": "integer",
+ "description": "Last update timestamp (in ms since Unix epoch)"
+ },
+ "limit_price": {
+ "title": "limit_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Limit price in quote currency"
+ },
+ "max_fee": {
+ "title": "max_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Max fee in units of the quote currency"
+ },
+ "mmp": {
+ "title": "mmp",
+ "type": "boolean",
+ "description": "Whether the order is tagged for market maker protections"
+ },
+ "nonce": {
+ "title": "nonce",
+ "type": "integer",
+ "description": "Unique nonce defined as (e.g. 1695836058725001, where 001 is the random number)"
+ },
+ "order_fee": {
+ "title": "order_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total order fee paid so far"
+ },
+ "order_id": {
+ "title": "order_id",
+ "type": "string",
+ "description": "Order ID"
+ },
+ "order_status": {
+ "title": "order_status",
+ "type": "string",
+ "enum": ["open", "filled", "rejected", "cancelled", "expired"],
+ "description": "Order status"
+ },
+ "order_type": {
+ "title": "order_type",
+ "type": "string",
+ "enum": ["limit", "market"],
+ "description": "Order type"
+ },
+ "signature": {
+ "title": "signature",
+ "type": "string",
+ "description": "Ethereum signature of the order"
+ },
+ "signature_expiry_sec": {
+ "title": "signature_expiry_sec",
+ "type": "integer",
+ "description": "Signature expiry timestamp"
+ },
+ "signer": {
+ "title": "signer",
+ "type": "string",
+ "description": "Owner wallet address or registered session key that signed order"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount ID"
+ },
+ "time_in_force": {
+ "title": "time_in_force",
+ "type": "string",
+ "enum": ["gtc", "post_only", "fok", "ioc"],
+ "description": "Time in force"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "maker_trade": {
+ "required": [
+ "direction",
+ "index_price",
+ "instrument_name",
+ "is_transfer",
+ "label",
+ "liquidity_role",
+ "mark_price",
+ "order_id",
+ "realized_pnl",
+ "subaccount_id",
+ "timestamp",
+ "trade_amount",
+ "trade_fee",
+ "trade_id",
+ "trade_price",
+ "tx_hash",
+ "tx_status"
+ ],
+ "properties": {
+ "direction": {
+ "title": "direction",
+ "type": "string",
+ "enum": ["buy", "sell"],
+ "description": "Order direction"
+ },
+ "index_price": {
+ "title": "index_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Index price of the underlying at the time of the trade"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ },
+ "is_transfer": {
+ "title": "is_transfer",
+ "type": "boolean",
+ "description": "Whether the trade was generated through `private/transfer_position`"
+ },
+ "label": {
+ "title": "label",
+ "type": "string",
+ "description": "Optional user-defined label for the order"
+ },
+ "liquidity_role": {
+ "title": "liquidity_role",
+ "type": "string",
+ "enum": ["maker", "taker"],
+ "description": "Role of the user in the trade"
+ },
+ "mark_price": {
+ "title": "mark_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Mark price of the instrument at the time of the trade"
+ },
+ "order_id": {
+ "title": "order_id",
+ "type": "string",
+ "description": "Order ID"
+ },
+ "realized_pnl": {
+ "title": "realized_pnl",
+ "type": "string",
+ "format": "decimal",
+ "description": "Realized PnL for this trade"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount ID"
+ },
+ "timestamp": {
+ "title": "timestamp",
+ "type": "integer",
+ "description": "Trade timestamp (in ms since Unix epoch)"
+ },
+ "trade_amount": {
+ "title": "trade_amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Amount filled in this trade"
+ },
+ "trade_fee": {
+ "title": "trade_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Fee for this trade"
+ },
+ "trade_id": {
+ "title": "trade_id",
+ "type": "string",
+ "description": "Trade ID"
+ },
+ "trade_price": {
+ "title": "trade_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Price at which the trade was filled"
+ },
+ "tx_hash": {
+ "title": "tx_hash",
+ "type": "string",
+ "default": null,
+ "description": "Blockchain transaction hash",
+ "nullable": true
+ },
+ "tx_status": {
+ "title": "tx_status",
+ "type": "string",
+ "enum": ["requested", "pending", "settled", "reverted", "ignored"],
+ "description": "Blockchain transaction status"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "taker_order": {
+ "required": [
+ "amount",
+ "average_price",
+ "cancel_reason",
+ "creation_timestamp",
+ "direction",
+ "filled_amount",
+ "instrument_name",
+ "is_transfer",
+ "label",
+ "last_update_timestamp",
+ "limit_price",
+ "max_fee",
+ "mmp",
+ "nonce",
+ "order_fee",
+ "order_id",
+ "order_status",
+ "order_type",
+ "signature",
+ "signature_expiry_sec",
+ "signer",
+ "subaccount_id",
+ "time_in_force"
+ ],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Order amount in units of the base"
+ },
+ "average_price": {
+ "title": "average_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Average fill price"
+ },
+ "cancel_reason": {
+ "title": "cancel_reason",
+ "type": "string",
+ "enum": [
+ "",
+ "user_request",
+ "mmp_trigger",
+ "insufficient_margin",
+ "signed_max_fee_too_low",
+ "cancel_on_disconnect",
+ "ioc_or_market_partial_fill",
+ "session_key_deregistered",
+ "subaccount_withdrawn",
+ "compliance"
+ ],
+ "description": "If cancelled, reason behind order cancellation"
+ },
+ "creation_timestamp": {
+ "title": "creation_timestamp",
+ "type": "integer",
+ "description": "Creation timestamp (in ms since Unix epoch)"
+ },
+ "direction": {
+ "title": "direction",
+ "type": "string",
+ "enum": ["buy", "sell"],
+ "description": "Order direction"
+ },
+ "filled_amount": {
+ "title": "filled_amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total filled amount for the order"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ },
+ "is_transfer": {
+ "title": "is_transfer",
+ "type": "boolean",
+ "description": "Whether the order was generated through `private/transfer_position`"
+ },
+ "label": {
+ "title": "label",
+ "type": "string",
+ "description": "Optional user-defined label for the order"
+ },
+ "last_update_timestamp": {
+ "title": "last_update_timestamp",
+ "type": "integer",
+ "description": "Last update timestamp (in ms since Unix epoch)"
+ },
+ "limit_price": {
+ "title": "limit_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Limit price in quote currency"
+ },
+ "max_fee": {
+ "title": "max_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Max fee in units of the quote currency"
+ },
+ "mmp": {
+ "title": "mmp",
+ "type": "boolean",
+ "description": "Whether the order is tagged for market maker protections"
+ },
+ "nonce": {
+ "title": "nonce",
+ "type": "integer",
+ "description": "Unique nonce defined as (e.g. 1695836058725001, where 001 is the random number)"
+ },
+ "order_fee": {
+ "title": "order_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total order fee paid so far"
+ },
+ "order_id": {
+ "title": "order_id",
+ "type": "string",
+ "description": "Order ID"
+ },
+ "order_status": {
+ "title": "order_status",
+ "type": "string",
+ "enum": ["open", "filled", "rejected", "cancelled", "expired"],
+ "description": "Order status"
+ },
+ "order_type": {
+ "title": "order_type",
+ "type": "string",
+ "enum": ["limit", "market"],
+ "description": "Order type"
+ },
+ "signature": {
+ "title": "signature",
+ "type": "string",
+ "description": "Ethereum signature of the order"
+ },
+ "signature_expiry_sec": {
+ "title": "signature_expiry_sec",
+ "type": "integer",
+ "description": "Signature expiry timestamp"
+ },
+ "signer": {
+ "title": "signer",
+ "type": "string",
+ "description": "Owner wallet address or registered session key that signed order"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount ID"
+ },
+ "time_in_force": {
+ "title": "time_in_force",
+ "type": "string",
+ "enum": ["gtc", "post_only", "fok", "ioc"],
+ "description": "Time in force"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "taker_trade": {
+ "required": [
+ "direction",
+ "index_price",
+ "instrument_name",
+ "is_transfer",
+ "label",
+ "liquidity_role",
+ "mark_price",
+ "order_id",
+ "realized_pnl",
+ "subaccount_id",
+ "timestamp",
+ "trade_amount",
+ "trade_fee",
+ "trade_id",
+ "trade_price",
+ "tx_hash",
+ "tx_status"
+ ],
+ "properties": {
+ "direction": {
+ "title": "direction",
+ "type": "string",
+ "enum": ["buy", "sell"],
+ "description": "Order direction"
+ },
+ "index_price": {
+ "title": "index_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Index price of the underlying at the time of the trade"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ },
+ "is_transfer": {
+ "title": "is_transfer",
+ "type": "boolean",
+ "description": "Whether the trade was generated through `private/transfer_position`"
+ },
+ "label": {
+ "title": "label",
+ "type": "string",
+ "description": "Optional user-defined label for the order"
+ },
+ "liquidity_role": {
+ "title": "liquidity_role",
+ "type": "string",
+ "enum": ["maker", "taker"],
+ "description": "Role of the user in the trade"
+ },
+ "mark_price": {
+ "title": "mark_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Mark price of the instrument at the time of the trade"
+ },
+ "order_id": {
+ "title": "order_id",
+ "type": "string",
+ "description": "Order ID"
+ },
+ "realized_pnl": {
+ "title": "realized_pnl",
+ "type": "string",
+ "format": "decimal",
+ "description": "Realized PnL for this trade"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount ID"
+ },
+ "timestamp": {
+ "title": "timestamp",
+ "type": "integer",
+ "description": "Trade timestamp (in ms since Unix epoch)"
+ },
+ "trade_amount": {
+ "title": "trade_amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Amount filled in this trade"
+ },
+ "trade_fee": {
+ "title": "trade_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Fee for this trade"
+ },
+ "trade_id": {
+ "title": "trade_id",
+ "type": "string",
+ "description": "Trade ID"
+ },
+ "trade_price": {
+ "title": "trade_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Price at which the trade was filled"
+ },
+ "tx_hash": {
+ "title": "tx_hash",
+ "type": "string",
+ "default": null,
+ "description": "Blockchain transaction hash",
+ "nullable": true
+ },
+ "tx_status": {
+ "title": "tx_status",
+ "type": "string",
+ "enum": ["requested", "pending", "settled", "reverted", "ignored"],
+ "description": "Blockchain transaction status"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateTransferPositionResultSchema": {
+ "required": ["maker_order", "maker_trade", "taker_order", "taker_trade"],
+ "properties": {
+ "maker_order": {
+ "required": [
+ "amount",
+ "average_price",
+ "cancel_reason",
+ "creation_timestamp",
+ "direction",
+ "filled_amount",
+ "instrument_name",
+ "is_transfer",
+ "label",
+ "last_update_timestamp",
+ "limit_price",
+ "max_fee",
+ "mmp",
+ "nonce",
+ "order_fee",
+ "order_id",
+ "order_status",
+ "order_type",
+ "signature",
+ "signature_expiry_sec",
+ "signer",
+ "subaccount_id",
+ "time_in_force"
+ ],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Order amount in units of the base"
+ },
+ "average_price": {
+ "title": "average_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Average fill price"
+ },
+ "cancel_reason": {
+ "title": "cancel_reason",
+ "type": "string",
+ "enum": [
+ "",
+ "user_request",
+ "mmp_trigger",
+ "insufficient_margin",
+ "signed_max_fee_too_low",
+ "cancel_on_disconnect",
+ "ioc_or_market_partial_fill",
+ "session_key_deregistered",
+ "subaccount_withdrawn",
+ "compliance"
+ ],
+ "description": "If cancelled, reason behind order cancellation"
+ },
+ "creation_timestamp": {
+ "title": "creation_timestamp",
+ "type": "integer",
+ "description": "Creation timestamp (in ms since Unix epoch)"
+ },
+ "direction": {
+ "title": "direction",
+ "type": "string",
+ "enum": ["buy", "sell"],
+ "description": "Order direction"
+ },
+ "filled_amount": {
+ "title": "filled_amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total filled amount for the order"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ },
+ "is_transfer": {
+ "title": "is_transfer",
+ "type": "boolean",
+ "description": "Whether the order was generated through `private/transfer_position`"
+ },
+ "label": {
+ "title": "label",
+ "type": "string",
+ "description": "Optional user-defined label for the order"
+ },
+ "last_update_timestamp": {
+ "title": "last_update_timestamp",
+ "type": "integer",
+ "description": "Last update timestamp (in ms since Unix epoch)"
+ },
+ "limit_price": {
+ "title": "limit_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Limit price in quote currency"
+ },
+ "max_fee": {
+ "title": "max_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Max fee in units of the quote currency"
+ },
+ "mmp": {
+ "title": "mmp",
+ "type": "boolean",
+ "description": "Whether the order is tagged for market maker protections"
+ },
+ "nonce": {
+ "title": "nonce",
+ "type": "integer",
+ "description": "Unique nonce defined as (e.g. 1695836058725001, where 001 is the random number)"
+ },
+ "order_fee": {
+ "title": "order_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total order fee paid so far"
+ },
+ "order_id": {
+ "title": "order_id",
+ "type": "string",
+ "description": "Order ID"
+ },
+ "order_status": {
+ "title": "order_status",
+ "type": "string",
+ "enum": ["open", "filled", "rejected", "cancelled", "expired"],
+ "description": "Order status"
+ },
+ "order_type": {
+ "title": "order_type",
+ "type": "string",
+ "enum": ["limit", "market"],
+ "description": "Order type"
+ },
+ "signature": {
+ "title": "signature",
+ "type": "string",
+ "description": "Ethereum signature of the order"
+ },
+ "signature_expiry_sec": {
+ "title": "signature_expiry_sec",
+ "type": "integer",
+ "description": "Signature expiry timestamp"
+ },
+ "signer": {
+ "title": "signer",
+ "type": "string",
+ "description": "Owner wallet address or registered session key that signed order"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount ID"
+ },
+ "time_in_force": {
+ "title": "time_in_force",
+ "type": "string",
+ "enum": ["gtc", "post_only", "fok", "ioc"],
+ "description": "Time in force"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "maker_trade": {
+ "required": [
+ "direction",
+ "index_price",
+ "instrument_name",
+ "is_transfer",
+ "label",
+ "liquidity_role",
+ "mark_price",
+ "order_id",
+ "realized_pnl",
+ "subaccount_id",
+ "timestamp",
+ "trade_amount",
+ "trade_fee",
+ "trade_id",
+ "trade_price",
+ "tx_hash",
+ "tx_status"
+ ],
+ "properties": {
+ "direction": {
+ "title": "direction",
+ "type": "string",
+ "enum": ["buy", "sell"],
+ "description": "Order direction"
+ },
+ "index_price": {
+ "title": "index_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Index price of the underlying at the time of the trade"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ },
+ "is_transfer": {
+ "title": "is_transfer",
+ "type": "boolean",
+ "description": "Whether the trade was generated through `private/transfer_position`"
+ },
+ "label": {
+ "title": "label",
+ "type": "string",
+ "description": "Optional user-defined label for the order"
+ },
+ "liquidity_role": {
+ "title": "liquidity_role",
+ "type": "string",
+ "enum": ["maker", "taker"],
+ "description": "Role of the user in the trade"
+ },
+ "mark_price": {
+ "title": "mark_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Mark price of the instrument at the time of the trade"
+ },
+ "order_id": {
+ "title": "order_id",
+ "type": "string",
+ "description": "Order ID"
+ },
+ "realized_pnl": {
+ "title": "realized_pnl",
+ "type": "string",
+ "format": "decimal",
+ "description": "Realized PnL for this trade"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount ID"
+ },
+ "timestamp": {
+ "title": "timestamp",
+ "type": "integer",
+ "description": "Trade timestamp (in ms since Unix epoch)"
+ },
+ "trade_amount": {
+ "title": "trade_amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Amount filled in this trade"
+ },
+ "trade_fee": {
+ "title": "trade_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Fee for this trade"
+ },
+ "trade_id": {
+ "title": "trade_id",
+ "type": "string",
+ "description": "Trade ID"
+ },
+ "trade_price": {
+ "title": "trade_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Price at which the trade was filled"
+ },
+ "tx_hash": {
+ "title": "tx_hash",
+ "type": "string",
+ "default": null,
+ "description": "Blockchain transaction hash",
+ "nullable": true
+ },
+ "tx_status": {
+ "title": "tx_status",
+ "type": "string",
+ "enum": ["requested", "pending", "settled", "reverted", "ignored"],
+ "description": "Blockchain transaction status"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "taker_order": {
+ "required": [
+ "amount",
+ "average_price",
+ "cancel_reason",
+ "creation_timestamp",
+ "direction",
+ "filled_amount",
+ "instrument_name",
+ "is_transfer",
+ "label",
+ "last_update_timestamp",
+ "limit_price",
+ "max_fee",
+ "mmp",
+ "nonce",
+ "order_fee",
+ "order_id",
+ "order_status",
+ "order_type",
+ "signature",
+ "signature_expiry_sec",
+ "signer",
+ "subaccount_id",
+ "time_in_force"
+ ],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Order amount in units of the base"
+ },
+ "average_price": {
+ "title": "average_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Average fill price"
+ },
+ "cancel_reason": {
+ "title": "cancel_reason",
+ "type": "string",
+ "enum": [
+ "",
+ "user_request",
+ "mmp_trigger",
+ "insufficient_margin",
+ "signed_max_fee_too_low",
+ "cancel_on_disconnect",
+ "ioc_or_market_partial_fill",
+ "session_key_deregistered",
+ "subaccount_withdrawn",
+ "compliance"
+ ],
+ "description": "If cancelled, reason behind order cancellation"
+ },
+ "creation_timestamp": {
+ "title": "creation_timestamp",
+ "type": "integer",
+ "description": "Creation timestamp (in ms since Unix epoch)"
+ },
+ "direction": {
+ "title": "direction",
+ "type": "string",
+ "enum": ["buy", "sell"],
+ "description": "Order direction"
+ },
+ "filled_amount": {
+ "title": "filled_amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total filled amount for the order"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ },
+ "is_transfer": {
+ "title": "is_transfer",
+ "type": "boolean",
+ "description": "Whether the order was generated through `private/transfer_position`"
+ },
+ "label": {
+ "title": "label",
+ "type": "string",
+ "description": "Optional user-defined label for the order"
+ },
+ "last_update_timestamp": {
+ "title": "last_update_timestamp",
+ "type": "integer",
+ "description": "Last update timestamp (in ms since Unix epoch)"
+ },
+ "limit_price": {
+ "title": "limit_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Limit price in quote currency"
+ },
+ "max_fee": {
+ "title": "max_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Max fee in units of the quote currency"
+ },
+ "mmp": {
+ "title": "mmp",
+ "type": "boolean",
+ "description": "Whether the order is tagged for market maker protections"
+ },
+ "nonce": {
+ "title": "nonce",
+ "type": "integer",
+ "description": "Unique nonce defined as (e.g. 1695836058725001, where 001 is the random number)"
+ },
+ "order_fee": {
+ "title": "order_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total order fee paid so far"
+ },
+ "order_id": {
+ "title": "order_id",
+ "type": "string",
+ "description": "Order ID"
+ },
+ "order_status": {
+ "title": "order_status",
+ "type": "string",
+ "enum": ["open", "filled", "rejected", "cancelled", "expired"],
+ "description": "Order status"
+ },
+ "order_type": {
+ "title": "order_type",
+ "type": "string",
+ "enum": ["limit", "market"],
+ "description": "Order type"
+ },
+ "signature": {
+ "title": "signature",
+ "type": "string",
+ "description": "Ethereum signature of the order"
+ },
+ "signature_expiry_sec": {
+ "title": "signature_expiry_sec",
+ "type": "integer",
+ "description": "Signature expiry timestamp"
+ },
+ "signer": {
+ "title": "signer",
+ "type": "string",
+ "description": "Owner wallet address or registered session key that signed order"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount ID"
+ },
+ "time_in_force": {
+ "title": "time_in_force",
+ "type": "string",
+ "enum": ["gtc", "post_only", "fok", "ioc"],
+ "description": "Time in force"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "taker_trade": {
+ "required": [
+ "direction",
+ "index_price",
+ "instrument_name",
+ "is_transfer",
+ "label",
+ "liquidity_role",
+ "mark_price",
+ "order_id",
+ "realized_pnl",
+ "subaccount_id",
+ "timestamp",
+ "trade_amount",
+ "trade_fee",
+ "trade_id",
+ "trade_price",
+ "tx_hash",
+ "tx_status"
+ ],
+ "properties": {
+ "direction": {
+ "title": "direction",
+ "type": "string",
+ "enum": ["buy", "sell"],
+ "description": "Order direction"
+ },
+ "index_price": {
+ "title": "index_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Index price of the underlying at the time of the trade"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ },
+ "is_transfer": {
+ "title": "is_transfer",
+ "type": "boolean",
+ "description": "Whether the trade was generated through `private/transfer_position`"
+ },
+ "label": {
+ "title": "label",
+ "type": "string",
+ "description": "Optional user-defined label for the order"
+ },
+ "liquidity_role": {
+ "title": "liquidity_role",
+ "type": "string",
+ "enum": ["maker", "taker"],
+ "description": "Role of the user in the trade"
+ },
+ "mark_price": {
+ "title": "mark_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Mark price of the instrument at the time of the trade"
+ },
+ "order_id": {
+ "title": "order_id",
+ "type": "string",
+ "description": "Order ID"
+ },
+ "realized_pnl": {
+ "title": "realized_pnl",
+ "type": "string",
+ "format": "decimal",
+ "description": "Realized PnL for this trade"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount ID"
+ },
+ "timestamp": {
+ "title": "timestamp",
+ "type": "integer",
+ "description": "Trade timestamp (in ms since Unix epoch)"
+ },
+ "trade_amount": {
+ "title": "trade_amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Amount filled in this trade"
+ },
+ "trade_fee": {
+ "title": "trade_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Fee for this trade"
+ },
+ "trade_id": {
+ "title": "trade_id",
+ "type": "string",
+ "description": "Trade ID"
+ },
+ "trade_price": {
+ "title": "trade_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Price at which the trade was filled"
+ },
+ "tx_hash": {
+ "title": "tx_hash",
+ "type": "string",
+ "default": null,
+ "description": "Blockchain transaction hash",
+ "nullable": true
+ },
+ "tx_status": {
+ "title": "tx_status",
+ "type": "string",
+ "enum": ["requested", "pending", "settled", "reverted", "ignored"],
+ "description": "Blockchain transaction status"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "OrderResponseSchema": {
+ "required": [
+ "amount",
+ "average_price",
+ "cancel_reason",
+ "creation_timestamp",
+ "direction",
+ "filled_amount",
+ "instrument_name",
+ "is_transfer",
+ "label",
+ "last_update_timestamp",
+ "limit_price",
+ "max_fee",
+ "mmp",
+ "nonce",
+ "order_fee",
+ "order_id",
+ "order_status",
+ "order_type",
+ "signature",
+ "signature_expiry_sec",
+ "signer",
+ "subaccount_id",
+ "time_in_force"
+ ],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Order amount in units of the base"
+ },
+ "average_price": {
+ "title": "average_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Average fill price"
+ },
+ "cancel_reason": {
+ "title": "cancel_reason",
+ "type": "string",
+ "enum": [
+ "",
+ "user_request",
+ "mmp_trigger",
+ "insufficient_margin",
+ "signed_max_fee_too_low",
+ "cancel_on_disconnect",
+ "ioc_or_market_partial_fill",
+ "session_key_deregistered",
+ "subaccount_withdrawn",
+ "compliance"
+ ],
+ "description": "If cancelled, reason behind order cancellation"
+ },
+ "creation_timestamp": {
+ "title": "creation_timestamp",
+ "type": "integer",
+ "description": "Creation timestamp (in ms since Unix epoch)"
+ },
+ "direction": {
+ "title": "direction",
+ "type": "string",
+ "enum": ["buy", "sell"],
+ "description": "Order direction"
+ },
+ "filled_amount": {
+ "title": "filled_amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total filled amount for the order"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ },
+ "is_transfer": {
+ "title": "is_transfer",
+ "type": "boolean",
+ "description": "Whether the order was generated through `private/transfer_position`"
+ },
+ "label": {
+ "title": "label",
+ "type": "string",
+ "description": "Optional user-defined label for the order"
+ },
+ "last_update_timestamp": {
+ "title": "last_update_timestamp",
+ "type": "integer",
+ "description": "Last update timestamp (in ms since Unix epoch)"
+ },
+ "limit_price": {
+ "title": "limit_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Limit price in quote currency"
+ },
+ "max_fee": {
+ "title": "max_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Max fee in units of the quote currency"
+ },
+ "mmp": {
+ "title": "mmp",
+ "type": "boolean",
+ "description": "Whether the order is tagged for market maker protections"
+ },
+ "nonce": {
+ "title": "nonce",
+ "type": "integer",
+ "description": "Unique nonce defined as (e.g. 1695836058725001, where 001 is the random number)"
+ },
+ "order_fee": {
+ "title": "order_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total order fee paid so far"
+ },
+ "order_id": {
+ "title": "order_id",
+ "type": "string",
+ "description": "Order ID"
+ },
+ "order_status": {
+ "title": "order_status",
+ "type": "string",
+ "enum": ["open", "filled", "rejected", "cancelled", "expired"],
+ "description": "Order status"
+ },
+ "order_type": {
+ "title": "order_type",
+ "type": "string",
+ "enum": ["limit", "market"],
+ "description": "Order type"
+ },
+ "signature": {
+ "title": "signature",
+ "type": "string",
+ "description": "Ethereum signature of the order"
+ },
+ "signature_expiry_sec": {
+ "title": "signature_expiry_sec",
+ "type": "integer",
+ "description": "Signature expiry timestamp"
+ },
+ "signer": {
+ "title": "signer",
+ "type": "string",
+ "description": "Owner wallet address or registered session key that signed order"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount ID"
+ },
+ "time_in_force": {
+ "title": "time_in_force",
+ "type": "string",
+ "enum": ["gtc", "post_only", "fok", "ioc"],
+ "description": "Time in force"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "TradeResponseSchema": {
+ "required": [
+ "direction",
+ "index_price",
+ "instrument_name",
+ "is_transfer",
+ "label",
+ "liquidity_role",
+ "mark_price",
+ "order_id",
+ "realized_pnl",
+ "subaccount_id",
+ "timestamp",
+ "trade_amount",
+ "trade_fee",
+ "trade_id",
+ "trade_price",
+ "tx_hash",
+ "tx_status"
+ ],
+ "properties": {
+ "direction": {
+ "title": "direction",
+ "type": "string",
+ "enum": ["buy", "sell"],
+ "description": "Order direction"
+ },
+ "index_price": {
+ "title": "index_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Index price of the underlying at the time of the trade"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ },
+ "is_transfer": {
+ "title": "is_transfer",
+ "type": "boolean",
+ "description": "Whether the trade was generated through `private/transfer_position`"
+ },
+ "label": {
+ "title": "label",
+ "type": "string",
+ "description": "Optional user-defined label for the order"
+ },
+ "liquidity_role": {
+ "title": "liquidity_role",
+ "type": "string",
+ "enum": ["maker", "taker"],
+ "description": "Role of the user in the trade"
+ },
+ "mark_price": {
+ "title": "mark_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Mark price of the instrument at the time of the trade"
+ },
+ "order_id": {
+ "title": "order_id",
+ "type": "string",
+ "description": "Order ID"
+ },
+ "realized_pnl": {
+ "title": "realized_pnl",
+ "type": "string",
+ "format": "decimal",
+ "description": "Realized PnL for this trade"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount ID"
+ },
+ "timestamp": {
+ "title": "timestamp",
+ "type": "integer",
+ "description": "Trade timestamp (in ms since Unix epoch)"
+ },
+ "trade_amount": {
+ "title": "trade_amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Amount filled in this trade"
+ },
+ "trade_fee": {
+ "title": "trade_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Fee for this trade"
+ },
+ "trade_id": {
+ "title": "trade_id",
+ "type": "string",
+ "description": "Trade ID"
+ },
+ "trade_price": {
+ "title": "trade_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Price at which the trade was filled"
+ },
+ "tx_hash": {
+ "title": "tx_hash",
+ "type": "string",
+ "default": null,
+ "description": "Blockchain transaction hash",
+ "nullable": true
+ },
+ "tx_status": {
+ "title": "tx_status",
+ "type": "string",
+ "enum": ["requested", "pending", "settled", "reverted", "ignored"],
+ "description": "Blockchain transaction status"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PublicMarginWatchParamsSchema": {
+ "required": ["subaccount_id"],
+ "properties": {
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount ID to get margin for."
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PublicMarginWatchResponseSchema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": [
+ "currency",
+ "maintenance_margin",
+ "margin_type",
+ "subaccount_id",
+ "subaccount_value",
+ "valuation_timestamp"
+ ],
+ "properties": {
+ "currency": {
+ "title": "currency",
+ "type": "string",
+ "description": "Currency of subaccount"
+ },
+ "maintenance_margin": {
+ "title": "maintenance_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total maintenance margin requirement of all positions and collaterals.If this value falls below zero, the subaccount will be flagged for liquidation."
+ },
+ "margin_type": {
+ "title": "margin_type",
+ "type": "string",
+ "enum": ["PM", "SM"],
+ "description": "Margin type of subaccount (`PM` (Portfolio Margin) or `SM` (Standard Margin))"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id"
+ },
+ "subaccount_value": {
+ "title": "subaccount_value",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total mark-to-market value of all positions and collaterals"
+ },
+ "valuation_timestamp": {
+ "title": "valuation_timestamp",
+ "type": "integer",
+ "description": "Timestamp (in seconds since epoch) of when margin and MtM were computed."
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PublicMarginWatchResultSchema": {
+ "required": [
+ "currency",
+ "maintenance_margin",
+ "margin_type",
+ "subaccount_id",
+ "subaccount_value",
+ "valuation_timestamp"
+ ],
+ "properties": {
+ "currency": {
+ "title": "currency",
+ "type": "string",
+ "description": "Currency of subaccount"
+ },
+ "maintenance_margin": {
+ "title": "maintenance_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total maintenance margin requirement of all positions and collaterals.If this value falls below zero, the subaccount will be flagged for liquidation."
+ },
+ "margin_type": {
+ "title": "margin_type",
+ "type": "string",
+ "enum": ["PM", "SM"],
+ "description": "Margin type of subaccount (`PM` (Portfolio Margin) or `SM` (Standard Margin))"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id"
+ },
+ "subaccount_value": {
+ "title": "subaccount_value",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total mark-to-market value of all positions and collaterals"
+ },
+ "valuation_timestamp": {
+ "title": "valuation_timestamp",
+ "type": "integer",
+ "description": "Timestamp (in seconds since epoch) of when margin and MtM were computed."
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateGetLiquidationHistoryParamsSchema": {
+ "required": ["subaccount_id"],
+ "properties": {
+ "end_timestamp": {
+ "title": "end_timestamp",
+ "type": "integer",
+ "default": 9223372036854776000,
+ "description": "End timestamp of the event history (default current time)"
+ },
+ "start_timestamp": {
+ "title": "start_timestamp",
+ "type": "integer",
+ "default": 0,
+ "description": "Start timestamp of the event history (default 0)"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount id"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateGetLiquidationHistoryResponseSchema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "title": "result",
+ "type": "array",
+ "description": "",
+ "items": {
+ "required": ["auction_id", "auction_type", "bids", "end_timestamp", "fee", "start_timestamp", "tx_hash"],
+ "properties": {
+ "auction_id": {
+ "title": "auction_id",
+ "type": "string",
+ "description": "Unique ID of the auction"
+ },
+ "auction_type": {
+ "title": "auction_type",
+ "type": "string",
+ "enum": ["solvent", "insolvent"],
+ "description": "Type of auction"
+ },
+ "bids": {
+ "title": "bids",
+ "type": "array",
+ "description": "List of auction bid events",
+ "items": {
+ "required": [
+ "amounts_liquidated",
+ "cash_received",
+ "discount_pnl",
+ "percent_liquidated",
+ "positions_realized_pnl",
+ "realized_pnl",
+ "timestamp",
+ "tx_hash"
+ ],
+ "properties": {
+ "amounts_liquidated": {
+ "title": "amounts_liquidated",
+ "type": "object",
+ "description": "Amounts of each asset that were closed",
+ "additionalProperties": {
+ "title": "amounts_liquidated",
+ "type": "string",
+ "format": "decimal"
+ }
+ },
+ "cash_received": {
+ "title": "cash_received",
+ "type": "string",
+ "format": "decimal",
+ "description": "Cash received for auctioning off the percentage of the subaccount"
+ },
+ "discount_pnl": {
+ "title": "discount_pnl",
+ "type": "string",
+ "format": "decimal",
+ "description": "Realized PnL due to being liquidated at a discount to mark portfolio value"
+ },
+ "percent_liquidated": {
+ "title": "percent_liquidated",
+ "type": "string",
+ "format": "decimal",
+ "description": "Percent of the subaccount that was liquidated"
+ },
+ "positions_realized_pnl": {
+ "title": "positions_realized_pnl",
+ "type": "object",
+ "description": "Realized PnL of each position that was closed",
+ "additionalProperties": {
+ "title": "positions_realized_pnl",
+ "type": "string",
+ "format": "decimal"
+ }
+ },
+ "realized_pnl": {
+ "title": "realized_pnl",
+ "type": "string",
+ "format": "decimal",
+ "description": "Realized PnL of the auction bid, assuming positions are closed at mark price at the time of the liquidation"
+ },
+ "timestamp": {
+ "title": "timestamp",
+ "type": "integer",
+ "description": "Timestamp of the bid (in ms since UNIX epoch)"
+ },
+ "tx_hash": {
+ "title": "tx_hash",
+ "type": "string",
+ "description": "Hash of the bid transaction"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "end_timestamp": {
+ "title": "end_timestamp",
+ "type": "integer",
+ "default": null,
+ "description": "Timestamp of the auction end (in ms since UNIX epoch), or `null` if not ended",
+ "nullable": true
+ },
+ "fee": {
+ "title": "fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Fee paid by the subaccount"
+ },
+ "start_timestamp": {
+ "title": "start_timestamp",
+ "type": "integer",
+ "description": "Timestamp of the auction start (in ms since UNIX epoch)"
+ },
+ "tx_hash": {
+ "title": "tx_hash",
+ "type": "string",
+ "description": "Hash of the transaction that started the auction"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "AuctionResultSchema": {
+ "required": ["auction_id", "auction_type", "bids", "end_timestamp", "fee", "start_timestamp", "tx_hash"],
+ "properties": {
+ "auction_id": {
+ "title": "auction_id",
+ "type": "string",
+ "description": "Unique ID of the auction"
+ },
+ "auction_type": {
+ "title": "auction_type",
+ "type": "string",
+ "enum": ["solvent", "insolvent"],
+ "description": "Type of auction"
+ },
+ "bids": {
+ "title": "bids",
+ "type": "array",
+ "description": "List of auction bid events",
+ "items": {
+ "required": [
+ "amounts_liquidated",
+ "cash_received",
+ "discount_pnl",
+ "percent_liquidated",
+ "positions_realized_pnl",
+ "realized_pnl",
+ "timestamp",
+ "tx_hash"
+ ],
+ "properties": {
+ "amounts_liquidated": {
+ "title": "amounts_liquidated",
+ "type": "object",
+ "description": "Amounts of each asset that were closed",
+ "additionalProperties": {
+ "title": "amounts_liquidated",
+ "type": "string",
+ "format": "decimal"
+ }
+ },
+ "cash_received": {
+ "title": "cash_received",
+ "type": "string",
+ "format": "decimal",
+ "description": "Cash received for auctioning off the percentage of the subaccount"
+ },
+ "discount_pnl": {
+ "title": "discount_pnl",
+ "type": "string",
+ "format": "decimal",
+ "description": "Realized PnL due to being liquidated at a discount to mark portfolio value"
+ },
+ "percent_liquidated": {
+ "title": "percent_liquidated",
+ "type": "string",
+ "format": "decimal",
+ "description": "Percent of the subaccount that was liquidated"
+ },
+ "positions_realized_pnl": {
+ "title": "positions_realized_pnl",
+ "type": "object",
+ "description": "Realized PnL of each position that was closed",
+ "additionalProperties": {
+ "title": "positions_realized_pnl",
+ "type": "string",
+ "format": "decimal"
+ }
+ },
+ "realized_pnl": {
+ "title": "realized_pnl",
+ "type": "string",
+ "format": "decimal",
+ "description": "Realized PnL of the auction bid, assuming positions are closed at mark price at the time of the liquidation"
+ },
+ "timestamp": {
+ "title": "timestamp",
+ "type": "integer",
+ "description": "Timestamp of the bid (in ms since UNIX epoch)"
+ },
+ "tx_hash": {
+ "title": "tx_hash",
+ "type": "string",
+ "description": "Hash of the bid transaction"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "end_timestamp": {
+ "title": "end_timestamp",
+ "type": "integer",
+ "default": null,
+ "description": "Timestamp of the auction end (in ms since UNIX epoch), or `null` if not ended",
+ "nullable": true
+ },
+ "fee": {
+ "title": "fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Fee paid by the subaccount"
+ },
+ "start_timestamp": {
+ "title": "start_timestamp",
+ "type": "integer",
+ "description": "Timestamp of the auction start (in ms since UNIX epoch)"
+ },
+ "tx_hash": {
+ "title": "tx_hash",
+ "type": "string",
+ "description": "Hash of the transaction that started the auction"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "AuctionBidEventSchema": {
+ "required": [
+ "amounts_liquidated",
+ "cash_received",
+ "discount_pnl",
+ "percent_liquidated",
+ "positions_realized_pnl",
+ "realized_pnl",
+ "timestamp",
+ "tx_hash"
+ ],
+ "properties": {
+ "amounts_liquidated": {
+ "title": "amounts_liquidated",
+ "type": "object",
+ "description": "Amounts of each asset that were closed",
+ "additionalProperties": {
+ "title": "amounts_liquidated",
+ "type": "string",
+ "format": "decimal"
+ }
+ },
+ "cash_received": {
+ "title": "cash_received",
+ "type": "string",
+ "format": "decimal",
+ "description": "Cash received for auctioning off the percentage of the subaccount"
+ },
+ "discount_pnl": {
+ "title": "discount_pnl",
+ "type": "string",
+ "format": "decimal",
+ "description": "Realized PnL due to being liquidated at a discount to mark portfolio value"
+ },
+ "percent_liquidated": {
+ "title": "percent_liquidated",
+ "type": "string",
+ "format": "decimal",
+ "description": "Percent of the subaccount that was liquidated"
+ },
+ "positions_realized_pnl": {
+ "title": "positions_realized_pnl",
+ "type": "object",
+ "description": "Realized PnL of each position that was closed",
+ "additionalProperties": {
+ "title": "positions_realized_pnl",
+ "type": "string",
+ "format": "decimal"
+ }
+ },
+ "realized_pnl": {
+ "title": "realized_pnl",
+ "type": "string",
+ "format": "decimal",
+ "description": "Realized PnL of the auction bid, assuming positions are closed at mark price at the time of the liquidation"
+ },
+ "timestamp": {
+ "title": "timestamp",
+ "type": "integer",
+ "description": "Timestamp of the bid (in ms since UNIX epoch)"
+ },
+ "tx_hash": {
+ "title": "tx_hash",
+ "type": "string",
+ "description": "Hash of the bid transaction"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateGetPositionsParamsSchema": {
+ "required": ["subaccount_id"],
+ "properties": {
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateGetPositionsResponseSchema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["positions", "subaccount_id"],
+ "properties": {
+ "positions": {
+ "title": "positions",
+ "type": "array",
+ "description": "All active positions of subaccount",
+ "items": {
+ "required": [
+ "amount",
+ "average_price",
+ "cumulative_funding",
+ "delta",
+ "gamma",
+ "index_price",
+ "initial_margin",
+ "instrument_name",
+ "instrument_type",
+ "leverage",
+ "liquidation_price",
+ "maintenance_margin",
+ "mark_price",
+ "mark_value",
+ "net_settlements",
+ "open_orders_margin",
+ "pending_funding",
+ "realized_pnl",
+ "theta",
+ "unrealized_pnl",
+ "vega"
+ ],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Position amount held by subaccount"
+ },
+ "average_price": {
+ "title": "average_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Average price of whole position"
+ },
+ "cumulative_funding": {
+ "title": "cumulative_funding",
+ "type": "string",
+ "format": "decimal",
+ "description": "Cumulative funding for the position (only for perpetuals)."
+ },
+ "delta": {
+ "title": "delta",
+ "type": "string",
+ "format": "decimal",
+ "description": "Asset delta (w.r.t. forward price for options, `1.0` for perps)"
+ },
+ "gamma": {
+ "title": "gamma",
+ "type": "string",
+ "format": "decimal",
+ "description": "Asset gamma (zero for non-options)"
+ },
+ "index_price": {
+ "title": "index_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Current index (oracle) price for position's currency"
+ },
+ "initial_margin": {
+ "title": "initial_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "USD initial margin requirement for this position"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name (same as the base Asset name)"
+ },
+ "instrument_type": {
+ "title": "instrument_type",
+ "type": "string",
+ "enum": ["erc20", "option", "perp"],
+ "description": "`erc20`, `option`, or `perp`"
+ },
+ "leverage": {
+ "title": "leverage",
+ "type": "string",
+ "format": "decimal",
+ "default": null,
+ "description": "Only for perps. Leverage of the position, defined as `abs(notional) / collateral net of options margin`",
+ "nullable": true
+ },
+ "liquidation_price": {
+ "title": "liquidation_price",
+ "type": "string",
+ "format": "decimal",
+ "default": null,
+ "description": "Index price at which position will be liquidated",
+ "nullable": true
+ },
+ "maintenance_margin": {
+ "title": "maintenance_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "USD maintenance margin requirement for this position"
+ },
+ "mark_price": {
+ "title": "mark_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Current mark price for position's instrument"
+ },
+ "mark_value": {
+ "title": "mark_value",
+ "type": "string",
+ "format": "decimal",
+ "description": "USD value of the position; this represents how much USD can be recieved by fully closing the position at the current oracle price"
+ },
+ "net_settlements": {
+ "title": "net_settlements",
+ "type": "string",
+ "format": "decimal",
+ "description": "Net amount of USD from position settlements that has been paid to the user's subaccount. This number is subtracted from the portfolio value for margin calculations purposes.
Positive values mean the user has recieved USD from settlements, or is awaiting settlement of USD losses. Negative values mean the user has paid USD for settlements, or is awaiting settlement of USD gains."
+ },
+ "open_orders_margin": {
+ "title": "open_orders_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "USD margin requirement for all open orders for this asset / instrument"
+ },
+ "pending_funding": {
+ "title": "pending_funding",
+ "type": "string",
+ "format": "decimal",
+ "description": "A portion of funding payments that has not yet been settled into cash balance (only for perpetuals). This number is added to the portfolio value for margin calculations purposes."
+ },
+ "realized_pnl": {
+ "title": "realized_pnl",
+ "type": "string",
+ "format": "decimal",
+ "description": "Realized trading profit or loss of the position."
+ },
+ "theta": {
+ "title": "theta",
+ "type": "string",
+ "format": "decimal",
+ "description": "Asset theta (zero for non-options)"
+ },
+ "unrealized_pnl": {
+ "title": "unrealized_pnl",
+ "type": "string",
+ "format": "decimal",
+ "description": "Unrealized trading profit or loss of the position."
+ },
+ "vega": {
+ "title": "vega",
+ "type": "string",
+ "format": "decimal",
+ "description": "Asset vega (zero for non-options)"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateGetPositionsResultSchema": {
+ "required": ["positions", "subaccount_id"],
+ "properties": {
+ "positions": {
+ "title": "positions",
+ "type": "array",
+ "description": "All active positions of subaccount",
+ "items": {
+ "required": [
+ "amount",
+ "average_price",
+ "cumulative_funding",
+ "delta",
+ "gamma",
+ "index_price",
+ "initial_margin",
+ "instrument_name",
+ "instrument_type",
+ "leverage",
+ "liquidation_price",
+ "maintenance_margin",
+ "mark_price",
+ "mark_value",
+ "net_settlements",
+ "open_orders_margin",
+ "pending_funding",
+ "realized_pnl",
+ "theta",
+ "unrealized_pnl",
+ "vega"
+ ],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Position amount held by subaccount"
+ },
+ "average_price": {
+ "title": "average_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Average price of whole position"
+ },
+ "cumulative_funding": {
+ "title": "cumulative_funding",
+ "type": "string",
+ "format": "decimal",
+ "description": "Cumulative funding for the position (only for perpetuals)."
+ },
+ "delta": {
+ "title": "delta",
+ "type": "string",
+ "format": "decimal",
+ "description": "Asset delta (w.r.t. forward price for options, `1.0` for perps)"
+ },
+ "gamma": {
+ "title": "gamma",
+ "type": "string",
+ "format": "decimal",
+ "description": "Asset gamma (zero for non-options)"
+ },
+ "index_price": {
+ "title": "index_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Current index (oracle) price for position's currency"
+ },
+ "initial_margin": {
+ "title": "initial_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "USD initial margin requirement for this position"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name (same as the base Asset name)"
+ },
+ "instrument_type": {
+ "title": "instrument_type",
+ "type": "string",
+ "enum": ["erc20", "option", "perp"],
+ "description": "`erc20`, `option`, or `perp`"
+ },
+ "leverage": {
+ "title": "leverage",
+ "type": "string",
+ "format": "decimal",
+ "default": null,
+ "description": "Only for perps. Leverage of the position, defined as `abs(notional) / collateral net of options margin`",
+ "nullable": true
+ },
+ "liquidation_price": {
+ "title": "liquidation_price",
+ "type": "string",
+ "format": "decimal",
+ "default": null,
+ "description": "Index price at which position will be liquidated",
+ "nullable": true
+ },
+ "maintenance_margin": {
+ "title": "maintenance_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "USD maintenance margin requirement for this position"
+ },
+ "mark_price": {
+ "title": "mark_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Current mark price for position's instrument"
+ },
+ "mark_value": {
+ "title": "mark_value",
+ "type": "string",
+ "format": "decimal",
+ "description": "USD value of the position; this represents how much USD can be recieved by fully closing the position at the current oracle price"
+ },
+ "net_settlements": {
+ "title": "net_settlements",
+ "type": "string",
+ "format": "decimal",
+ "description": "Net amount of USD from position settlements that has been paid to the user's subaccount. This number is subtracted from the portfolio value for margin calculations purposes.
Positive values mean the user has recieved USD from settlements, or is awaiting settlement of USD losses. Negative values mean the user has paid USD for settlements, or is awaiting settlement of USD gains."
+ },
+ "open_orders_margin": {
+ "title": "open_orders_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "USD margin requirement for all open orders for this asset / instrument"
+ },
+ "pending_funding": {
+ "title": "pending_funding",
+ "type": "string",
+ "format": "decimal",
+ "description": "A portion of funding payments that has not yet been settled into cash balance (only for perpetuals). This number is added to the portfolio value for margin calculations purposes."
+ },
+ "realized_pnl": {
+ "title": "realized_pnl",
+ "type": "string",
+ "format": "decimal",
+ "description": "Realized trading profit or loss of the position."
+ },
+ "theta": {
+ "title": "theta",
+ "type": "string",
+ "format": "decimal",
+ "description": "Asset theta (zero for non-options)"
+ },
+ "unrealized_pnl": {
+ "title": "unrealized_pnl",
+ "type": "string",
+ "format": "decimal",
+ "description": "Unrealized trading profit or loss of the position."
+ },
+ "vega": {
+ "title": "vega",
+ "type": "string",
+ "format": "decimal",
+ "description": "Asset vega (zero for non-options)"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PositionResponseSchema": {
+ "required": [
+ "amount",
+ "average_price",
+ "cumulative_funding",
+ "delta",
+ "gamma",
+ "index_price",
+ "initial_margin",
+ "instrument_name",
+ "instrument_type",
+ "leverage",
+ "liquidation_price",
+ "maintenance_margin",
+ "mark_price",
+ "mark_value",
+ "net_settlements",
+ "open_orders_margin",
+ "pending_funding",
+ "realized_pnl",
+ "theta",
+ "unrealized_pnl",
+ "vega"
+ ],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Position amount held by subaccount"
+ },
+ "average_price": {
+ "title": "average_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Average price of whole position"
+ },
+ "cumulative_funding": {
+ "title": "cumulative_funding",
+ "type": "string",
+ "format": "decimal",
+ "description": "Cumulative funding for the position (only for perpetuals)."
+ },
+ "delta": {
+ "title": "delta",
+ "type": "string",
+ "format": "decimal",
+ "description": "Asset delta (w.r.t. forward price for options, `1.0` for perps)"
+ },
+ "gamma": {
+ "title": "gamma",
+ "type": "string",
+ "format": "decimal",
+ "description": "Asset gamma (zero for non-options)"
+ },
+ "index_price": {
+ "title": "index_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Current index (oracle) price for position's currency"
+ },
+ "initial_margin": {
+ "title": "initial_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "USD initial margin requirement for this position"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name (same as the base Asset name)"
+ },
+ "instrument_type": {
+ "title": "instrument_type",
+ "type": "string",
+ "enum": ["erc20", "option", "perp"],
+ "description": "`erc20`, `option`, or `perp`"
+ },
+ "leverage": {
+ "title": "leverage",
+ "type": "string",
+ "format": "decimal",
+ "default": null,
+ "description": "Only for perps. Leverage of the position, defined as `abs(notional) / collateral net of options margin`",
+ "nullable": true
+ },
+ "liquidation_price": {
+ "title": "liquidation_price",
+ "type": "string",
+ "format": "decimal",
+ "default": null,
+ "description": "Index price at which position will be liquidated",
+ "nullable": true
+ },
+ "maintenance_margin": {
+ "title": "maintenance_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "USD maintenance margin requirement for this position"
+ },
+ "mark_price": {
+ "title": "mark_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Current mark price for position's instrument"
+ },
+ "mark_value": {
+ "title": "mark_value",
+ "type": "string",
+ "format": "decimal",
+ "description": "USD value of the position; this represents how much USD can be recieved by fully closing the position at the current oracle price"
+ },
+ "net_settlements": {
+ "title": "net_settlements",
+ "type": "string",
+ "format": "decimal",
+ "description": "Net amount of USD from position settlements that has been paid to the user's subaccount. This number is subtracted from the portfolio value for margin calculations purposes.
Positive values mean the user has recieved USD from settlements, or is awaiting settlement of USD losses. Negative values mean the user has paid USD for settlements, or is awaiting settlement of USD gains."
+ },
+ "open_orders_margin": {
+ "title": "open_orders_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "USD margin requirement for all open orders for this asset / instrument"
+ },
+ "pending_funding": {
+ "title": "pending_funding",
+ "type": "string",
+ "format": "decimal",
+ "description": "A portion of funding payments that has not yet been settled into cash balance (only for perpetuals). This number is added to the portfolio value for margin calculations purposes."
+ },
+ "realized_pnl": {
+ "title": "realized_pnl",
+ "type": "string",
+ "format": "decimal",
+ "description": "Realized trading profit or loss of the position."
+ },
+ "theta": {
+ "title": "theta",
+ "type": "string",
+ "format": "decimal",
+ "description": "Asset theta (zero for non-options)"
+ },
+ "unrealized_pnl": {
+ "title": "unrealized_pnl",
+ "type": "string",
+ "format": "decimal",
+ "description": "Unrealized trading profit or loss of the position."
+ },
+ "vega": {
+ "title": "vega",
+ "type": "string",
+ "format": "decimal",
+ "description": "Asset vega (zero for non-options)"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateGetFundingHistoryParamsSchema": {
+ "required": ["subaccount_id"],
+ "properties": {
+ "end_timestamp": {
+ "title": "end_timestamp",
+ "type": "integer",
+ "default": 9223372036854776000,
+ "description": "End timestamp of the event history (default current time)"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "default": null,
+ "description": "Instrument name (returns history for all perpetuals if not provided)",
+ "nullable": true
+ },
+ "start_timestamp": {
+ "title": "start_timestamp",
+ "type": "integer",
+ "default": 0,
+ "description": "Start timestamp of the event history (default 0)"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount id"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateGetFundingHistoryResponseSchema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["events"],
+ "properties": {
+ "events": {
+ "title": "events",
+ "type": "array",
+ "description": "List of funding payments",
+ "items": {
+ "required": ["funding", "instrument_name", "timestamp"],
+ "properties": {
+ "funding": {
+ "title": "funding",
+ "type": "string",
+ "format": "decimal",
+ "description": "Dollar funding paid (if negative) or received (if positive) by the subaccount"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ },
+ "timestamp": {
+ "title": "timestamp",
+ "type": "integer",
+ "description": "Timestamp of the funding payment (in ms since UNIX epoch)"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateGetFundingHistoryResultSchema": {
+ "required": ["events"],
+ "properties": {
+ "events": {
+ "title": "events",
+ "type": "array",
+ "description": "List of funding payments",
+ "items": {
+ "required": ["funding", "instrument_name", "timestamp"],
+ "properties": {
+ "funding": {
+ "title": "funding",
+ "type": "string",
+ "format": "decimal",
+ "description": "Dollar funding paid (if negative) or received (if positive) by the subaccount"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ },
+ "timestamp": {
+ "title": "timestamp",
+ "type": "integer",
+ "description": "Timestamp of the funding payment (in ms since UNIX epoch)"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "FundingPaymentSchema": {
+ "required": ["funding", "instrument_name", "timestamp"],
+ "properties": {
+ "funding": {
+ "title": "funding",
+ "type": "string",
+ "format": "decimal",
+ "description": "Dollar funding paid (if negative) or received (if positive) by the subaccount"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ },
+ "timestamp": {
+ "title": "timestamp",
+ "type": "integer",
+ "description": "Timestamp of the funding payment (in ms since UNIX epoch)"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateOrderParamsSchema": {
+ "required": [
+ "amount",
+ "direction",
+ "instrument_name",
+ "limit_price",
+ "max_fee",
+ "nonce",
+ "signature",
+ "signature_expiry_sec",
+ "signer",
+ "subaccount_id"
+ ],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Order amount in units of the base"
+ },
+ "direction": {
+ "title": "direction",
+ "type": "string",
+ "enum": ["buy", "sell"],
+ "description": "Order direction"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ },
+ "label": {
+ "title": "label",
+ "type": "string",
+ "default": "",
+ "description": "Optional user-defined label for the order"
+ },
+ "limit_price": {
+ "title": "limit_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Limit price in quote currency.
This field is still required for market orders because it is a component of the signature. However, market orders will not leave a resting order in the book in case of a partial fill."
+ },
+ "max_fee": {
+ "title": "max_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Max fee in units of the quote currency. Order will be rejected if the supplied max fee is below the estimated fee for this order."
+ },
+ "mmp": {
+ "title": "mmp",
+ "type": "boolean",
+ "default": false,
+ "description": "Whether the order is tagged for market maker protections (default false)"
+ },
+ "nonce": {
+ "title": "nonce",
+ "type": "integer",
+ "description": "Unique nonce defined as (e.g. 1695836058725001, where 001 is the random number)"
+ },
+ "order_type": {
+ "title": "order_type",
+ "type": "string",
+ "default": "limit",
+ "enum": ["limit", "market"],
+ "description": "Order type:
- `limit`: limit order (default)
- `market`: market order, note that limit_price is still required for market orders, but unfilled order portion will be marked as cancelled"
+ },
+ "reduce_only": {
+ "title": "reduce_only",
+ "type": "boolean",
+ "default": false,
+ "description": "If true, the order will not be able to increase position's size (default false). If the order amount exceeds available position size, the order will be filled up to the position size and the remainder will be cancelled. This flag is only supported for market orders or non-resting limit orders (IOC or FOK)"
+ },
+ "referral_code": {
+ "title": "referral_code",
+ "type": "string",
+ "default": "",
+ "description": "Optional referral code for the order"
+ },
+ "reject_timestamp": {
+ "title": "reject_timestamp",
+ "type": "integer",
+ "default": 9223372036854776000,
+ "description": "UTC timestamp in ms, if provided the matching engine will reject the order with an error if `reject_timestamp` < `server_time`. Note that the timestamp must be consistent with the server time: use `public/get_time` method to obtain current server time."
+ },
+ "signature": {
+ "title": "signature",
+ "type": "string",
+ "description": "Etherium signature of the order"
+ },
+ "signature_expiry_sec": {
+ "title": "signature_expiry_sec",
+ "type": "integer",
+ "description": "Unix timestamp in seconds. Order signature becomes invalid after this time, and the system will cancel the order.Expiry MUST be at least 5 min from now."
+ },
+ "signer": {
+ "title": "signer",
+ "type": "string",
+ "description": "Owner wallet address or registered session key that signed order"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount ID"
+ },
+ "time_in_force": {
+ "title": "time_in_force",
+ "type": "string",
+ "default": "gtc",
+ "enum": ["gtc", "post_only", "fok", "ioc"],
+ "description": "Time in force behaviour:
- `gtc`: good til cancelled (default)
- `post_only`: a limit order that will be rejected if it crosses any order in the book, i.e. acts as a taker order
- `fok`: fill or kill, will be rejected if it is not fully filled
- `ioc`: immediate or cancel, fill at best bid/ask (market) or at limit price (limit), the unfilled portion is cancelled
Note that the order will still expire on the `signature_expiry_sec` timestamp."
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateOrderResponseSchema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["order", "trades"],
+ "properties": {
+ "order": {
+ "required": [
+ "amount",
+ "average_price",
+ "cancel_reason",
+ "creation_timestamp",
+ "direction",
+ "filled_amount",
+ "instrument_name",
+ "is_transfer",
+ "label",
+ "last_update_timestamp",
+ "limit_price",
+ "max_fee",
+ "mmp",
+ "nonce",
+ "order_fee",
+ "order_id",
+ "order_status",
+ "order_type",
+ "signature",
+ "signature_expiry_sec",
+ "signer",
+ "subaccount_id",
+ "time_in_force"
+ ],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Order amount in units of the base"
+ },
+ "average_price": {
+ "title": "average_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Average fill price"
+ },
+ "cancel_reason": {
+ "title": "cancel_reason",
+ "type": "string",
+ "enum": [
+ "",
+ "user_request",
+ "mmp_trigger",
+ "insufficient_margin",
+ "signed_max_fee_too_low",
+ "cancel_on_disconnect",
+ "ioc_or_market_partial_fill",
+ "session_key_deregistered",
+ "subaccount_withdrawn",
+ "compliance"
+ ],
+ "description": "If cancelled, reason behind order cancellation"
+ },
+ "creation_timestamp": {
+ "title": "creation_timestamp",
+ "type": "integer",
+ "description": "Creation timestamp (in ms since Unix epoch)"
+ },
+ "direction": {
+ "title": "direction",
+ "type": "string",
+ "enum": ["buy", "sell"],
+ "description": "Order direction"
+ },
+ "filled_amount": {
+ "title": "filled_amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total filled amount for the order"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ },
+ "is_transfer": {
+ "title": "is_transfer",
+ "type": "boolean",
+ "description": "Whether the order was generated through `private/transfer_position`"
+ },
+ "label": {
+ "title": "label",
+ "type": "string",
+ "description": "Optional user-defined label for the order"
+ },
+ "last_update_timestamp": {
+ "title": "last_update_timestamp",
+ "type": "integer",
+ "description": "Last update timestamp (in ms since Unix epoch)"
+ },
+ "limit_price": {
+ "title": "limit_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Limit price in quote currency"
+ },
+ "max_fee": {
+ "title": "max_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Max fee in units of the quote currency"
+ },
+ "mmp": {
+ "title": "mmp",
+ "type": "boolean",
+ "description": "Whether the order is tagged for market maker protections"
+ },
+ "nonce": {
+ "title": "nonce",
+ "type": "integer",
+ "description": "Unique nonce defined as (e.g. 1695836058725001, where 001 is the random number)"
+ },
+ "order_fee": {
+ "title": "order_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total order fee paid so far"
+ },
+ "order_id": {
+ "title": "order_id",
+ "type": "string",
+ "description": "Order ID"
+ },
+ "order_status": {
+ "title": "order_status",
+ "type": "string",
+ "enum": ["open", "filled", "rejected", "cancelled", "expired"],
+ "description": "Order status"
+ },
+ "order_type": {
+ "title": "order_type",
+ "type": "string",
+ "enum": ["limit", "market"],
+ "description": "Order type"
+ },
+ "signature": {
+ "title": "signature",
+ "type": "string",
+ "description": "Ethereum signature of the order"
+ },
+ "signature_expiry_sec": {
+ "title": "signature_expiry_sec",
+ "type": "integer",
+ "description": "Signature expiry timestamp"
+ },
+ "signer": {
+ "title": "signer",
+ "type": "string",
+ "description": "Owner wallet address or registered session key that signed order"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount ID"
+ },
+ "time_in_force": {
+ "title": "time_in_force",
+ "type": "string",
+ "enum": ["gtc", "post_only", "fok", "ioc"],
+ "description": "Time in force"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "trades": {
+ "title": "trades",
+ "type": "array",
+ "items": {
+ "required": [
+ "direction",
+ "index_price",
+ "instrument_name",
+ "is_transfer",
+ "label",
+ "liquidity_role",
+ "mark_price",
+ "order_id",
+ "realized_pnl",
+ "subaccount_id",
+ "timestamp",
+ "trade_amount",
+ "trade_fee",
+ "trade_id",
+ "trade_price",
+ "tx_hash",
+ "tx_status"
+ ],
+ "properties": {
+ "direction": {
+ "title": "direction",
+ "type": "string",
+ "enum": ["buy", "sell"],
+ "description": "Order direction"
+ },
+ "index_price": {
+ "title": "index_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Index price of the underlying at the time of the trade"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ },
+ "is_transfer": {
+ "title": "is_transfer",
+ "type": "boolean",
+ "description": "Whether the trade was generated through `private/transfer_position`"
+ },
+ "label": {
+ "title": "label",
+ "type": "string",
+ "description": "Optional user-defined label for the order"
+ },
+ "liquidity_role": {
+ "title": "liquidity_role",
+ "type": "string",
+ "enum": ["maker", "taker"],
+ "description": "Role of the user in the trade"
+ },
+ "mark_price": {
+ "title": "mark_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Mark price of the instrument at the time of the trade"
+ },
+ "order_id": {
+ "title": "order_id",
+ "type": "string",
+ "description": "Order ID"
+ },
+ "realized_pnl": {
+ "title": "realized_pnl",
+ "type": "string",
+ "format": "decimal",
+ "description": "Realized PnL for this trade"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount ID"
+ },
+ "timestamp": {
+ "title": "timestamp",
+ "type": "integer",
+ "description": "Trade timestamp (in ms since Unix epoch)"
+ },
+ "trade_amount": {
+ "title": "trade_amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Amount filled in this trade"
+ },
+ "trade_fee": {
+ "title": "trade_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Fee for this trade"
+ },
+ "trade_id": {
+ "title": "trade_id",
+ "type": "string",
+ "description": "Trade ID"
+ },
+ "trade_price": {
+ "title": "trade_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Price at which the trade was filled"
+ },
+ "tx_hash": {
+ "title": "tx_hash",
+ "type": "string",
+ "default": null,
+ "description": "Blockchain transaction hash",
+ "nullable": true
+ },
+ "tx_status": {
+ "title": "tx_status",
+ "type": "string",
+ "enum": ["requested", "pending", "settled", "reverted", "ignored"],
+ "description": "Blockchain transaction status"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateOrderResultSchema": {
+ "required": ["order", "trades"],
+ "properties": {
+ "order": {
+ "required": [
+ "amount",
+ "average_price",
+ "cancel_reason",
+ "creation_timestamp",
+ "direction",
+ "filled_amount",
+ "instrument_name",
+ "is_transfer",
+ "label",
+ "last_update_timestamp",
+ "limit_price",
+ "max_fee",
+ "mmp",
+ "nonce",
+ "order_fee",
+ "order_id",
+ "order_status",
+ "order_type",
+ "signature",
+ "signature_expiry_sec",
+ "signer",
+ "subaccount_id",
+ "time_in_force"
+ ],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Order amount in units of the base"
+ },
+ "average_price": {
+ "title": "average_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Average fill price"
+ },
+ "cancel_reason": {
+ "title": "cancel_reason",
+ "type": "string",
+ "enum": [
+ "",
+ "user_request",
+ "mmp_trigger",
+ "insufficient_margin",
+ "signed_max_fee_too_low",
+ "cancel_on_disconnect",
+ "ioc_or_market_partial_fill",
+ "session_key_deregistered",
+ "subaccount_withdrawn",
+ "compliance"
+ ],
+ "description": "If cancelled, reason behind order cancellation"
+ },
+ "creation_timestamp": {
+ "title": "creation_timestamp",
+ "type": "integer",
+ "description": "Creation timestamp (in ms since Unix epoch)"
+ },
+ "direction": {
+ "title": "direction",
+ "type": "string",
+ "enum": ["buy", "sell"],
+ "description": "Order direction"
+ },
+ "filled_amount": {
+ "title": "filled_amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total filled amount for the order"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ },
+ "is_transfer": {
+ "title": "is_transfer",
+ "type": "boolean",
+ "description": "Whether the order was generated through `private/transfer_position`"
+ },
+ "label": {
+ "title": "label",
+ "type": "string",
+ "description": "Optional user-defined label for the order"
+ },
+ "last_update_timestamp": {
+ "title": "last_update_timestamp",
+ "type": "integer",
+ "description": "Last update timestamp (in ms since Unix epoch)"
+ },
+ "limit_price": {
+ "title": "limit_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Limit price in quote currency"
+ },
+ "max_fee": {
+ "title": "max_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Max fee in units of the quote currency"
+ },
+ "mmp": {
+ "title": "mmp",
+ "type": "boolean",
+ "description": "Whether the order is tagged for market maker protections"
+ },
+ "nonce": {
+ "title": "nonce",
+ "type": "integer",
+ "description": "Unique nonce defined as (e.g. 1695836058725001, where 001 is the random number)"
+ },
+ "order_fee": {
+ "title": "order_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total order fee paid so far"
+ },
+ "order_id": {
+ "title": "order_id",
+ "type": "string",
+ "description": "Order ID"
+ },
+ "order_status": {
+ "title": "order_status",
+ "type": "string",
+ "enum": ["open", "filled", "rejected", "cancelled", "expired"],
+ "description": "Order status"
+ },
+ "order_type": {
+ "title": "order_type",
+ "type": "string",
+ "enum": ["limit", "market"],
+ "description": "Order type"
+ },
+ "signature": {
+ "title": "signature",
+ "type": "string",
+ "description": "Ethereum signature of the order"
+ },
+ "signature_expiry_sec": {
+ "title": "signature_expiry_sec",
+ "type": "integer",
+ "description": "Signature expiry timestamp"
+ },
+ "signer": {
+ "title": "signer",
+ "type": "string",
+ "description": "Owner wallet address or registered session key that signed order"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount ID"
+ },
+ "time_in_force": {
+ "title": "time_in_force",
+ "type": "string",
+ "enum": ["gtc", "post_only", "fok", "ioc"],
+ "description": "Time in force"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "trades": {
+ "title": "trades",
+ "type": "array",
+ "items": {
+ "required": [
+ "direction",
+ "index_price",
+ "instrument_name",
+ "is_transfer",
+ "label",
+ "liquidity_role",
+ "mark_price",
+ "order_id",
+ "realized_pnl",
+ "subaccount_id",
+ "timestamp",
+ "trade_amount",
+ "trade_fee",
+ "trade_id",
+ "trade_price",
+ "tx_hash",
+ "tx_status"
+ ],
+ "properties": {
+ "direction": {
+ "title": "direction",
+ "type": "string",
+ "enum": ["buy", "sell"],
+ "description": "Order direction"
+ },
+ "index_price": {
+ "title": "index_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Index price of the underlying at the time of the trade"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ },
+ "is_transfer": {
+ "title": "is_transfer",
+ "type": "boolean",
+ "description": "Whether the trade was generated through `private/transfer_position`"
+ },
+ "label": {
+ "title": "label",
+ "type": "string",
+ "description": "Optional user-defined label for the order"
+ },
+ "liquidity_role": {
+ "title": "liquidity_role",
+ "type": "string",
+ "enum": ["maker", "taker"],
+ "description": "Role of the user in the trade"
+ },
+ "mark_price": {
+ "title": "mark_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Mark price of the instrument at the time of the trade"
+ },
+ "order_id": {
+ "title": "order_id",
+ "type": "string",
+ "description": "Order ID"
+ },
+ "realized_pnl": {
+ "title": "realized_pnl",
+ "type": "string",
+ "format": "decimal",
+ "description": "Realized PnL for this trade"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount ID"
+ },
+ "timestamp": {
+ "title": "timestamp",
+ "type": "integer",
+ "description": "Trade timestamp (in ms since Unix epoch)"
+ },
+ "trade_amount": {
+ "title": "trade_amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Amount filled in this trade"
+ },
+ "trade_fee": {
+ "title": "trade_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Fee for this trade"
+ },
+ "trade_id": {
+ "title": "trade_id",
+ "type": "string",
+ "description": "Trade ID"
+ },
+ "trade_price": {
+ "title": "trade_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Price at which the trade was filled"
+ },
+ "tx_hash": {
+ "title": "tx_hash",
+ "type": "string",
+ "default": null,
+ "description": "Blockchain transaction hash",
+ "nullable": true
+ },
+ "tx_status": {
+ "title": "tx_status",
+ "type": "string",
+ "enum": ["requested", "pending", "settled", "reverted", "ignored"],
+ "description": "Blockchain transaction status"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateChangeSubaccountLabelParamsSchema": {
+ "required": ["label", "subaccount_id"],
+ "properties": {
+ "label": {
+ "title": "label",
+ "type": "string",
+ "description": "User defined label"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateChangeSubaccountLabelResponseSchema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["label", "subaccount_id"],
+ "properties": {
+ "label": {
+ "title": "label",
+ "type": "string",
+ "description": "User defined label"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateChangeSubaccountLabelResultSchema": {
+ "required": ["label", "subaccount_id"],
+ "properties": {
+ "label": {
+ "title": "label",
+ "type": "string",
+ "description": "User defined label"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PublicGetMarginParamsSchema": {
+ "required": ["margin_type", "simulated_positions"],
+ "properties": {
+ "margin_type": {
+ "title": "margin_type",
+ "type": "string",
+ "enum": ["PM", "SM"],
+ "description": "`PM` (Portfolio Margin) or `SM` (Standard Margin)"
+ },
+ "simulated_position_changes": {
+ "title": "simulated_position_changes",
+ "type": "array",
+ "default": null,
+ "description": "Optional, add positions to simulate a trade",
+ "items": {
+ "required": ["amount", "instrument_name"],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Position amount to simulate"
+ },
+ "entry_price": {
+ "title": "entry_price",
+ "type": "string",
+ "format": "decimal",
+ "default": null,
+ "description": "Only for perps. Entry price to use in the simulation. Mark price is used if not provided.",
+ "nullable": true
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "nullable": true
+ },
+ "simulated_positions": {
+ "title": "simulated_positions",
+ "type": "array",
+ "description": "List of positions in a simulated portfolio",
+ "items": {
+ "required": ["amount", "instrument_name"],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Position amount to simulate"
+ },
+ "entry_price": {
+ "title": "entry_price",
+ "type": "string",
+ "format": "decimal",
+ "default": null,
+ "description": "Only for perps. Entry price to use in the simulation. Mark price is used if not provided.",
+ "nullable": true
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "SimulatedPositionSchema": {
+ "required": ["amount", "instrument_name"],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Position amount to simulate"
+ },
+ "entry_price": {
+ "title": "entry_price",
+ "type": "string",
+ "format": "decimal",
+ "default": null,
+ "description": "Only for perps. Entry price to use in the simulation. Mark price is used if not provided.",
+ "nullable": true
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PublicGetMarginResponseSchema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": [
+ "is_valid_trade",
+ "post_initial_margin",
+ "post_maintenance_margin",
+ "pre_initial_margin",
+ "pre_maintenance_margin",
+ "subaccount_id"
+ ],
+ "properties": {
+ "is_valid_trade": {
+ "title": "is_valid_trade",
+ "type": "boolean",
+ "description": "True if trade passes margin requirement"
+ },
+ "post_initial_margin": {
+ "title": "post_initial_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "Initial margin requirement post trade"
+ },
+ "post_maintenance_margin": {
+ "title": "post_maintenance_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "Maintenance margin requirement post trade"
+ },
+ "pre_initial_margin": {
+ "title": "pre_initial_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "Initial margin requirement before trade"
+ },
+ "pre_maintenance_margin": {
+ "title": "pre_maintenance_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "Maintenance margin requirement before trade"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PublicGetMarginResultSchema": {
+ "required": [
+ "is_valid_trade",
+ "post_initial_margin",
+ "post_maintenance_margin",
+ "pre_initial_margin",
+ "pre_maintenance_margin",
+ "subaccount_id"
+ ],
+ "properties": {
+ "is_valid_trade": {
+ "title": "is_valid_trade",
+ "type": "boolean",
+ "description": "True if trade passes margin requirement"
+ },
+ "post_initial_margin": {
+ "title": "post_initial_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "Initial margin requirement post trade"
+ },
+ "post_maintenance_margin": {
+ "title": "post_maintenance_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "Maintenance margin requirement post trade"
+ },
+ "pre_initial_margin": {
+ "title": "pre_initial_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "Initial margin requirement before trade"
+ },
+ "pre_maintenance_margin": {
+ "title": "pre_maintenance_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "Maintenance margin requirement before trade"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PublicGetTransactionParamsSchema": {
+ "required": ["transaction_id"],
+ "properties": {
+ "transaction_id": {
+ "title": "transaction_id",
+ "type": "string",
+ "format": "uuid",
+ "description": "transaction_id of the transaction to get"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PublicGetTransactionResponseSchema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["status", "transaction_hash"],
+ "properties": {
+ "status": {
+ "title": "status",
+ "type": "string",
+ "enum": ["requested", "pending", "settled", "reverted", "ignored"],
+ "description": "Status of the transaction"
+ },
+ "transaction_hash": {
+ "title": "transaction_hash",
+ "type": "string",
+ "default": null,
+ "description": "Transaction hash of a pending tx",
+ "nullable": true
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PublicGetTransactionResultSchema": {
+ "required": ["status", "transaction_hash"],
+ "properties": {
+ "status": {
+ "title": "status",
+ "type": "string",
+ "enum": ["requested", "pending", "settled", "reverted", "ignored"],
+ "description": "Status of the transaction"
+ },
+ "transaction_hash": {
+ "title": "transaction_hash",
+ "type": "string",
+ "default": null,
+ "description": "Transaction hash of a pending tx",
+ "nullable": true
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateGetSubaccountParamsSchema": {
+ "required": ["subaccount_id"],
+ "properties": {
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateGetSubaccountResponseSchema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": [
+ "collaterals",
+ "collaterals_initial_margin",
+ "collaterals_maintenance_margin",
+ "collaterals_value",
+ "currency",
+ "initial_margin",
+ "maintenance_margin",
+ "margin_type",
+ "open_orders",
+ "open_orders_margin",
+ "positions",
+ "positions_initial_margin",
+ "positions_maintenance_margin",
+ "positions_value",
+ "subaccount_id",
+ "subaccount_value"
+ ],
+ "properties": {
+ "collaterals": {
+ "title": "collaterals",
+ "type": "array",
+ "description": "All collaterals that count towards margin of subaccount",
+ "items": {
+ "required": [
+ "amount",
+ "asset_name",
+ "asset_type",
+ "cumulative_interest",
+ "currency",
+ "initial_margin",
+ "maintenance_margin",
+ "mark_price",
+ "mark_value",
+ "pending_interest"
+ ],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Asset amount of given collateral"
+ },
+ "asset_name": {
+ "title": "asset_name",
+ "type": "string",
+ "description": "Asset name"
+ },
+ "asset_type": {
+ "title": "asset_type",
+ "type": "string",
+ "enum": ["erc20", "option", "perp"],
+ "description": "Type of asset collateral (currently always `erc20`)"
+ },
+ "cumulative_interest": {
+ "title": "cumulative_interest",
+ "type": "string",
+ "format": "decimal",
+ "description": "Cumulative interest earned on supplying collateral or paid for borrowing"
+ },
+ "currency": {
+ "title": "currency",
+ "type": "string",
+ "description": "Underlying currency of asset (`ETH`, `BTC`, etc)"
+ },
+ "initial_margin": {
+ "title": "initial_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "USD value of collateral that contributes to initial margin"
+ },
+ "maintenance_margin": {
+ "title": "maintenance_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "USD value of collateral that contributes to maintenance margin"
+ },
+ "mark_price": {
+ "title": "mark_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Current mark price of the asset"
+ },
+ "mark_value": {
+ "title": "mark_value",
+ "type": "string",
+ "format": "decimal",
+ "description": "USD value of the collateral (amount * mark price)"
+ },
+ "pending_interest": {
+ "title": "pending_interest",
+ "type": "string",
+ "format": "decimal",
+ "description": "Portion of interest that has not yet been settled on-chain. This number is added to the portfolio value for margin calculations purposes."
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "collaterals_initial_margin": {
+ "title": "collaterals_initial_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total initial margin credit contributed by collaterals"
+ },
+ "collaterals_maintenance_margin": {
+ "title": "collaterals_maintenance_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total maintenance margin credit contributed by collaterals"
+ },
+ "collaterals_value": {
+ "title": "collaterals_value",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total mark-to-market value of all collaterals"
+ },
+ "currency": {
+ "title": "currency",
+ "type": "string",
+ "description": "Currency of subaccount"
+ },
+ "initial_margin": {
+ "title": "initial_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total initial margin requirement of all positions and collaterals.Trades will be rejected if this value falls below zero after the trade."
+ },
+ "maintenance_margin": {
+ "title": "maintenance_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total maintenance margin requirement of all positions and collaterals.If this value falls below zero, the subaccount will be flagged for liquidation."
+ },
+ "margin_type": {
+ "title": "margin_type",
+ "type": "string",
+ "enum": ["PM", "SM"],
+ "description": "Margin type of subaccount (`PM` (Portfolio Margin) or `SM` (Standard Margin))"
+ },
+ "open_orders": {
+ "title": "open_orders",
+ "type": "array",
+ "description": "All open orders of subaccount",
+ "items": {
+ "required": [
+ "amount",
+ "average_price",
+ "cancel_reason",
+ "creation_timestamp",
+ "direction",
+ "filled_amount",
+ "instrument_name",
+ "is_transfer",
+ "label",
+ "last_update_timestamp",
+ "limit_price",
+ "max_fee",
+ "mmp",
+ "nonce",
+ "order_fee",
+ "order_id",
+ "order_status",
+ "order_type",
+ "signature",
+ "signature_expiry_sec",
+ "signer",
+ "subaccount_id",
+ "time_in_force"
+ ],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Order amount in units of the base"
+ },
+ "average_price": {
+ "title": "average_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Average fill price"
+ },
+ "cancel_reason": {
+ "title": "cancel_reason",
+ "type": "string",
+ "enum": [
+ "",
+ "user_request",
+ "mmp_trigger",
+ "insufficient_margin",
+ "signed_max_fee_too_low",
+ "cancel_on_disconnect",
+ "ioc_or_market_partial_fill",
+ "session_key_deregistered",
+ "subaccount_withdrawn",
+ "compliance"
+ ],
+ "description": "If cancelled, reason behind order cancellation"
+ },
+ "creation_timestamp": {
+ "title": "creation_timestamp",
+ "type": "integer",
+ "description": "Creation timestamp (in ms since Unix epoch)"
+ },
+ "direction": {
+ "title": "direction",
+ "type": "string",
+ "enum": ["buy", "sell"],
+ "description": "Order direction"
+ },
+ "filled_amount": {
+ "title": "filled_amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total filled amount for the order"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ },
+ "is_transfer": {
+ "title": "is_transfer",
+ "type": "boolean",
+ "description": "Whether the order was generated through `private/transfer_position`"
+ },
+ "label": {
+ "title": "label",
+ "type": "string",
+ "description": "Optional user-defined label for the order"
+ },
+ "last_update_timestamp": {
+ "title": "last_update_timestamp",
+ "type": "integer",
+ "description": "Last update timestamp (in ms since Unix epoch)"
+ },
+ "limit_price": {
+ "title": "limit_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Limit price in quote currency"
+ },
+ "max_fee": {
+ "title": "max_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Max fee in units of the quote currency"
+ },
+ "mmp": {
+ "title": "mmp",
+ "type": "boolean",
+ "description": "Whether the order is tagged for market maker protections"
+ },
+ "nonce": {
+ "title": "nonce",
+ "type": "integer",
+ "description": "Unique nonce defined as (e.g. 1695836058725001, where 001 is the random number)"
+ },
+ "order_fee": {
+ "title": "order_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total order fee paid so far"
+ },
+ "order_id": {
+ "title": "order_id",
+ "type": "string",
+ "description": "Order ID"
+ },
+ "order_status": {
+ "title": "order_status",
+ "type": "string",
+ "enum": ["open", "filled", "rejected", "cancelled", "expired"],
+ "description": "Order status"
+ },
+ "order_type": {
+ "title": "order_type",
+ "type": "string",
+ "enum": ["limit", "market"],
+ "description": "Order type"
+ },
+ "signature": {
+ "title": "signature",
+ "type": "string",
+ "description": "Ethereum signature of the order"
+ },
+ "signature_expiry_sec": {
+ "title": "signature_expiry_sec",
+ "type": "integer",
+ "description": "Signature expiry timestamp"
+ },
+ "signer": {
+ "title": "signer",
+ "type": "string",
+ "description": "Owner wallet address or registered session key that signed order"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount ID"
+ },
+ "time_in_force": {
+ "title": "time_in_force",
+ "type": "string",
+ "enum": ["gtc", "post_only", "fok", "ioc"],
+ "description": "Time in force"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "open_orders_margin": {
+ "title": "open_orders_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total margin requirement of all open orders.Orders will be rejected if this value plus initial margin are below zero after the order."
+ },
+ "positions": {
+ "title": "positions",
+ "type": "array",
+ "description": "All active positions of subaccount",
+ "items": {
+ "required": [
+ "amount",
+ "average_price",
+ "cumulative_funding",
+ "delta",
+ "gamma",
+ "index_price",
+ "initial_margin",
+ "instrument_name",
+ "instrument_type",
+ "leverage",
+ "liquidation_price",
+ "maintenance_margin",
+ "mark_price",
+ "mark_value",
+ "net_settlements",
+ "open_orders_margin",
+ "pending_funding",
+ "realized_pnl",
+ "theta",
+ "unrealized_pnl",
+ "vega"
+ ],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Position amount held by subaccount"
+ },
+ "average_price": {
+ "title": "average_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Average price of whole position"
+ },
+ "cumulative_funding": {
+ "title": "cumulative_funding",
+ "type": "string",
+ "format": "decimal",
+ "description": "Cumulative funding for the position (only for perpetuals)."
+ },
+ "delta": {
+ "title": "delta",
+ "type": "string",
+ "format": "decimal",
+ "description": "Asset delta (w.r.t. forward price for options, `1.0` for perps)"
+ },
+ "gamma": {
+ "title": "gamma",
+ "type": "string",
+ "format": "decimal",
+ "description": "Asset gamma (zero for non-options)"
+ },
+ "index_price": {
+ "title": "index_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Current index (oracle) price for position's currency"
+ },
+ "initial_margin": {
+ "title": "initial_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "USD initial margin requirement for this position"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name (same as the base Asset name)"
+ },
+ "instrument_type": {
+ "title": "instrument_type",
+ "type": "string",
+ "enum": ["erc20", "option", "perp"],
+ "description": "`erc20`, `option`, or `perp`"
+ },
+ "leverage": {
+ "title": "leverage",
+ "type": "string",
+ "format": "decimal",
+ "default": null,
+ "description": "Only for perps. Leverage of the position, defined as `abs(notional) / collateral net of options margin`",
+ "nullable": true
+ },
+ "liquidation_price": {
+ "title": "liquidation_price",
+ "type": "string",
+ "format": "decimal",
+ "default": null,
+ "description": "Index price at which position will be liquidated",
+ "nullable": true
+ },
+ "maintenance_margin": {
+ "title": "maintenance_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "USD maintenance margin requirement for this position"
+ },
+ "mark_price": {
+ "title": "mark_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Current mark price for position's instrument"
+ },
+ "mark_value": {
+ "title": "mark_value",
+ "type": "string",
+ "format": "decimal",
+ "description": "USD value of the position; this represents how much USD can be recieved by fully closing the position at the current oracle price"
+ },
+ "net_settlements": {
+ "title": "net_settlements",
+ "type": "string",
+ "format": "decimal",
+ "description": "Net amount of USD from position settlements that has been paid to the user's subaccount. This number is subtracted from the portfolio value for margin calculations purposes.
Positive values mean the user has recieved USD from settlements, or is awaiting settlement of USD losses. Negative values mean the user has paid USD for settlements, or is awaiting settlement of USD gains."
+ },
+ "open_orders_margin": {
+ "title": "open_orders_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "USD margin requirement for all open orders for this asset / instrument"
+ },
+ "pending_funding": {
+ "title": "pending_funding",
+ "type": "string",
+ "format": "decimal",
+ "description": "A portion of funding payments that has not yet been settled into cash balance (only for perpetuals). This number is added to the portfolio value for margin calculations purposes."
+ },
+ "realized_pnl": {
+ "title": "realized_pnl",
+ "type": "string",
+ "format": "decimal",
+ "description": "Realized trading profit or loss of the position."
+ },
+ "theta": {
+ "title": "theta",
+ "type": "string",
+ "format": "decimal",
+ "description": "Asset theta (zero for non-options)"
+ },
+ "unrealized_pnl": {
+ "title": "unrealized_pnl",
+ "type": "string",
+ "format": "decimal",
+ "description": "Unrealized trading profit or loss of the position."
+ },
+ "vega": {
+ "title": "vega",
+ "type": "string",
+ "format": "decimal",
+ "description": "Asset vega (zero for non-options)"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "positions_initial_margin": {
+ "title": "positions_initial_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total initial margin requirement of all positions"
+ },
+ "positions_maintenance_margin": {
+ "title": "positions_maintenance_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total maintenance margin requirement of all positions"
+ },
+ "positions_value": {
+ "title": "positions_value",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total mark-to-market value of all positions"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id"
+ },
+ "subaccount_value": {
+ "title": "subaccount_value",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total mark-to-market value of all positions and collaterals"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateGetSubaccountResultSchema": {
+ "required": [
+ "collaterals",
+ "collaterals_initial_margin",
+ "collaterals_maintenance_margin",
+ "collaterals_value",
+ "currency",
+ "initial_margin",
+ "maintenance_margin",
+ "margin_type",
+ "open_orders",
+ "open_orders_margin",
+ "positions",
+ "positions_initial_margin",
+ "positions_maintenance_margin",
+ "positions_value",
+ "subaccount_id",
+ "subaccount_value"
+ ],
+ "properties": {
+ "collaterals": {
+ "title": "collaterals",
+ "type": "array",
+ "description": "All collaterals that count towards margin of subaccount",
+ "items": {
+ "required": [
+ "amount",
+ "asset_name",
+ "asset_type",
+ "cumulative_interest",
+ "currency",
+ "initial_margin",
+ "maintenance_margin",
+ "mark_price",
+ "mark_value",
+ "pending_interest"
+ ],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Asset amount of given collateral"
+ },
+ "asset_name": {
+ "title": "asset_name",
+ "type": "string",
+ "description": "Asset name"
+ },
+ "asset_type": {
+ "title": "asset_type",
+ "type": "string",
+ "enum": ["erc20", "option", "perp"],
+ "description": "Type of asset collateral (currently always `erc20`)"
+ },
+ "cumulative_interest": {
+ "title": "cumulative_interest",
+ "type": "string",
+ "format": "decimal",
+ "description": "Cumulative interest earned on supplying collateral or paid for borrowing"
+ },
+ "currency": {
+ "title": "currency",
+ "type": "string",
+ "description": "Underlying currency of asset (`ETH`, `BTC`, etc)"
+ },
+ "initial_margin": {
+ "title": "initial_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "USD value of collateral that contributes to initial margin"
+ },
+ "maintenance_margin": {
+ "title": "maintenance_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "USD value of collateral that contributes to maintenance margin"
+ },
+ "mark_price": {
+ "title": "mark_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Current mark price of the asset"
+ },
+ "mark_value": {
+ "title": "mark_value",
+ "type": "string",
+ "format": "decimal",
+ "description": "USD value of the collateral (amount * mark price)"
+ },
+ "pending_interest": {
+ "title": "pending_interest",
+ "type": "string",
+ "format": "decimal",
+ "description": "Portion of interest that has not yet been settled on-chain. This number is added to the portfolio value for margin calculations purposes."
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "collaterals_initial_margin": {
+ "title": "collaterals_initial_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total initial margin credit contributed by collaterals"
+ },
+ "collaterals_maintenance_margin": {
+ "title": "collaterals_maintenance_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total maintenance margin credit contributed by collaterals"
+ },
+ "collaterals_value": {
+ "title": "collaterals_value",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total mark-to-market value of all collaterals"
+ },
+ "currency": {
+ "title": "currency",
+ "type": "string",
+ "description": "Currency of subaccount"
+ },
+ "initial_margin": {
+ "title": "initial_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total initial margin requirement of all positions and collaterals.Trades will be rejected if this value falls below zero after the trade."
+ },
+ "maintenance_margin": {
+ "title": "maintenance_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total maintenance margin requirement of all positions and collaterals.If this value falls below zero, the subaccount will be flagged for liquidation."
+ },
+ "margin_type": {
+ "title": "margin_type",
+ "type": "string",
+ "enum": ["PM", "SM"],
+ "description": "Margin type of subaccount (`PM` (Portfolio Margin) or `SM` (Standard Margin))"
+ },
+ "open_orders": {
+ "title": "open_orders",
+ "type": "array",
+ "description": "All open orders of subaccount",
+ "items": {
+ "required": [
+ "amount",
+ "average_price",
+ "cancel_reason",
+ "creation_timestamp",
+ "direction",
+ "filled_amount",
+ "instrument_name",
+ "is_transfer",
+ "label",
+ "last_update_timestamp",
+ "limit_price",
+ "max_fee",
+ "mmp",
+ "nonce",
+ "order_fee",
+ "order_id",
+ "order_status",
+ "order_type",
+ "signature",
+ "signature_expiry_sec",
+ "signer",
+ "subaccount_id",
+ "time_in_force"
+ ],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Order amount in units of the base"
+ },
+ "average_price": {
+ "title": "average_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Average fill price"
+ },
+ "cancel_reason": {
+ "title": "cancel_reason",
+ "type": "string",
+ "enum": [
+ "",
+ "user_request",
+ "mmp_trigger",
+ "insufficient_margin",
+ "signed_max_fee_too_low",
+ "cancel_on_disconnect",
+ "ioc_or_market_partial_fill",
+ "session_key_deregistered",
+ "subaccount_withdrawn",
+ "compliance"
+ ],
+ "description": "If cancelled, reason behind order cancellation"
+ },
+ "creation_timestamp": {
+ "title": "creation_timestamp",
+ "type": "integer",
+ "description": "Creation timestamp (in ms since Unix epoch)"
+ },
+ "direction": {
+ "title": "direction",
+ "type": "string",
+ "enum": ["buy", "sell"],
+ "description": "Order direction"
+ },
+ "filled_amount": {
+ "title": "filled_amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total filled amount for the order"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ },
+ "is_transfer": {
+ "title": "is_transfer",
+ "type": "boolean",
+ "description": "Whether the order was generated through `private/transfer_position`"
+ },
+ "label": {
+ "title": "label",
+ "type": "string",
+ "description": "Optional user-defined label for the order"
+ },
+ "last_update_timestamp": {
+ "title": "last_update_timestamp",
+ "type": "integer",
+ "description": "Last update timestamp (in ms since Unix epoch)"
+ },
+ "limit_price": {
+ "title": "limit_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Limit price in quote currency"
+ },
+ "max_fee": {
+ "title": "max_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Max fee in units of the quote currency"
+ },
+ "mmp": {
+ "title": "mmp",
+ "type": "boolean",
+ "description": "Whether the order is tagged for market maker protections"
+ },
+ "nonce": {
+ "title": "nonce",
+ "type": "integer",
+ "description": "Unique nonce defined as (e.g. 1695836058725001, where 001 is the random number)"
+ },
+ "order_fee": {
+ "title": "order_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total order fee paid so far"
+ },
+ "order_id": {
+ "title": "order_id",
+ "type": "string",
+ "description": "Order ID"
+ },
+ "order_status": {
+ "title": "order_status",
+ "type": "string",
+ "enum": ["open", "filled", "rejected", "cancelled", "expired"],
+ "description": "Order status"
+ },
+ "order_type": {
+ "title": "order_type",
+ "type": "string",
+ "enum": ["limit", "market"],
+ "description": "Order type"
+ },
+ "signature": {
+ "title": "signature",
+ "type": "string",
+ "description": "Ethereum signature of the order"
+ },
+ "signature_expiry_sec": {
+ "title": "signature_expiry_sec",
+ "type": "integer",
+ "description": "Signature expiry timestamp"
+ },
+ "signer": {
+ "title": "signer",
+ "type": "string",
+ "description": "Owner wallet address or registered session key that signed order"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount ID"
+ },
+ "time_in_force": {
+ "title": "time_in_force",
+ "type": "string",
+ "enum": ["gtc", "post_only", "fok", "ioc"],
+ "description": "Time in force"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "open_orders_margin": {
+ "title": "open_orders_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total margin requirement of all open orders.Orders will be rejected if this value plus initial margin are below zero after the order."
+ },
+ "positions": {
+ "title": "positions",
+ "type": "array",
+ "description": "All active positions of subaccount",
+ "items": {
+ "required": [
+ "amount",
+ "average_price",
+ "cumulative_funding",
+ "delta",
+ "gamma",
+ "index_price",
+ "initial_margin",
+ "instrument_name",
+ "instrument_type",
+ "leverage",
+ "liquidation_price",
+ "maintenance_margin",
+ "mark_price",
+ "mark_value",
+ "net_settlements",
+ "open_orders_margin",
+ "pending_funding",
+ "realized_pnl",
+ "theta",
+ "unrealized_pnl",
+ "vega"
+ ],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Position amount held by subaccount"
+ },
+ "average_price": {
+ "title": "average_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Average price of whole position"
+ },
+ "cumulative_funding": {
+ "title": "cumulative_funding",
+ "type": "string",
+ "format": "decimal",
+ "description": "Cumulative funding for the position (only for perpetuals)."
+ },
+ "delta": {
+ "title": "delta",
+ "type": "string",
+ "format": "decimal",
+ "description": "Asset delta (w.r.t. forward price for options, `1.0` for perps)"
+ },
+ "gamma": {
+ "title": "gamma",
+ "type": "string",
+ "format": "decimal",
+ "description": "Asset gamma (zero for non-options)"
+ },
+ "index_price": {
+ "title": "index_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Current index (oracle) price for position's currency"
+ },
+ "initial_margin": {
+ "title": "initial_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "USD initial margin requirement for this position"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name (same as the base Asset name)"
+ },
+ "instrument_type": {
+ "title": "instrument_type",
+ "type": "string",
+ "enum": ["erc20", "option", "perp"],
+ "description": "`erc20`, `option`, or `perp`"
+ },
+ "leverage": {
+ "title": "leverage",
+ "type": "string",
+ "format": "decimal",
+ "default": null,
+ "description": "Only for perps. Leverage of the position, defined as `abs(notional) / collateral net of options margin`",
+ "nullable": true
+ },
+ "liquidation_price": {
+ "title": "liquidation_price",
+ "type": "string",
+ "format": "decimal",
+ "default": null,
+ "description": "Index price at which position will be liquidated",
+ "nullable": true
+ },
+ "maintenance_margin": {
+ "title": "maintenance_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "USD maintenance margin requirement for this position"
+ },
+ "mark_price": {
+ "title": "mark_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Current mark price for position's instrument"
+ },
+ "mark_value": {
+ "title": "mark_value",
+ "type": "string",
+ "format": "decimal",
+ "description": "USD value of the position; this represents how much USD can be recieved by fully closing the position at the current oracle price"
+ },
+ "net_settlements": {
+ "title": "net_settlements",
+ "type": "string",
+ "format": "decimal",
+ "description": "Net amount of USD from position settlements that has been paid to the user's subaccount. This number is subtracted from the portfolio value for margin calculations purposes.
Positive values mean the user has recieved USD from settlements, or is awaiting settlement of USD losses. Negative values mean the user has paid USD for settlements, or is awaiting settlement of USD gains."
+ },
+ "open_orders_margin": {
+ "title": "open_orders_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "USD margin requirement for all open orders for this asset / instrument"
+ },
+ "pending_funding": {
+ "title": "pending_funding",
+ "type": "string",
+ "format": "decimal",
+ "description": "A portion of funding payments that has not yet been settled into cash balance (only for perpetuals). This number is added to the portfolio value for margin calculations purposes."
+ },
+ "realized_pnl": {
+ "title": "realized_pnl",
+ "type": "string",
+ "format": "decimal",
+ "description": "Realized trading profit or loss of the position."
+ },
+ "theta": {
+ "title": "theta",
+ "type": "string",
+ "format": "decimal",
+ "description": "Asset theta (zero for non-options)"
+ },
+ "unrealized_pnl": {
+ "title": "unrealized_pnl",
+ "type": "string",
+ "format": "decimal",
+ "description": "Unrealized trading profit or loss of the position."
+ },
+ "vega": {
+ "title": "vega",
+ "type": "string",
+ "format": "decimal",
+ "description": "Asset vega (zero for non-options)"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "positions_initial_margin": {
+ "title": "positions_initial_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total initial margin requirement of all positions"
+ },
+ "positions_maintenance_margin": {
+ "title": "positions_maintenance_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total maintenance margin requirement of all positions"
+ },
+ "positions_value": {
+ "title": "positions_value",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total mark-to-market value of all positions"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id"
+ },
+ "subaccount_value": {
+ "title": "subaccount_value",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total mark-to-market value of all positions and collaterals"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "CollateralResponseSchema": {
+ "required": [
+ "amount",
+ "asset_name",
+ "asset_type",
+ "cumulative_interest",
+ "currency",
+ "initial_margin",
+ "maintenance_margin",
+ "mark_price",
+ "mark_value",
+ "pending_interest"
+ ],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Asset amount of given collateral"
+ },
+ "asset_name": {
+ "title": "asset_name",
+ "type": "string",
+ "description": "Asset name"
+ },
+ "asset_type": {
+ "title": "asset_type",
+ "type": "string",
+ "enum": ["erc20", "option", "perp"],
+ "description": "Type of asset collateral (currently always `erc20`)"
+ },
+ "cumulative_interest": {
+ "title": "cumulative_interest",
+ "type": "string",
+ "format": "decimal",
+ "description": "Cumulative interest earned on supplying collateral or paid for borrowing"
+ },
+ "currency": {
+ "title": "currency",
+ "type": "string",
+ "description": "Underlying currency of asset (`ETH`, `BTC`, etc)"
+ },
+ "initial_margin": {
+ "title": "initial_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "USD value of collateral that contributes to initial margin"
+ },
+ "maintenance_margin": {
+ "title": "maintenance_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "USD value of collateral that contributes to maintenance margin"
+ },
+ "mark_price": {
+ "title": "mark_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Current mark price of the asset"
+ },
+ "mark_value": {
+ "title": "mark_value",
+ "type": "string",
+ "format": "decimal",
+ "description": "USD value of the collateral (amount * mark price)"
+ },
+ "pending_interest": {
+ "title": "pending_interest",
+ "type": "string",
+ "format": "decimal",
+ "description": "Portion of interest that has not yet been settled on-chain. This number is added to the portfolio value for margin calculations purposes."
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateGetOrderParamsSchema": {
+ "required": ["order_id", "subaccount_id"],
+ "properties": {
+ "order_id": {
+ "title": "order_id",
+ "type": "string",
+ "description": "Order ID"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount ID"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateGetOrderResponseSchema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": [
+ "amount",
+ "average_price",
+ "cancel_reason",
+ "creation_timestamp",
+ "direction",
+ "filled_amount",
+ "instrument_name",
+ "is_transfer",
+ "label",
+ "last_update_timestamp",
+ "limit_price",
+ "max_fee",
+ "mmp",
+ "nonce",
+ "order_fee",
+ "order_id",
+ "order_status",
+ "order_type",
+ "signature",
+ "signature_expiry_sec",
+ "signer",
+ "subaccount_id",
+ "time_in_force"
+ ],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Order amount in units of the base"
+ },
+ "average_price": {
+ "title": "average_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Average fill price"
+ },
+ "cancel_reason": {
+ "title": "cancel_reason",
+ "type": "string",
+ "enum": [
+ "",
+ "user_request",
+ "mmp_trigger",
+ "insufficient_margin",
+ "signed_max_fee_too_low",
+ "cancel_on_disconnect",
+ "ioc_or_market_partial_fill",
+ "session_key_deregistered",
+ "subaccount_withdrawn",
+ "compliance"
+ ],
+ "description": "If cancelled, reason behind order cancellation"
+ },
+ "creation_timestamp": {
+ "title": "creation_timestamp",
+ "type": "integer",
+ "description": "Creation timestamp (in ms since Unix epoch)"
+ },
+ "direction": {
+ "title": "direction",
+ "type": "string",
+ "enum": ["buy", "sell"],
+ "description": "Order direction"
+ },
+ "filled_amount": {
+ "title": "filled_amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total filled amount for the order"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ },
+ "is_transfer": {
+ "title": "is_transfer",
+ "type": "boolean",
+ "description": "Whether the order was generated through `private/transfer_position`"
+ },
+ "label": {
+ "title": "label",
+ "type": "string",
+ "description": "Optional user-defined label for the order"
+ },
+ "last_update_timestamp": {
+ "title": "last_update_timestamp",
+ "type": "integer",
+ "description": "Last update timestamp (in ms since Unix epoch)"
+ },
+ "limit_price": {
+ "title": "limit_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Limit price in quote currency"
+ },
+ "max_fee": {
+ "title": "max_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Max fee in units of the quote currency"
+ },
+ "mmp": {
+ "title": "mmp",
+ "type": "boolean",
+ "description": "Whether the order is tagged for market maker protections"
+ },
+ "nonce": {
+ "title": "nonce",
+ "type": "integer",
+ "description": "Unique nonce defined as (e.g. 1695836058725001, where 001 is the random number)"
+ },
+ "order_fee": {
+ "title": "order_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total order fee paid so far"
+ },
+ "order_id": {
+ "title": "order_id",
+ "type": "string",
+ "description": "Order ID"
+ },
+ "order_status": {
+ "title": "order_status",
+ "type": "string",
+ "enum": ["open", "filled", "rejected", "cancelled", "expired"],
+ "description": "Order status"
+ },
+ "order_type": {
+ "title": "order_type",
+ "type": "string",
+ "enum": ["limit", "market"],
+ "description": "Order type"
+ },
+ "signature": {
+ "title": "signature",
+ "type": "string",
+ "description": "Ethereum signature of the order"
+ },
+ "signature_expiry_sec": {
+ "title": "signature_expiry_sec",
+ "type": "integer",
+ "description": "Signature expiry timestamp"
+ },
+ "signer": {
+ "title": "signer",
+ "type": "string",
+ "description": "Owner wallet address or registered session key that signed order"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount ID"
+ },
+ "time_in_force": {
+ "title": "time_in_force",
+ "type": "string",
+ "enum": ["gtc", "post_only", "fok", "ioc"],
+ "description": "Time in force"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateGetOrderResultSchema": {
+ "required": [
+ "amount",
+ "average_price",
+ "cancel_reason",
+ "creation_timestamp",
+ "direction",
+ "filled_amount",
+ "instrument_name",
+ "is_transfer",
+ "label",
+ "last_update_timestamp",
+ "limit_price",
+ "max_fee",
+ "mmp",
+ "nonce",
+ "order_fee",
+ "order_id",
+ "order_status",
+ "order_type",
+ "signature",
+ "signature_expiry_sec",
+ "signer",
+ "subaccount_id",
+ "time_in_force"
+ ],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Order amount in units of the base"
+ },
+ "average_price": {
+ "title": "average_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Average fill price"
+ },
+ "cancel_reason": {
+ "title": "cancel_reason",
+ "type": "string",
+ "enum": [
+ "",
+ "user_request",
+ "mmp_trigger",
+ "insufficient_margin",
+ "signed_max_fee_too_low",
+ "cancel_on_disconnect",
+ "ioc_or_market_partial_fill",
+ "session_key_deregistered",
+ "subaccount_withdrawn",
+ "compliance"
+ ],
+ "description": "If cancelled, reason behind order cancellation"
+ },
+ "creation_timestamp": {
+ "title": "creation_timestamp",
+ "type": "integer",
+ "description": "Creation timestamp (in ms since Unix epoch)"
+ },
+ "direction": {
+ "title": "direction",
+ "type": "string",
+ "enum": ["buy", "sell"],
+ "description": "Order direction"
+ },
+ "filled_amount": {
+ "title": "filled_amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total filled amount for the order"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ },
+ "is_transfer": {
+ "title": "is_transfer",
+ "type": "boolean",
+ "description": "Whether the order was generated through `private/transfer_position`"
+ },
+ "label": {
+ "title": "label",
+ "type": "string",
+ "description": "Optional user-defined label for the order"
+ },
+ "last_update_timestamp": {
+ "title": "last_update_timestamp",
+ "type": "integer",
+ "description": "Last update timestamp (in ms since Unix epoch)"
+ },
+ "limit_price": {
+ "title": "limit_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Limit price in quote currency"
+ },
+ "max_fee": {
+ "title": "max_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Max fee in units of the quote currency"
+ },
+ "mmp": {
+ "title": "mmp",
+ "type": "boolean",
+ "description": "Whether the order is tagged for market maker protections"
+ },
+ "nonce": {
+ "title": "nonce",
+ "type": "integer",
+ "description": "Unique nonce defined as (e.g. 1695836058725001, where 001 is the random number)"
+ },
+ "order_fee": {
+ "title": "order_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total order fee paid so far"
+ },
+ "order_id": {
+ "title": "order_id",
+ "type": "string",
+ "description": "Order ID"
+ },
+ "order_status": {
+ "title": "order_status",
+ "type": "string",
+ "enum": ["open", "filled", "rejected", "cancelled", "expired"],
+ "description": "Order status"
+ },
+ "order_type": {
+ "title": "order_type",
+ "type": "string",
+ "enum": ["limit", "market"],
+ "description": "Order type"
+ },
+ "signature": {
+ "title": "signature",
+ "type": "string",
+ "description": "Ethereum signature of the order"
+ },
+ "signature_expiry_sec": {
+ "title": "signature_expiry_sec",
+ "type": "integer",
+ "description": "Signature expiry timestamp"
+ },
+ "signer": {
+ "title": "signer",
+ "type": "string",
+ "description": "Owner wallet address or registered session key that signed order"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount ID"
+ },
+ "time_in_force": {
+ "title": "time_in_force",
+ "type": "string",
+ "enum": ["gtc", "post_only", "fok", "ioc"],
+ "description": "Time in force"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateResetMmpParamsSchema": {
+ "required": ["subaccount_id"],
+ "properties": {
+ "currency": {
+ "title": "currency",
+ "type": "string",
+ "default": null,
+ "description": "Currency to reset the mmp for. If not provided, resets all configs for the subaccount",
+ "nullable": true
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id for which to reset the mmp state"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateResetMmpResponseSchema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "title": "result",
+ "type": "string",
+ "enum": ["ok"],
+ "description": "The result of this method call, `ok` if successful"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PublicGetTickerParamsSchema": {
+ "required": ["instrument_name"],
+ "properties": {
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PublicGetTickerResponseSchema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": [
+ "amount_step",
+ "base_asset_address",
+ "base_asset_sub_id",
+ "base_currency",
+ "base_fee",
+ "best_ask_amount",
+ "best_ask_price",
+ "best_bid_amount",
+ "best_bid_price",
+ "index_price",
+ "instrument_name",
+ "instrument_type",
+ "is_active",
+ "maker_fee_rate",
+ "mark_price",
+ "max_price",
+ "maximum_amount",
+ "min_price",
+ "minimum_amount",
+ "option_details",
+ "option_pricing",
+ "perp_details",
+ "quote_currency",
+ "scheduled_activation",
+ "scheduled_deactivation",
+ "stats",
+ "taker_fee_rate",
+ "tick_size",
+ "timestamp"
+ ],
+ "properties": {
+ "amount_step": {
+ "title": "amount_step",
+ "type": "string",
+ "format": "decimal",
+ "description": "Minimum valid increment of order amount"
+ },
+ "base_asset_address": {
+ "title": "base_asset_address",
+ "type": "string",
+ "description": "Blockchain address of the base asset"
+ },
+ "base_asset_sub_id": {
+ "title": "base_asset_sub_id",
+ "type": "string",
+ "description": "Sub ID of the specific base asset as defined in Asset.sol"
+ },
+ "base_currency": {
+ "title": "base_currency",
+ "type": "string",
+ "description": "Underlying currency of base asset (`ETH`, `BTC`, etc)"
+ },
+ "base_fee": {
+ "title": "base_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "$ base fee added to every taker order"
+ },
+ "best_ask_amount": {
+ "title": "best_ask_amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Amount of contracts / tokens available at best ask price"
+ },
+ "best_ask_price": {
+ "title": "best_ask_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Best ask price"
+ },
+ "best_bid_amount": {
+ "title": "best_bid_amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Amount of contracts / tokens available at best bid price"
+ },
+ "best_bid_price": {
+ "title": "best_bid_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Best bid price"
+ },
+ "index_price": {
+ "title": "index_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Index price"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ },
+ "instrument_type": {
+ "title": "instrument_type",
+ "type": "string",
+ "enum": ["erc20", "option", "perp"],
+ "description": "`erc20`, `option`, or `perp`"
+ },
+ "is_active": {
+ "title": "is_active",
+ "type": "boolean",
+ "description": "If `True`: instrument is tradeable within `activation` and `deactivation` timestamps"
+ },
+ "maker_fee_rate": {
+ "title": "maker_fee_rate",
+ "type": "string",
+ "format": "decimal",
+ "description": "Percent of spot price fee rate for makers"
+ },
+ "mark_price": {
+ "title": "mark_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Mark price"
+ },
+ "mark_price_fee_rate_cap": {
+ "title": "mark_price_fee_rate_cap",
+ "type": "string",
+ "format": "decimal",
+ "default": null,
+ "description": "Percent of option price fee cap, e.g. 12.5%, null if not applicable",
+ "nullable": true
+ },
+ "max_price": {
+ "title": "max_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Maximum price at which an agressive buyer can be matched. Any portion of a market order that would execute above this price will be cancelled. A limit buy order with limit price above this value is treated as post only (i.e. it will be rejected if it would cross any existing resting order)."
+ },
+ "maximum_amount": {
+ "title": "maximum_amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Maximum valid amount of contracts / tokens per trade"
+ },
+ "min_price": {
+ "title": "min_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Minimum price at which an agressive seller can be matched. Any portion of a market order that would execute below this price will be cancelled. A limit sell order with limit price below this value is treated as post only (i.e. it will be rejected if it would cross any existing resting order)."
+ },
+ "minimum_amount": {
+ "title": "minimum_amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Minimum valid amount of contracts / tokens per trade"
+ },
+ "option_details": {
+ "required": ["expiry", "index", "option_type", "strike"],
+ "properties": {
+ "expiry": {
+ "title": "expiry",
+ "type": "integer",
+ "description": "Unix timestamp of expiry date (in seconds)"
+ },
+ "index": {
+ "title": "index",
+ "type": "string",
+ "description": "Underlying settlement price index"
+ },
+ "option_type": {
+ "title": "option_type",
+ "type": "string",
+ "enum": ["C", "P"]
+ },
+ "settlement_price": {
+ "title": "settlement_price",
+ "type": "string",
+ "format": "decimal",
+ "default": null,
+ "description": "Settlement price of the option",
+ "nullable": true
+ },
+ "strike": {
+ "title": "strike",
+ "type": "string",
+ "format": "decimal"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "option_pricing": {
+ "required": [
+ "ask_iv",
+ "bid_iv",
+ "delta",
+ "forward_price",
+ "gamma",
+ "iv",
+ "mark_price",
+ "rho",
+ "theta",
+ "vega"
+ ],
+ "properties": {
+ "ask_iv": {
+ "title": "ask_iv",
+ "type": "string",
+ "format": "decimal",
+ "description": "Implied volatility of the current best ask"
+ },
+ "bid_iv": {
+ "title": "bid_iv",
+ "type": "string",
+ "format": "decimal",
+ "description": "Implied volatility of the current best bid"
+ },
+ "delta": {
+ "title": "delta",
+ "type": "string",
+ "format": "decimal",
+ "description": "Delta of the option"
+ },
+ "forward_price": {
+ "title": "forward_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Forward price used to calculate option premium"
+ },
+ "gamma": {
+ "title": "gamma",
+ "type": "string",
+ "format": "decimal",
+ "description": "Gamma of the option"
+ },
+ "iv": {
+ "title": "iv",
+ "type": "string",
+ "format": "decimal",
+ "description": "Implied volatility of the option"
+ },
+ "mark_price": {
+ "title": "mark_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Mark price of the option"
+ },
+ "rho": {
+ "title": "rho",
+ "type": "string",
+ "format": "decimal",
+ "description": "Rho of the option"
+ },
+ "theta": {
+ "title": "theta",
+ "type": "string",
+ "format": "decimal",
+ "description": "Theta of the option"
+ },
+ "vega": {
+ "title": "vega",
+ "type": "string",
+ "format": "decimal",
+ "description": "Vega of the option"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "perp_details": {
+ "required": [
+ "aggregate_funding",
+ "funding_rate",
+ "index",
+ "max_rate_per_hour",
+ "min_rate_per_hour",
+ "static_interest_rate"
+ ],
+ "properties": {
+ "aggregate_funding": {
+ "title": "aggregate_funding",
+ "type": "string",
+ "format": "decimal",
+ "description": "Latest aggregated funding as per `PerpAsset.sol`"
+ },
+ "funding_rate": {
+ "title": "funding_rate",
+ "type": "string",
+ "format": "decimal",
+ "description": "Current hourly funding rate as per `PerpAsset.sol`"
+ },
+ "index": {
+ "title": "index",
+ "type": "string",
+ "description": "Underlying spot price index for funding rate"
+ },
+ "max_rate_per_hour": {
+ "title": "max_rate_per_hour",
+ "type": "string",
+ "format": "decimal",
+ "description": "Max rate per hour as per `PerpAsset.sol`"
+ },
+ "min_rate_per_hour": {
+ "title": "min_rate_per_hour",
+ "type": "string",
+ "format": "decimal",
+ "description": "Min rate per hour as per `PerpAsset.sol`"
+ },
+ "static_interest_rate": {
+ "title": "static_interest_rate",
+ "type": "string",
+ "format": "decimal",
+ "description": "Static interest rate as per `PerpAsset.sol`"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "quote_currency": {
+ "title": "quote_currency",
+ "type": "string",
+ "description": "Quote currency (`USD` for perps, `USDC` for options)"
+ },
+ "scheduled_activation": {
+ "title": "scheduled_activation",
+ "type": "integer",
+ "description": "Timestamp at which became or will become active (if applicable)"
+ },
+ "scheduled_deactivation": {
+ "title": "scheduled_deactivation",
+ "type": "integer",
+ "description": "Scheduled deactivation time for instrument (if applicable)"
+ },
+ "stats": {
+ "required": [
+ "contract_volume",
+ "high",
+ "low",
+ "num_trades",
+ "open_interest",
+ "percent_change",
+ "usd_change"
+ ],
+ "properties": {
+ "contract_volume": {
+ "title": "contract_volume",
+ "type": "string",
+ "format": "decimal",
+ "description": "Number of contracts traded during last 24 hours"
+ },
+ "high": {
+ "title": "high",
+ "type": "string",
+ "format": "decimal",
+ "description": "Highest trade price during last 24h"
+ },
+ "low": {
+ "title": "low",
+ "type": "string",
+ "format": "decimal",
+ "description": "Lowest trade price during last 24h"
+ },
+ "num_trades": {
+ "title": "num_trades",
+ "type": "string",
+ "format": "decimal",
+ "description": "Number of trades during last 24h "
+ },
+ "open_interest": {
+ "title": "open_interest",
+ "type": "string",
+ "format": "decimal",
+ "description": "Current total open interest"
+ },
+ "percent_change": {
+ "title": "percent_change",
+ "type": "string",
+ "format": "decimal",
+ "description": "24-hour price change expressed as a percentage. Options: percent change in vol; Perps: percent change in mark price"
+ },
+ "usd_change": {
+ "title": "usd_change",
+ "type": "string",
+ "format": "decimal",
+ "description": "24-hour price change in USD."
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "taker_fee_rate": {
+ "title": "taker_fee_rate",
+ "type": "string",
+ "format": "decimal",
+ "description": "Percent of spot price fee rate for takers"
+ },
+ "tick_size": {
+ "title": "tick_size",
+ "type": "string",
+ "format": "decimal",
+ "description": "Tick size of the instrument, i.e. minimum price increment"
+ },
+ "timestamp": {
+ "title": "timestamp",
+ "type": "integer",
+ "description": "Timestamp of the ticker feed snapshot"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PublicGetTickerResultSchema": {
+ "required": [
+ "amount_step",
+ "base_asset_address",
+ "base_asset_sub_id",
+ "base_currency",
+ "base_fee",
+ "best_ask_amount",
+ "best_ask_price",
+ "best_bid_amount",
+ "best_bid_price",
+ "index_price",
+ "instrument_name",
+ "instrument_type",
+ "is_active",
+ "maker_fee_rate",
+ "mark_price",
+ "max_price",
+ "maximum_amount",
+ "min_price",
+ "minimum_amount",
+ "option_details",
+ "option_pricing",
+ "perp_details",
+ "quote_currency",
+ "scheduled_activation",
+ "scheduled_deactivation",
+ "stats",
+ "taker_fee_rate",
+ "tick_size",
+ "timestamp"
+ ],
+ "properties": {
+ "amount_step": {
+ "title": "amount_step",
+ "type": "string",
+ "format": "decimal",
+ "description": "Minimum valid increment of order amount"
+ },
+ "base_asset_address": {
+ "title": "base_asset_address",
+ "type": "string",
+ "description": "Blockchain address of the base asset"
+ },
+ "base_asset_sub_id": {
+ "title": "base_asset_sub_id",
+ "type": "string",
+ "description": "Sub ID of the specific base asset as defined in Asset.sol"
+ },
+ "base_currency": {
+ "title": "base_currency",
+ "type": "string",
+ "description": "Underlying currency of base asset (`ETH`, `BTC`, etc)"
+ },
+ "base_fee": {
+ "title": "base_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "$ base fee added to every taker order"
+ },
+ "best_ask_amount": {
+ "title": "best_ask_amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Amount of contracts / tokens available at best ask price"
+ },
+ "best_ask_price": {
+ "title": "best_ask_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Best ask price"
+ },
+ "best_bid_amount": {
+ "title": "best_bid_amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Amount of contracts / tokens available at best bid price"
+ },
+ "best_bid_price": {
+ "title": "best_bid_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Best bid price"
+ },
+ "index_price": {
+ "title": "index_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Index price"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ },
+ "instrument_type": {
+ "title": "instrument_type",
+ "type": "string",
+ "enum": ["erc20", "option", "perp"],
+ "description": "`erc20`, `option`, or `perp`"
+ },
+ "is_active": {
+ "title": "is_active",
+ "type": "boolean",
+ "description": "If `True`: instrument is tradeable within `activation` and `deactivation` timestamps"
+ },
+ "maker_fee_rate": {
+ "title": "maker_fee_rate",
+ "type": "string",
+ "format": "decimal",
+ "description": "Percent of spot price fee rate for makers"
+ },
+ "mark_price": {
+ "title": "mark_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Mark price"
+ },
+ "mark_price_fee_rate_cap": {
+ "title": "mark_price_fee_rate_cap",
+ "type": "string",
+ "format": "decimal",
+ "default": null,
+ "description": "Percent of option price fee cap, e.g. 12.5%, null if not applicable",
+ "nullable": true
+ },
+ "max_price": {
+ "title": "max_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Maximum price at which an agressive buyer can be matched. Any portion of a market order that would execute above this price will be cancelled. A limit buy order with limit price above this value is treated as post only (i.e. it will be rejected if it would cross any existing resting order)."
+ },
+ "maximum_amount": {
+ "title": "maximum_amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Maximum valid amount of contracts / tokens per trade"
+ },
+ "min_price": {
+ "title": "min_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Minimum price at which an agressive seller can be matched. Any portion of a market order that would execute below this price will be cancelled. A limit sell order with limit price below this value is treated as post only (i.e. it will be rejected if it would cross any existing resting order)."
+ },
+ "minimum_amount": {
+ "title": "minimum_amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Minimum valid amount of contracts / tokens per trade"
+ },
+ "option_details": {
+ "required": ["expiry", "index", "option_type", "strike"],
+ "properties": {
+ "expiry": {
+ "title": "expiry",
+ "type": "integer",
+ "description": "Unix timestamp of expiry date (in seconds)"
+ },
+ "index": {
+ "title": "index",
+ "type": "string",
+ "description": "Underlying settlement price index"
+ },
+ "option_type": {
+ "title": "option_type",
+ "type": "string",
+ "enum": ["C", "P"]
+ },
+ "settlement_price": {
+ "title": "settlement_price",
+ "type": "string",
+ "format": "decimal",
+ "default": null,
+ "description": "Settlement price of the option",
+ "nullable": true
+ },
+ "strike": {
+ "title": "strike",
+ "type": "string",
+ "format": "decimal"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "option_pricing": {
+ "required": [
+ "ask_iv",
+ "bid_iv",
+ "delta",
+ "forward_price",
+ "gamma",
+ "iv",
+ "mark_price",
+ "rho",
+ "theta",
+ "vega"
+ ],
+ "properties": {
+ "ask_iv": {
+ "title": "ask_iv",
+ "type": "string",
+ "format": "decimal",
+ "description": "Implied volatility of the current best ask"
+ },
+ "bid_iv": {
+ "title": "bid_iv",
+ "type": "string",
+ "format": "decimal",
+ "description": "Implied volatility of the current best bid"
+ },
+ "delta": {
+ "title": "delta",
+ "type": "string",
+ "format": "decimal",
+ "description": "Delta of the option"
+ },
+ "forward_price": {
+ "title": "forward_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Forward price used to calculate option premium"
+ },
+ "gamma": {
+ "title": "gamma",
+ "type": "string",
+ "format": "decimal",
+ "description": "Gamma of the option"
+ },
+ "iv": {
+ "title": "iv",
+ "type": "string",
+ "format": "decimal",
+ "description": "Implied volatility of the option"
+ },
+ "mark_price": {
+ "title": "mark_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Mark price of the option"
+ },
+ "rho": {
+ "title": "rho",
+ "type": "string",
+ "format": "decimal",
+ "description": "Rho of the option"
+ },
+ "theta": {
+ "title": "theta",
+ "type": "string",
+ "format": "decimal",
+ "description": "Theta of the option"
+ },
+ "vega": {
+ "title": "vega",
+ "type": "string",
+ "format": "decimal",
+ "description": "Vega of the option"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "perp_details": {
+ "required": [
+ "aggregate_funding",
+ "funding_rate",
+ "index",
+ "max_rate_per_hour",
+ "min_rate_per_hour",
+ "static_interest_rate"
+ ],
+ "properties": {
+ "aggregate_funding": {
+ "title": "aggregate_funding",
+ "type": "string",
+ "format": "decimal",
+ "description": "Latest aggregated funding as per `PerpAsset.sol`"
+ },
+ "funding_rate": {
+ "title": "funding_rate",
+ "type": "string",
+ "format": "decimal",
+ "description": "Current hourly funding rate as per `PerpAsset.sol`"
+ },
+ "index": {
+ "title": "index",
+ "type": "string",
+ "description": "Underlying spot price index for funding rate"
+ },
+ "max_rate_per_hour": {
+ "title": "max_rate_per_hour",
+ "type": "string",
+ "format": "decimal",
+ "description": "Max rate per hour as per `PerpAsset.sol`"
+ },
+ "min_rate_per_hour": {
+ "title": "min_rate_per_hour",
+ "type": "string",
+ "format": "decimal",
+ "description": "Min rate per hour as per `PerpAsset.sol`"
+ },
+ "static_interest_rate": {
+ "title": "static_interest_rate",
+ "type": "string",
+ "format": "decimal",
+ "description": "Static interest rate as per `PerpAsset.sol`"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "quote_currency": {
+ "title": "quote_currency",
+ "type": "string",
+ "description": "Quote currency (`USD` for perps, `USDC` for options)"
+ },
+ "scheduled_activation": {
+ "title": "scheduled_activation",
+ "type": "integer",
+ "description": "Timestamp at which became or will become active (if applicable)"
+ },
+ "scheduled_deactivation": {
+ "title": "scheduled_deactivation",
+ "type": "integer",
+ "description": "Scheduled deactivation time for instrument (if applicable)"
+ },
+ "stats": {
+ "required": [
+ "contract_volume",
+ "high",
+ "low",
+ "num_trades",
+ "open_interest",
+ "percent_change",
+ "usd_change"
+ ],
+ "properties": {
+ "contract_volume": {
+ "title": "contract_volume",
+ "type": "string",
+ "format": "decimal",
+ "description": "Number of contracts traded during last 24 hours"
+ },
+ "high": {
+ "title": "high",
+ "type": "string",
+ "format": "decimal",
+ "description": "Highest trade price during last 24h"
+ },
+ "low": {
+ "title": "low",
+ "type": "string",
+ "format": "decimal",
+ "description": "Lowest trade price during last 24h"
+ },
+ "num_trades": {
+ "title": "num_trades",
+ "type": "string",
+ "format": "decimal",
+ "description": "Number of trades during last 24h "
+ },
+ "open_interest": {
+ "title": "open_interest",
+ "type": "string",
+ "format": "decimal",
+ "description": "Current total open interest"
+ },
+ "percent_change": {
+ "title": "percent_change",
+ "type": "string",
+ "format": "decimal",
+ "description": "24-hour price change expressed as a percentage. Options: percent change in vol; Perps: percent change in mark price"
+ },
+ "usd_change": {
+ "title": "usd_change",
+ "type": "string",
+ "format": "decimal",
+ "description": "24-hour price change in USD."
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "taker_fee_rate": {
+ "title": "taker_fee_rate",
+ "type": "string",
+ "format": "decimal",
+ "description": "Percent of spot price fee rate for takers"
+ },
+ "tick_size": {
+ "title": "tick_size",
+ "type": "string",
+ "format": "decimal",
+ "description": "Tick size of the instrument, i.e. minimum price increment"
+ },
+ "timestamp": {
+ "title": "timestamp",
+ "type": "integer",
+ "description": "Timestamp of the ticker feed snapshot"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "OptionPublicDetailsSchema": {
+ "required": ["expiry", "index", "option_type", "strike"],
+ "properties": {
+ "expiry": {
+ "title": "expiry",
+ "type": "integer",
+ "description": "Unix timestamp of expiry date (in seconds)"
+ },
+ "index": {
+ "title": "index",
+ "type": "string",
+ "description": "Underlying settlement price index"
+ },
+ "option_type": {
+ "title": "option_type",
+ "type": "string",
+ "enum": ["C", "P"]
+ },
+ "settlement_price": {
+ "title": "settlement_price",
+ "type": "string",
+ "format": "decimal",
+ "default": null,
+ "description": "Settlement price of the option",
+ "nullable": true
+ },
+ "strike": {
+ "title": "strike",
+ "type": "string",
+ "format": "decimal"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "OptionPricingSchema": {
+ "required": ["ask_iv", "bid_iv", "delta", "forward_price", "gamma", "iv", "mark_price", "rho", "theta", "vega"],
+ "properties": {
+ "ask_iv": {
+ "title": "ask_iv",
+ "type": "string",
+ "format": "decimal",
+ "description": "Implied volatility of the current best ask"
+ },
+ "bid_iv": {
+ "title": "bid_iv",
+ "type": "string",
+ "format": "decimal",
+ "description": "Implied volatility of the current best bid"
+ },
+ "delta": {
+ "title": "delta",
+ "type": "string",
+ "format": "decimal",
+ "description": "Delta of the option"
+ },
+ "forward_price": {
+ "title": "forward_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Forward price used to calculate option premium"
+ },
+ "gamma": {
+ "title": "gamma",
+ "type": "string",
+ "format": "decimal",
+ "description": "Gamma of the option"
+ },
+ "iv": {
+ "title": "iv",
+ "type": "string",
+ "format": "decimal",
+ "description": "Implied volatility of the option"
+ },
+ "mark_price": {
+ "title": "mark_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Mark price of the option"
+ },
+ "rho": {
+ "title": "rho",
+ "type": "string",
+ "format": "decimal",
+ "description": "Rho of the option"
+ },
+ "theta": {
+ "title": "theta",
+ "type": "string",
+ "format": "decimal",
+ "description": "Theta of the option"
+ },
+ "vega": {
+ "title": "vega",
+ "type": "string",
+ "format": "decimal",
+ "description": "Vega of the option"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PerpPublicDetailsSchema": {
+ "required": [
+ "aggregate_funding",
+ "funding_rate",
+ "index",
+ "max_rate_per_hour",
+ "min_rate_per_hour",
+ "static_interest_rate"
+ ],
+ "properties": {
+ "aggregate_funding": {
+ "title": "aggregate_funding",
+ "type": "string",
+ "format": "decimal",
+ "description": "Latest aggregated funding as per `PerpAsset.sol`"
+ },
+ "funding_rate": {
+ "title": "funding_rate",
+ "type": "string",
+ "format": "decimal",
+ "description": "Current hourly funding rate as per `PerpAsset.sol`"
+ },
+ "index": {
+ "title": "index",
+ "type": "string",
+ "description": "Underlying spot price index for funding rate"
+ },
+ "max_rate_per_hour": {
+ "title": "max_rate_per_hour",
+ "type": "string",
+ "format": "decimal",
+ "description": "Max rate per hour as per `PerpAsset.sol`"
+ },
+ "min_rate_per_hour": {
+ "title": "min_rate_per_hour",
+ "type": "string",
+ "format": "decimal",
+ "description": "Min rate per hour as per `PerpAsset.sol`"
+ },
+ "static_interest_rate": {
+ "title": "static_interest_rate",
+ "type": "string",
+ "format": "decimal",
+ "description": "Static interest rate as per `PerpAsset.sol`"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "AggregateTradingStatsSchema": {
+ "required": ["contract_volume", "high", "low", "num_trades", "open_interest", "percent_change", "usd_change"],
+ "properties": {
+ "contract_volume": {
+ "title": "contract_volume",
+ "type": "string",
+ "format": "decimal",
+ "description": "Number of contracts traded during last 24 hours"
+ },
+ "high": {
+ "title": "high",
+ "type": "string",
+ "format": "decimal",
+ "description": "Highest trade price during last 24h"
+ },
+ "low": {
+ "title": "low",
+ "type": "string",
+ "format": "decimal",
+ "description": "Lowest trade price during last 24h"
+ },
+ "num_trades": {
+ "title": "num_trades",
+ "type": "string",
+ "format": "decimal",
+ "description": "Number of trades during last 24h "
+ },
+ "open_interest": {
+ "title": "open_interest",
+ "type": "string",
+ "format": "decimal",
+ "description": "Current total open interest"
+ },
+ "percent_change": {
+ "title": "percent_change",
+ "type": "string",
+ "format": "decimal",
+ "description": "24-hour price change expressed as a percentage. Options: percent change in vol; Perps: percent change in mark price"
+ },
+ "usd_change": {
+ "title": "usd_change",
+ "type": "string",
+ "format": "decimal",
+ "description": "24-hour price change in USD."
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateSetMmpConfigParamsSchema": {
+ "required": ["currency", "mmp_frozen_time", "mmp_interval", "subaccount_id"],
+ "properties": {
+ "currency": {
+ "title": "currency",
+ "type": "string",
+ "description": "Currency of this mmp config"
+ },
+ "mmp_amount_limit": {
+ "title": "mmp_amount_limit",
+ "type": "string",
+ "format": "decimal",
+ "default": "0",
+ "description": "Maximum total order amount that can be traded within the mmp_interval across all instruments of the provided currency. The amounts are not netted, so a filled bid of 1 and a filled ask of 2 would count as 3.
Default: 0 (no limit)"
+ },
+ "mmp_delta_limit": {
+ "title": "mmp_delta_limit",
+ "type": "string",
+ "format": "decimal",
+ "default": "0",
+ "description": "Maximum total delta that can be traded within the mmp_interval across all instruments of the provided currency. This quantity is netted, so a filled order with +1 delta and a filled order with -2 delta would count as -1
Default: 0 (no limit)"
+ },
+ "mmp_frozen_time": {
+ "title": "mmp_frozen_time",
+ "type": "integer",
+ "description": "Time interval in ms setting how long the subaccount is frozen after an mmp trigger, if 0 then a manual reset would be required via private/reset_mmp"
+ },
+ "mmp_interval": {
+ "title": "mmp_interval",
+ "type": "integer",
+ "description": "Time interval in ms over which the limits are monotored, if 0 then mmp is disabled"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id for which to set the config"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateSetMmpConfigResponseSchema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["currency", "mmp_frozen_time", "mmp_interval", "subaccount_id"],
+ "properties": {
+ "currency": {
+ "title": "currency",
+ "type": "string",
+ "description": "Currency of this mmp config"
+ },
+ "mmp_amount_limit": {
+ "title": "mmp_amount_limit",
+ "type": "string",
+ "format": "decimal",
+ "default": "0",
+ "description": "Maximum total order amount that can be traded within the mmp_interval across all instruments of the provided currency. The amounts are not netted, so a filled bid of 1 and a filled ask of 2 would count as 3.
Default: 0 (no limit)"
+ },
+ "mmp_delta_limit": {
+ "title": "mmp_delta_limit",
+ "type": "string",
+ "format": "decimal",
+ "default": "0",
+ "description": "Maximum total delta that can be traded within the mmp_interval across all instruments of the provided currency. This quantity is netted, so a filled order with +1 delta and a filled order with -2 delta would count as -1
Default: 0 (no limit)"
+ },
+ "mmp_frozen_time": {
+ "title": "mmp_frozen_time",
+ "type": "integer",
+ "description": "Time interval in ms setting how long the subaccount is frozen after an mmp trigger, if 0 then a manual reset would be required via private/reset_mmp"
+ },
+ "mmp_interval": {
+ "title": "mmp_interval",
+ "type": "integer",
+ "description": "Time interval in ms over which the limits are monotored, if 0 then mmp is disabled"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id for which to set the config"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateSetMmpConfigResultSchema": {
+ "required": ["currency", "mmp_frozen_time", "mmp_interval", "subaccount_id"],
+ "properties": {
+ "currency": {
+ "title": "currency",
+ "type": "string",
+ "description": "Currency of this mmp config"
+ },
+ "mmp_amount_limit": {
+ "title": "mmp_amount_limit",
+ "type": "string",
+ "format": "decimal",
+ "default": "0",
+ "description": "Maximum total order amount that can be traded within the mmp_interval across all instruments of the provided currency. The amounts are not netted, so a filled bid of 1 and a filled ask of 2 would count as 3.
Default: 0 (no limit)"
+ },
+ "mmp_delta_limit": {
+ "title": "mmp_delta_limit",
+ "type": "string",
+ "format": "decimal",
+ "default": "0",
+ "description": "Maximum total delta that can be traded within the mmp_interval across all instruments of the provided currency. This quantity is netted, so a filled order with +1 delta and a filled order with -2 delta would count as -1
Default: 0 (no limit)"
+ },
+ "mmp_frozen_time": {
+ "title": "mmp_frozen_time",
+ "type": "integer",
+ "description": "Time interval in ms setting how long the subaccount is frozen after an mmp trigger, if 0 then a manual reset would be required via private/reset_mmp"
+ },
+ "mmp_interval": {
+ "title": "mmp_interval",
+ "type": "integer",
+ "description": "Time interval in ms over which the limits are monotored, if 0 then mmp is disabled"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id for which to set the config"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateCancelParamsSchema": {
+ "required": ["instrument_name", "order_id", "subaccount_id"],
+ "properties": {
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string"
+ },
+ "order_id": {
+ "title": "order_id",
+ "type": "string",
+ "format": "uuid"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateCancelResponseSchema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": [
+ "amount",
+ "average_price",
+ "cancel_reason",
+ "creation_timestamp",
+ "direction",
+ "filled_amount",
+ "instrument_name",
+ "is_transfer",
+ "label",
+ "last_update_timestamp",
+ "limit_price",
+ "max_fee",
+ "mmp",
+ "nonce",
+ "order_fee",
+ "order_id",
+ "order_status",
+ "order_type",
+ "signature",
+ "signature_expiry_sec",
+ "signer",
+ "subaccount_id",
+ "time_in_force"
+ ],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Order amount in units of the base"
+ },
+ "average_price": {
+ "title": "average_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Average fill price"
+ },
+ "cancel_reason": {
+ "title": "cancel_reason",
+ "type": "string",
+ "enum": [
+ "",
+ "user_request",
+ "mmp_trigger",
+ "insufficient_margin",
+ "signed_max_fee_too_low",
+ "cancel_on_disconnect",
+ "ioc_or_market_partial_fill",
+ "session_key_deregistered",
+ "subaccount_withdrawn",
+ "compliance"
+ ],
+ "description": "If cancelled, reason behind order cancellation"
+ },
+ "creation_timestamp": {
+ "title": "creation_timestamp",
+ "type": "integer",
+ "description": "Creation timestamp (in ms since Unix epoch)"
+ },
+ "direction": {
+ "title": "direction",
+ "type": "string",
+ "enum": ["buy", "sell"],
+ "description": "Order direction"
+ },
+ "filled_amount": {
+ "title": "filled_amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total filled amount for the order"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ },
+ "is_transfer": {
+ "title": "is_transfer",
+ "type": "boolean",
+ "description": "Whether the order was generated through `private/transfer_position`"
+ },
+ "label": {
+ "title": "label",
+ "type": "string",
+ "description": "Optional user-defined label for the order"
+ },
+ "last_update_timestamp": {
+ "title": "last_update_timestamp",
+ "type": "integer",
+ "description": "Last update timestamp (in ms since Unix epoch)"
+ },
+ "limit_price": {
+ "title": "limit_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Limit price in quote currency"
+ },
+ "max_fee": {
+ "title": "max_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Max fee in units of the quote currency"
+ },
+ "mmp": {
+ "title": "mmp",
+ "type": "boolean",
+ "description": "Whether the order is tagged for market maker protections"
+ },
+ "nonce": {
+ "title": "nonce",
+ "type": "integer",
+ "description": "Unique nonce defined as (e.g. 1695836058725001, where 001 is the random number)"
+ },
+ "order_fee": {
+ "title": "order_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total order fee paid so far"
+ },
+ "order_id": {
+ "title": "order_id",
+ "type": "string",
+ "description": "Order ID"
+ },
+ "order_status": {
+ "title": "order_status",
+ "type": "string",
+ "enum": ["open", "filled", "rejected", "cancelled", "expired"],
+ "description": "Order status"
+ },
+ "order_type": {
+ "title": "order_type",
+ "type": "string",
+ "enum": ["limit", "market"],
+ "description": "Order type"
+ },
+ "signature": {
+ "title": "signature",
+ "type": "string",
+ "description": "Ethereum signature of the order"
+ },
+ "signature_expiry_sec": {
+ "title": "signature_expiry_sec",
+ "type": "integer",
+ "description": "Signature expiry timestamp"
+ },
+ "signer": {
+ "title": "signer",
+ "type": "string",
+ "description": "Owner wallet address or registered session key that signed order"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount ID"
+ },
+ "time_in_force": {
+ "title": "time_in_force",
+ "type": "string",
+ "enum": ["gtc", "post_only", "fok", "ioc"],
+ "description": "Time in force"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateCancelResultSchema": {
+ "required": [
+ "amount",
+ "average_price",
+ "cancel_reason",
+ "creation_timestamp",
+ "direction",
+ "filled_amount",
+ "instrument_name",
+ "is_transfer",
+ "label",
+ "last_update_timestamp",
+ "limit_price",
+ "max_fee",
+ "mmp",
+ "nonce",
+ "order_fee",
+ "order_id",
+ "order_status",
+ "order_type",
+ "signature",
+ "signature_expiry_sec",
+ "signer",
+ "subaccount_id",
+ "time_in_force"
+ ],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Order amount in units of the base"
+ },
+ "average_price": {
+ "title": "average_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Average fill price"
+ },
+ "cancel_reason": {
+ "title": "cancel_reason",
+ "type": "string",
+ "enum": [
+ "",
+ "user_request",
+ "mmp_trigger",
+ "insufficient_margin",
+ "signed_max_fee_too_low",
+ "cancel_on_disconnect",
+ "ioc_or_market_partial_fill",
+ "session_key_deregistered",
+ "subaccount_withdrawn",
+ "compliance"
+ ],
+ "description": "If cancelled, reason behind order cancellation"
+ },
+ "creation_timestamp": {
+ "title": "creation_timestamp",
+ "type": "integer",
+ "description": "Creation timestamp (in ms since Unix epoch)"
+ },
+ "direction": {
+ "title": "direction",
+ "type": "string",
+ "enum": ["buy", "sell"],
+ "description": "Order direction"
+ },
+ "filled_amount": {
+ "title": "filled_amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total filled amount for the order"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ },
+ "is_transfer": {
+ "title": "is_transfer",
+ "type": "boolean",
+ "description": "Whether the order was generated through `private/transfer_position`"
+ },
+ "label": {
+ "title": "label",
+ "type": "string",
+ "description": "Optional user-defined label for the order"
+ },
+ "last_update_timestamp": {
+ "title": "last_update_timestamp",
+ "type": "integer",
+ "description": "Last update timestamp (in ms since Unix epoch)"
+ },
+ "limit_price": {
+ "title": "limit_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Limit price in quote currency"
+ },
+ "max_fee": {
+ "title": "max_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Max fee in units of the quote currency"
+ },
+ "mmp": {
+ "title": "mmp",
+ "type": "boolean",
+ "description": "Whether the order is tagged for market maker protections"
+ },
+ "nonce": {
+ "title": "nonce",
+ "type": "integer",
+ "description": "Unique nonce defined as (e.g. 1695836058725001, where 001 is the random number)"
+ },
+ "order_fee": {
+ "title": "order_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total order fee paid so far"
+ },
+ "order_id": {
+ "title": "order_id",
+ "type": "string",
+ "description": "Order ID"
+ },
+ "order_status": {
+ "title": "order_status",
+ "type": "string",
+ "enum": ["open", "filled", "rejected", "cancelled", "expired"],
+ "description": "Order status"
+ },
+ "order_type": {
+ "title": "order_type",
+ "type": "string",
+ "enum": ["limit", "market"],
+ "description": "Order type"
+ },
+ "signature": {
+ "title": "signature",
+ "type": "string",
+ "description": "Ethereum signature of the order"
+ },
+ "signature_expiry_sec": {
+ "title": "signature_expiry_sec",
+ "type": "integer",
+ "description": "Signature expiry timestamp"
+ },
+ "signer": {
+ "title": "signer",
+ "type": "string",
+ "description": "Owner wallet address or registered session key that signed order"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount ID"
+ },
+ "time_in_force": {
+ "title": "time_in_force",
+ "type": "string",
+ "enum": ["gtc", "post_only", "fok", "ioc"],
+ "description": "Time in force"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateOrderDebugParamsSchema": {
+ "required": [
+ "amount",
+ "direction",
+ "instrument_name",
+ "limit_price",
+ "max_fee",
+ "nonce",
+ "signature",
+ "signature_expiry_sec",
+ "signer",
+ "subaccount_id"
+ ],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Order amount in units of the base"
+ },
+ "direction": {
+ "title": "direction",
+ "type": "string",
+ "enum": ["buy", "sell"],
+ "description": "Order direction"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ },
+ "label": {
+ "title": "label",
+ "type": "string",
+ "default": "",
+ "description": "Optional user-defined label for the order"
+ },
+ "limit_price": {
+ "title": "limit_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Limit price in quote currency.
This field is still required for market orders because it is a component of the signature. However, market orders will not leave a resting order in the book in case of a partial fill."
+ },
+ "max_fee": {
+ "title": "max_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Max fee in units of the quote currency. Order will be rejected if the supplied max fee is below the estimated fee for this order."
+ },
+ "mmp": {
+ "title": "mmp",
+ "type": "boolean",
+ "default": false,
+ "description": "Whether the order is tagged for market maker protections (default false)"
+ },
+ "nonce": {
+ "title": "nonce",
+ "type": "integer",
+ "description": "Unique nonce defined as (e.g. 1695836058725001, where 001 is the random number)"
+ },
+ "order_type": {
+ "title": "order_type",
+ "type": "string",
+ "default": "limit",
+ "enum": ["limit", "market"],
+ "description": "Order type:
- `limit`: limit order (default)
- `market`: market order, note that limit_price is still required for market orders, but unfilled order portion will be marked as cancelled"
+ },
+ "reduce_only": {
+ "title": "reduce_only",
+ "type": "boolean",
+ "default": false,
+ "description": "If true, the order will not be able to increase position's size (default false). If the order amount exceeds available position size, the order will be filled up to the position size and the remainder will be cancelled. This flag is only supported for market orders or non-resting limit orders (IOC or FOK)"
+ },
+ "referral_code": {
+ "title": "referral_code",
+ "type": "string",
+ "default": "",
+ "description": "Optional referral code for the order"
+ },
+ "reject_timestamp": {
+ "title": "reject_timestamp",
+ "type": "integer",
+ "default": 9223372036854776000,
+ "description": "UTC timestamp in ms, if provided the matching engine will reject the order with an error if `reject_timestamp` < `server_time`. Note that the timestamp must be consistent with the server time: use `public/get_time` method to obtain current server time."
+ },
+ "signature": {
+ "title": "signature",
+ "type": "string",
+ "description": "Etherium signature of the order"
+ },
+ "signature_expiry_sec": {
+ "title": "signature_expiry_sec",
+ "type": "integer",
+ "description": "Unix timestamp in seconds. Order signature becomes invalid after this time, and the system will cancel the order.Expiry MUST be at least 5 min from now."
+ },
+ "signer": {
+ "title": "signer",
+ "type": "string",
+ "description": "Owner wallet address or registered session key that signed order"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount ID"
+ },
+ "time_in_force": {
+ "title": "time_in_force",
+ "type": "string",
+ "default": "gtc",
+ "enum": ["gtc", "post_only", "fok", "ioc"],
+ "description": "Time in force behaviour:
- `gtc`: good til cancelled (default)
- `post_only`: a limit order that will be rejected if it crosses any order in the book, i.e. acts as a taker order
- `fok`: fill or kill, will be rejected if it is not fully filled
- `ioc`: immediate or cancel, fill at best bid/ask (market) or at limit price (limit), the unfilled portion is cancelled
Note that the order will still expire on the `signature_expiry_sec` timestamp."
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateOrderDebugResponseSchema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["action_hash", "encoded_data", "encoded_data_hashed", "raw_data", "typed_data_hash"],
+ "properties": {
+ "action_hash": {
+ "title": "action_hash",
+ "type": "string",
+ "description": "Keccak hashed action data"
+ },
+ "encoded_data": {
+ "title": "encoded_data",
+ "type": "string",
+ "description": "ABI encoded order data"
+ },
+ "encoded_data_hashed": {
+ "title": "encoded_data_hashed",
+ "type": "string",
+ "description": "Keccak hashed encoded_data"
+ },
+ "raw_data": {
+ "required": ["data", "expiry", "module", "nonce", "owner", "signature", "signer", "subaccount_id"],
+ "properties": {
+ "data": {
+ "required": [
+ "asset",
+ "desired_amount",
+ "is_bid",
+ "limit_price",
+ "recipient_id",
+ "sub_id",
+ "trade_id",
+ "worst_fee"
+ ],
+ "properties": {
+ "asset": {
+ "title": "asset",
+ "type": "string"
+ },
+ "desired_amount": {
+ "title": "desired_amount",
+ "type": "string",
+ "format": "decimal"
+ },
+ "is_bid": {
+ "title": "is_bid",
+ "type": "boolean"
+ },
+ "limit_price": {
+ "title": "limit_price",
+ "type": "string",
+ "format": "decimal"
+ },
+ "recipient_id": {
+ "title": "recipient_id",
+ "type": "integer"
+ },
+ "sub_id": {
+ "title": "sub_id",
+ "type": "integer"
+ },
+ "trade_id": {
+ "title": "trade_id",
+ "type": "string"
+ },
+ "worst_fee": {
+ "title": "worst_fee",
+ "type": "string",
+ "format": "decimal"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "expiry": {
+ "title": "expiry",
+ "type": "integer"
+ },
+ "module": {
+ "title": "module",
+ "type": "string"
+ },
+ "nonce": {
+ "title": "nonce",
+ "type": "integer"
+ },
+ "owner": {
+ "title": "owner",
+ "type": "string"
+ },
+ "signature": {
+ "title": "signature",
+ "type": "string"
+ },
+ "signer": {
+ "title": "signer",
+ "type": "string"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "typed_data_hash": {
+ "title": "typed_data_hash",
+ "type": "string",
+ "description": "EIP 712 typed data hash"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateOrderDebugResultSchema": {
+ "required": ["action_hash", "encoded_data", "encoded_data_hashed", "raw_data", "typed_data_hash"],
+ "properties": {
+ "action_hash": {
+ "title": "action_hash",
+ "type": "string",
+ "description": "Keccak hashed action data"
+ },
+ "encoded_data": {
+ "title": "encoded_data",
+ "type": "string",
+ "description": "ABI encoded order data"
+ },
+ "encoded_data_hashed": {
+ "title": "encoded_data_hashed",
+ "type": "string",
+ "description": "Keccak hashed encoded_data"
+ },
+ "raw_data": {
+ "required": ["data", "expiry", "module", "nonce", "owner", "signature", "signer", "subaccount_id"],
+ "properties": {
+ "data": {
+ "required": [
+ "asset",
+ "desired_amount",
+ "is_bid",
+ "limit_price",
+ "recipient_id",
+ "sub_id",
+ "trade_id",
+ "worst_fee"
+ ],
+ "properties": {
+ "asset": {
+ "title": "asset",
+ "type": "string"
+ },
+ "desired_amount": {
+ "title": "desired_amount",
+ "type": "string",
+ "format": "decimal"
+ },
+ "is_bid": {
+ "title": "is_bid",
+ "type": "boolean"
+ },
+ "limit_price": {
+ "title": "limit_price",
+ "type": "string",
+ "format": "decimal"
+ },
+ "recipient_id": {
+ "title": "recipient_id",
+ "type": "integer"
+ },
+ "sub_id": {
+ "title": "sub_id",
+ "type": "integer"
+ },
+ "trade_id": {
+ "title": "trade_id",
+ "type": "string"
+ },
+ "worst_fee": {
+ "title": "worst_fee",
+ "type": "string",
+ "format": "decimal"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "expiry": {
+ "title": "expiry",
+ "type": "integer"
+ },
+ "module": {
+ "title": "module",
+ "type": "string"
+ },
+ "nonce": {
+ "title": "nonce",
+ "type": "integer"
+ },
+ "owner": {
+ "title": "owner",
+ "type": "string"
+ },
+ "signature": {
+ "title": "signature",
+ "type": "string"
+ },
+ "signer": {
+ "title": "signer",
+ "type": "string"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "typed_data_hash": {
+ "title": "typed_data_hash",
+ "type": "string",
+ "description": "EIP 712 typed data hash"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "SignedTradeOrderSchema": {
+ "required": ["data", "expiry", "module", "nonce", "owner", "signature", "signer", "subaccount_id"],
+ "properties": {
+ "data": {
+ "required": [
+ "asset",
+ "desired_amount",
+ "is_bid",
+ "limit_price",
+ "recipient_id",
+ "sub_id",
+ "trade_id",
+ "worst_fee"
+ ],
+ "properties": {
+ "asset": {
+ "title": "asset",
+ "type": "string"
+ },
+ "desired_amount": {
+ "title": "desired_amount",
+ "type": "string",
+ "format": "decimal"
+ },
+ "is_bid": {
+ "title": "is_bid",
+ "type": "boolean"
+ },
+ "limit_price": {
+ "title": "limit_price",
+ "type": "string",
+ "format": "decimal"
+ },
+ "recipient_id": {
+ "title": "recipient_id",
+ "type": "integer"
+ },
+ "sub_id": {
+ "title": "sub_id",
+ "type": "integer"
+ },
+ "trade_id": {
+ "title": "trade_id",
+ "type": "string"
+ },
+ "worst_fee": {
+ "title": "worst_fee",
+ "type": "string",
+ "format": "decimal"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "expiry": {
+ "title": "expiry",
+ "type": "integer"
+ },
+ "module": {
+ "title": "module",
+ "type": "string"
+ },
+ "nonce": {
+ "title": "nonce",
+ "type": "integer"
+ },
+ "owner": {
+ "title": "owner",
+ "type": "string"
+ },
+ "signature": {
+ "title": "signature",
+ "type": "string"
+ },
+ "signer": {
+ "title": "signer",
+ "type": "string"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "TradeModuleDataSchema": {
+ "required": [
+ "asset",
+ "desired_amount",
+ "is_bid",
+ "limit_price",
+ "recipient_id",
+ "sub_id",
+ "trade_id",
+ "worst_fee"
+ ],
+ "properties": {
+ "asset": {
+ "title": "asset",
+ "type": "string"
+ },
+ "desired_amount": {
+ "title": "desired_amount",
+ "type": "string",
+ "format": "decimal"
+ },
+ "is_bid": {
+ "title": "is_bid",
+ "type": "boolean"
+ },
+ "limit_price": {
+ "title": "limit_price",
+ "type": "string",
+ "format": "decimal"
+ },
+ "recipient_id": {
+ "title": "recipient_id",
+ "type": "integer"
+ },
+ "sub_id": {
+ "title": "sub_id",
+ "type": "integer"
+ },
+ "trade_id": {
+ "title": "trade_id",
+ "type": "string"
+ },
+ "worst_fee": {
+ "title": "worst_fee",
+ "type": "string",
+ "format": "decimal"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateCancelAllParamsSchema": {
+ "required": ["subaccount_id"],
+ "properties": {
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount ID"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateCancelAllResponseSchema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["cancelled_orders"],
+ "properties": {
+ "cancelled_orders": {
+ "title": "cancelled_orders",
+ "type": "integer",
+ "description": "Number of cancelled orders"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateCancelAllResultSchema": {
+ "required": ["cancelled_orders"],
+ "properties": {
+ "cancelled_orders": {
+ "title": "cancelled_orders",
+ "type": "integer",
+ "description": "Number of cancelled orders"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PublicGetTimeParamsSchema": {
+ "properties": {},
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PublicGetTimeResponseSchema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "title": "result",
+ "type": "integer",
+ "description": "Current time in milliseconds since UNIX epoch"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateGetSubaccountValueHistoryParamsSchema": {
+ "required": ["end_timestamp", "period", "start_timestamp", "subaccount_id"],
+ "properties": {
+ "end_timestamp": {
+ "title": "end_timestamp",
+ "type": "integer",
+ "description": "End timestamp"
+ },
+ "period": {
+ "title": "period",
+ "type": "integer",
+ "description": "Period"
+ },
+ "start_timestamp": {
+ "title": "start_timestamp",
+ "type": "integer",
+ "description": "Start timestamp"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateGetSubaccountValueHistoryResponseSchema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["subaccount_id", "subaccount_value_history"],
+ "properties": {
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id"
+ },
+ "subaccount_value_history": {
+ "title": "subaccount_value_history",
+ "type": "array",
+ "description": "Subaccount value history",
+ "items": {
+ "required": ["subaccount_value", "timestamp"],
+ "properties": {
+ "subaccount_value": {
+ "title": "subaccount_value",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total mark-to-market value of all positions and collaterals"
+ },
+ "timestamp": {
+ "title": "timestamp",
+ "type": "integer",
+ "description": "Timestamp of when the subaccount value was recorded into the database"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateGetSubaccountValueHistoryResultSchema": {
+ "required": ["subaccount_id", "subaccount_value_history"],
+ "properties": {
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id"
+ },
+ "subaccount_value_history": {
+ "title": "subaccount_value_history",
+ "type": "array",
+ "description": "Subaccount value history",
+ "items": {
+ "required": ["subaccount_value", "timestamp"],
+ "properties": {
+ "subaccount_value": {
+ "title": "subaccount_value",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total mark-to-market value of all positions and collaterals"
+ },
+ "timestamp": {
+ "title": "timestamp",
+ "type": "integer",
+ "description": "Timestamp of when the subaccount value was recorded into the database"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "SubAccountValueHistoryResponseSchema": {
+ "required": ["subaccount_value", "timestamp"],
+ "properties": {
+ "subaccount_value": {
+ "title": "subaccount_value",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total mark-to-market value of all positions and collaterals"
+ },
+ "timestamp": {
+ "title": "timestamp",
+ "type": "integer",
+ "description": "Timestamp of when the subaccount value was recorded into the database"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateCancelByInstrumentParamsSchema": {
+ "required": ["instrument_name", "subaccount_id"],
+ "properties": {
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Cancel all orders for this instrument"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount ID"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateCancelByInstrumentResponseSchema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["cancelled_orders"],
+ "properties": {
+ "cancelled_orders": {
+ "title": "cancelled_orders",
+ "type": "integer",
+ "description": "Number of cancelled orders"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateCancelByInstrumentResultSchema": {
+ "required": ["cancelled_orders"],
+ "properties": {
+ "cancelled_orders": {
+ "title": "cancelled_orders",
+ "type": "integer",
+ "description": "Number of cancelled orders"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateGetOrdersParamsSchema": {
+ "required": ["subaccount_id"],
+ "properties": {
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "default": null,
+ "description": "Filter by instrument name",
+ "nullable": true
+ },
+ "label": {
+ "title": "label",
+ "type": "string",
+ "default": null,
+ "description": "Filter by label",
+ "nullable": true
+ },
+ "page": {
+ "title": "page",
+ "type": "integer",
+ "default": 1,
+ "description": "Page number of results to return (default 1, returns last if above `num_pages`)"
+ },
+ "page_size": {
+ "title": "page_size",
+ "type": "integer",
+ "default": 100,
+ "description": "Number of results per page (default 100, max 1000)"
+ },
+ "status": {
+ "title": "status",
+ "type": "string",
+ "default": null,
+ "enum": ["open", "filled", "rejected", "cancelled", "expired"],
+ "description": "Filter by order status",
+ "nullable": true
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id for which to get open orders"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateGetOrdersResponseSchema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["orders", "pagination", "subaccount_id"],
+ "properties": {
+ "orders": {
+ "title": "orders",
+ "type": "array",
+ "description": "List of open orders",
+ "items": {
+ "required": [
+ "amount",
+ "average_price",
+ "cancel_reason",
+ "creation_timestamp",
+ "direction",
+ "filled_amount",
+ "instrument_name",
+ "is_transfer",
+ "label",
+ "last_update_timestamp",
+ "limit_price",
+ "max_fee",
+ "mmp",
+ "nonce",
+ "order_fee",
+ "order_id",
+ "order_status",
+ "order_type",
+ "signature",
+ "signature_expiry_sec",
+ "signer",
+ "subaccount_id",
+ "time_in_force"
+ ],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Order amount in units of the base"
+ },
+ "average_price": {
+ "title": "average_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Average fill price"
+ },
+ "cancel_reason": {
+ "title": "cancel_reason",
+ "type": "string",
+ "enum": [
+ "",
+ "user_request",
+ "mmp_trigger",
+ "insufficient_margin",
+ "signed_max_fee_too_low",
+ "cancel_on_disconnect",
+ "ioc_or_market_partial_fill",
+ "session_key_deregistered",
+ "subaccount_withdrawn",
+ "compliance"
+ ],
+ "description": "If cancelled, reason behind order cancellation"
+ },
+ "creation_timestamp": {
+ "title": "creation_timestamp",
+ "type": "integer",
+ "description": "Creation timestamp (in ms since Unix epoch)"
+ },
+ "direction": {
+ "title": "direction",
+ "type": "string",
+ "enum": ["buy", "sell"],
+ "description": "Order direction"
+ },
+ "filled_amount": {
+ "title": "filled_amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total filled amount for the order"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ },
+ "is_transfer": {
+ "title": "is_transfer",
+ "type": "boolean",
+ "description": "Whether the order was generated through `private/transfer_position`"
+ },
+ "label": {
+ "title": "label",
+ "type": "string",
+ "description": "Optional user-defined label for the order"
+ },
+ "last_update_timestamp": {
+ "title": "last_update_timestamp",
+ "type": "integer",
+ "description": "Last update timestamp (in ms since Unix epoch)"
+ },
+ "limit_price": {
+ "title": "limit_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Limit price in quote currency"
+ },
+ "max_fee": {
+ "title": "max_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Max fee in units of the quote currency"
+ },
+ "mmp": {
+ "title": "mmp",
+ "type": "boolean",
+ "description": "Whether the order is tagged for market maker protections"
+ },
+ "nonce": {
+ "title": "nonce",
+ "type": "integer",
+ "description": "Unique nonce defined as (e.g. 1695836058725001, where 001 is the random number)"
+ },
+ "order_fee": {
+ "title": "order_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total order fee paid so far"
+ },
+ "order_id": {
+ "title": "order_id",
+ "type": "string",
+ "description": "Order ID"
+ },
+ "order_status": {
+ "title": "order_status",
+ "type": "string",
+ "enum": ["open", "filled", "rejected", "cancelled", "expired"],
+ "description": "Order status"
+ },
+ "order_type": {
+ "title": "order_type",
+ "type": "string",
+ "enum": ["limit", "market"],
+ "description": "Order type"
+ },
+ "signature": {
+ "title": "signature",
+ "type": "string",
+ "description": "Ethereum signature of the order"
+ },
+ "signature_expiry_sec": {
+ "title": "signature_expiry_sec",
+ "type": "integer",
+ "description": "Signature expiry timestamp"
+ },
+ "signer": {
+ "title": "signer",
+ "type": "string",
+ "description": "Owner wallet address or registered session key that signed order"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount ID"
+ },
+ "time_in_force": {
+ "title": "time_in_force",
+ "type": "string",
+ "enum": ["gtc", "post_only", "fok", "ioc"],
+ "description": "Time in force"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "pagination": {
+ "required": ["count", "num_pages"],
+ "properties": {
+ "count": {
+ "title": "count",
+ "type": "integer",
+ "description": "Total number of items, across all pages"
+ },
+ "num_pages": {
+ "title": "num_pages",
+ "type": "integer",
+ "description": "Number of pages"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id for which to get open orders"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateGetOrdersResultSchema": {
+ "required": ["orders", "pagination", "subaccount_id"],
+ "properties": {
+ "orders": {
+ "title": "orders",
+ "type": "array",
+ "description": "List of open orders",
+ "items": {
+ "required": [
+ "amount",
+ "average_price",
+ "cancel_reason",
+ "creation_timestamp",
+ "direction",
+ "filled_amount",
+ "instrument_name",
+ "is_transfer",
+ "label",
+ "last_update_timestamp",
+ "limit_price",
+ "max_fee",
+ "mmp",
+ "nonce",
+ "order_fee",
+ "order_id",
+ "order_status",
+ "order_type",
+ "signature",
+ "signature_expiry_sec",
+ "signer",
+ "subaccount_id",
+ "time_in_force"
+ ],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Order amount in units of the base"
+ },
+ "average_price": {
+ "title": "average_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Average fill price"
+ },
+ "cancel_reason": {
+ "title": "cancel_reason",
+ "type": "string",
+ "enum": [
+ "",
+ "user_request",
+ "mmp_trigger",
+ "insufficient_margin",
+ "signed_max_fee_too_low",
+ "cancel_on_disconnect",
+ "ioc_or_market_partial_fill",
+ "session_key_deregistered",
+ "subaccount_withdrawn",
+ "compliance"
+ ],
+ "description": "If cancelled, reason behind order cancellation"
+ },
+ "creation_timestamp": {
+ "title": "creation_timestamp",
+ "type": "integer",
+ "description": "Creation timestamp (in ms since Unix epoch)"
+ },
+ "direction": {
+ "title": "direction",
+ "type": "string",
+ "enum": ["buy", "sell"],
+ "description": "Order direction"
+ },
+ "filled_amount": {
+ "title": "filled_amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total filled amount for the order"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ },
+ "is_transfer": {
+ "title": "is_transfer",
+ "type": "boolean",
+ "description": "Whether the order was generated through `private/transfer_position`"
+ },
+ "label": {
+ "title": "label",
+ "type": "string",
+ "description": "Optional user-defined label for the order"
+ },
+ "last_update_timestamp": {
+ "title": "last_update_timestamp",
+ "type": "integer",
+ "description": "Last update timestamp (in ms since Unix epoch)"
+ },
+ "limit_price": {
+ "title": "limit_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Limit price in quote currency"
+ },
+ "max_fee": {
+ "title": "max_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Max fee in units of the quote currency"
+ },
+ "mmp": {
+ "title": "mmp",
+ "type": "boolean",
+ "description": "Whether the order is tagged for market maker protections"
+ },
+ "nonce": {
+ "title": "nonce",
+ "type": "integer",
+ "description": "Unique nonce defined as (e.g. 1695836058725001, where 001 is the random number)"
+ },
+ "order_fee": {
+ "title": "order_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total order fee paid so far"
+ },
+ "order_id": {
+ "title": "order_id",
+ "type": "string",
+ "description": "Order ID"
+ },
+ "order_status": {
+ "title": "order_status",
+ "type": "string",
+ "enum": ["open", "filled", "rejected", "cancelled", "expired"],
+ "description": "Order status"
+ },
+ "order_type": {
+ "title": "order_type",
+ "type": "string",
+ "enum": ["limit", "market"],
+ "description": "Order type"
+ },
+ "signature": {
+ "title": "signature",
+ "type": "string",
+ "description": "Ethereum signature of the order"
+ },
+ "signature_expiry_sec": {
+ "title": "signature_expiry_sec",
+ "type": "integer",
+ "description": "Signature expiry timestamp"
+ },
+ "signer": {
+ "title": "signer",
+ "type": "string",
+ "description": "Owner wallet address or registered session key that signed order"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount ID"
+ },
+ "time_in_force": {
+ "title": "time_in_force",
+ "type": "string",
+ "enum": ["gtc", "post_only", "fok", "ioc"],
+ "description": "Time in force"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "pagination": {
+ "required": ["count", "num_pages"],
+ "properties": {
+ "count": {
+ "title": "count",
+ "type": "integer",
+ "description": "Total number of items, across all pages"
+ },
+ "num_pages": {
+ "title": "num_pages",
+ "type": "integer",
+ "description": "Number of pages"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id for which to get open orders"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PaginationInfoSchema": {
+ "required": ["count", "num_pages"],
+ "properties": {
+ "count": {
+ "title": "count",
+ "type": "integer",
+ "description": "Total number of items, across all pages"
+ },
+ "num_pages": {
+ "title": "num_pages",
+ "type": "integer",
+ "description": "Number of pages"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateCreateSubaccountParamsSchema": {
+ "required": [
+ "amount",
+ "asset_name",
+ "margin_type",
+ "nonce",
+ "signature",
+ "signature_expiry_sec",
+ "signer",
+ "wallet"
+ ],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Amount of the asset to deposit"
+ },
+ "asset_name": {
+ "title": "asset_name",
+ "type": "string",
+ "description": "Name of asset to deposit"
+ },
+ "currency": {
+ "title": "currency",
+ "type": "string",
+ "default": null,
+ "description": "Base currency of the subaccount (only for `PM`)",
+ "nullable": true
+ },
+ "margin_type": {
+ "title": "margin_type",
+ "type": "string",
+ "enum": ["PM", "SM"],
+ "description": "`PM` (Portfolio Margin) or `SM` (Standard Margin)"
+ },
+ "nonce": {
+ "title": "nonce",
+ "type": "integer",
+ "description": "Unique nonce defined as (e.g. 1695836058725001, where 001 is the random number)"
+ },
+ "signature": {
+ "title": "signature",
+ "type": "string",
+ "description": "Ethereum signature of the deposit"
+ },
+ "signature_expiry_sec": {
+ "title": "signature_expiry_sec",
+ "type": "integer",
+ "description": "Unix timestamp in seconds. Expiry MUST be >5min from now"
+ },
+ "signer": {
+ "title": "signer",
+ "type": "string",
+ "description": "Ethereum wallet address that is signing the deposit"
+ },
+ "wallet": {
+ "title": "wallet",
+ "type": "string",
+ "description": "Ethereum wallet address"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateCreateSubaccountResponseSchema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["status", "transaction_id"],
+ "properties": {
+ "status": {
+ "title": "status",
+ "type": "string",
+ "description": "`requested`"
+ },
+ "transaction_id": {
+ "title": "transaction_id",
+ "type": "string",
+ "format": "uuid",
+ "description": "Transaction id of the request"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateCreateSubaccountResultSchema": {
+ "required": ["status", "transaction_id"],
+ "properties": {
+ "status": {
+ "title": "status",
+ "type": "string",
+ "description": "`requested`"
+ },
+ "transaction_id": {
+ "title": "transaction_id",
+ "type": "string",
+ "format": "uuid",
+ "description": "Transaction id of the request"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateGetErc20TransferHistoryParamsSchema": {
+ "required": ["subaccount_id"],
+ "properties": {
+ "end_timestamp": {
+ "title": "end_timestamp",
+ "type": "integer",
+ "default": 9223372036854776000,
+ "description": "End timestamp of the event history (default current time)"
+ },
+ "start_timestamp": {
+ "title": "start_timestamp",
+ "type": "integer",
+ "default": 0,
+ "description": "Start timestamp of the event history (default 0)"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount id"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateGetErc20TransferHistoryResponseSchema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["events"],
+ "properties": {
+ "events": {
+ "title": "events",
+ "type": "array",
+ "description": "List of erc20 transfers",
+ "items": {
+ "required": ["amount", "asset", "counterparty_subaccount_id", "is_outgoing", "timestamp", "tx_hash"],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Amount withdrawn by the subaccount"
+ },
+ "asset": {
+ "title": "asset",
+ "type": "string",
+ "description": "Asset withdrawn"
+ },
+ "counterparty_subaccount_id": {
+ "title": "counterparty_subaccount_id",
+ "type": "integer",
+ "description": "Recipient or sender subaccount_id of transfer"
+ },
+ "is_outgoing": {
+ "title": "is_outgoing",
+ "type": "boolean",
+ "description": "True if the transfer was initiated by the subaccount, False otherwise"
+ },
+ "timestamp": {
+ "title": "timestamp",
+ "type": "integer",
+ "description": "Timestamp of the transfer (in ms since UNIX epoch)"
+ },
+ "tx_hash": {
+ "title": "tx_hash",
+ "type": "string",
+ "description": "Hash of the transaction that withdrew the funds"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateGetErc20TransferHistoryResultSchema": {
+ "required": ["events"],
+ "properties": {
+ "events": {
+ "title": "events",
+ "type": "array",
+ "description": "List of erc20 transfers",
+ "items": {
+ "required": ["amount", "asset", "counterparty_subaccount_id", "is_outgoing", "timestamp", "tx_hash"],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Amount withdrawn by the subaccount"
+ },
+ "asset": {
+ "title": "asset",
+ "type": "string",
+ "description": "Asset withdrawn"
+ },
+ "counterparty_subaccount_id": {
+ "title": "counterparty_subaccount_id",
+ "type": "integer",
+ "description": "Recipient or sender subaccount_id of transfer"
+ },
+ "is_outgoing": {
+ "title": "is_outgoing",
+ "type": "boolean",
+ "description": "True if the transfer was initiated by the subaccount, False otherwise"
+ },
+ "timestamp": {
+ "title": "timestamp",
+ "type": "integer",
+ "description": "Timestamp of the transfer (in ms since UNIX epoch)"
+ },
+ "tx_hash": {
+ "title": "tx_hash",
+ "type": "string",
+ "description": "Hash of the transaction that withdrew the funds"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "ERC20TransferSchema": {
+ "required": ["amount", "asset", "counterparty_subaccount_id", "is_outgoing", "timestamp", "tx_hash"],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Amount withdrawn by the subaccount"
+ },
+ "asset": {
+ "title": "asset",
+ "type": "string",
+ "description": "Asset withdrawn"
+ },
+ "counterparty_subaccount_id": {
+ "title": "counterparty_subaccount_id",
+ "type": "integer",
+ "description": "Recipient or sender subaccount_id of transfer"
+ },
+ "is_outgoing": {
+ "title": "is_outgoing",
+ "type": "boolean",
+ "description": "True if the transfer was initiated by the subaccount, False otherwise"
+ },
+ "timestamp": {
+ "title": "timestamp",
+ "type": "integer",
+ "description": "Timestamp of the transfer (in ms since UNIX epoch)"
+ },
+ "tx_hash": {
+ "title": "tx_hash",
+ "type": "string",
+ "description": "Hash of the transaction that withdrew the funds"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateSetCancelOnDisconnectParamsSchema": {
+ "required": ["enabled", "wallet"],
+ "properties": {
+ "enabled": {
+ "title": "enabled",
+ "type": "boolean",
+ "description": "Whether to enable or disable cancel on disconnect"
+ },
+ "wallet": {
+ "title": "wallet",
+ "type": "string",
+ "description": "Public key (wallet) of the account"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateSetCancelOnDisconnectResponseSchema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "title": "result",
+ "type": "string",
+ "enum": ["ok"],
+ "description": ""
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateGetMmpConfigParamsSchema": {
+ "required": ["subaccount_id"],
+ "properties": {
+ "currency": {
+ "title": "currency",
+ "type": "string",
+ "default": null,
+ "description": "Currency to get the config for. If not provided, returns all configs for the subaccount",
+ "nullable": true
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id for which to get the config"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateGetMmpConfigResponseSchema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "title": "result",
+ "type": "array",
+ "description": "",
+ "items": {
+ "required": ["currency", "mmp_frozen_time", "mmp_interval", "subaccount_id"],
+ "properties": {
+ "currency": {
+ "title": "currency",
+ "type": "string",
+ "description": "Currency of this mmp config"
+ },
+ "mmp_amount_limit": {
+ "title": "mmp_amount_limit",
+ "type": "string",
+ "format": "decimal",
+ "default": "0",
+ "description": "Maximum total order amount that can be traded within the mmp_interval across all instruments of the provided currency. The amounts are not netted, so a filled bid of 1 and a filled ask of 2 would count as 3.
Default: 0 (no limit)"
+ },
+ "mmp_delta_limit": {
+ "title": "mmp_delta_limit",
+ "type": "string",
+ "format": "decimal",
+ "default": "0",
+ "description": "Maximum total delta that can be traded within the mmp_interval across all instruments of the provided currency. This quantity is netted, so a filled order with +1 delta and a filled order with -2 delta would count as -1
Default: 0 (no limit)"
+ },
+ "mmp_frozen_time": {
+ "title": "mmp_frozen_time",
+ "type": "integer",
+ "description": "Time interval in ms setting how long the subaccount is frozen after an mmp trigger, if 0 then a manual reset would be required via private/reset_mmp"
+ },
+ "mmp_interval": {
+ "title": "mmp_interval",
+ "type": "integer",
+ "description": "Time interval in ms over which the limits are monotored, if 0 then mmp is disabled"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id for which to set the config"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "MMPConfigParamsSchema": {
+ "required": ["currency", "mmp_frozen_time", "mmp_interval", "subaccount_id"],
+ "properties": {
+ "currency": {
+ "title": "currency",
+ "type": "string",
+ "description": "Currency of this mmp config"
+ },
+ "mmp_amount_limit": {
+ "title": "mmp_amount_limit",
+ "type": "string",
+ "format": "decimal",
+ "default": "0",
+ "description": "Maximum total order amount that can be traded within the mmp_interval across all instruments of the provided currency. The amounts are not netted, so a filled bid of 1 and a filled ask of 2 would count as 3.
Default: 0 (no limit)"
+ },
+ "mmp_delta_limit": {
+ "title": "mmp_delta_limit",
+ "type": "string",
+ "format": "decimal",
+ "default": "0",
+ "description": "Maximum total delta that can be traded within the mmp_interval across all instruments of the provided currency. This quantity is netted, so a filled order with +1 delta and a filled order with -2 delta would count as -1
Default: 0 (no limit)"
+ },
+ "mmp_frozen_time": {
+ "title": "mmp_frozen_time",
+ "type": "integer",
+ "description": "Time interval in ms setting how long the subaccount is frozen after an mmp trigger, if 0 then a manual reset would be required via private/reset_mmp"
+ },
+ "mmp_interval": {
+ "title": "mmp_interval",
+ "type": "integer",
+ "description": "Time interval in ms over which the limits are monotored, if 0 then mmp is disabled"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id for which to set the config"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateUpdateNotificationsParamsSchema": {
+ "required": ["notification_ids", "subaccount_id"],
+ "properties": {
+ "notification_ids": {
+ "title": "notification_ids",
+ "type": "array",
+ "description": "List of notification IDs to be marked as seen",
+ "items": {
+ "title": "notification_ids",
+ "type": "integer"
+ }
+ },
+ "status": {
+ "title": "status",
+ "type": "string",
+ "default": "seen",
+ "enum": ["unseen", "seen", "hidden"],
+ "description": "Status of the notification"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateUpdateNotificationsResponseSchema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["updated_count"],
+ "properties": {
+ "updated_count": {
+ "title": "updated_count",
+ "type": "integer",
+ "description": "Number of notifications marked as seen"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateUpdateNotificationsResultSchema": {
+ "required": ["updated_count"],
+ "properties": {
+ "updated_count": {
+ "title": "updated_count",
+ "type": "integer",
+ "description": "Number of notifications marked as seen"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateExpiredAndCancelledHistoryParamsSchema": {
+ "required": ["end_timestamp", "expiry", "start_timestamp", "subaccount_id", "wallet"],
+ "properties": {
+ "end_timestamp": {
+ "title": "end_timestamp",
+ "type": "integer",
+ "description": "End Unix timestamp"
+ },
+ "expiry": {
+ "title": "expiry",
+ "type": "integer",
+ "description": "Expiry of download link in seconds. Maximum of 604800."
+ },
+ "start_timestamp": {
+ "title": "start_timestamp",
+ "type": "integer",
+ "description": "Start Unix timestamp"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount to download data for"
+ },
+ "wallet": {
+ "title": "wallet",
+ "type": "string",
+ "description": "Wallet to download data for"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateExpiredAndCancelledHistoryResponseSchema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["presigned_urls"],
+ "properties": {
+ "presigned_urls": {
+ "title": "presigned_urls",
+ "type": "array",
+ "description": "List of presigned URLs to the snapshots",
+ "items": {
+ "title": "presigned_urls",
+ "type": "string"
+ }
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateExpiredAndCancelledHistoryResultSchema": {
+ "required": ["presigned_urls"],
+ "properties": {
+ "presigned_urls": {
+ "title": "presigned_urls",
+ "type": "array",
+ "description": "List of presigned URLs to the snapshots",
+ "items": {
+ "title": "presigned_urls",
+ "type": "string"
+ }
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateWithdrawParamsSchema": {
+ "required": ["amount", "asset_name", "nonce", "signature", "signature_expiry_sec", "signer", "subaccount_id"],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Amount of the asset to withdraw"
+ },
+ "asset_name": {
+ "title": "asset_name",
+ "type": "string",
+ "description": "Name of asset to withdraw"
+ },
+ "nonce": {
+ "title": "nonce",
+ "type": "integer",
+ "description": "Unique nonce defined as (e.g. 1695836058725001, where 001 is the random number)"
+ },
+ "signature": {
+ "title": "signature",
+ "type": "string",
+ "description": "Ethereum signature of the withdraw"
+ },
+ "signature_expiry_sec": {
+ "title": "signature_expiry_sec",
+ "type": "integer",
+ "description": "Unix timestamp in seconds. Expiry MUST be >5min from now"
+ },
+ "signer": {
+ "title": "signer",
+ "type": "string",
+ "description": "Ethereum wallet address that is signing the withdraw"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateWithdrawResponseSchema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["status", "transaction_id"],
+ "properties": {
+ "status": {
+ "title": "status",
+ "type": "string",
+ "description": "`requested`"
+ },
+ "transaction_id": {
+ "title": "transaction_id",
+ "type": "string",
+ "format": "uuid",
+ "description": "Transaction id of the withdrawal"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateWithdrawResultSchema": {
+ "required": ["status", "transaction_id"],
+ "properties": {
+ "status": {
+ "title": "status",
+ "type": "string",
+ "description": "`requested`"
+ },
+ "transaction_id": {
+ "title": "transaction_id",
+ "type": "string",
+ "format": "uuid",
+ "description": "Transaction id of the withdrawal"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PublicDeregisterSessionKeyParamsSchema": {
+ "required": ["public_session_key", "signed_raw_tx", "wallet"],
+ "properties": {
+ "public_session_key": {
+ "title": "public_session_key",
+ "type": "string",
+ "description": "Session key in the form of an Ethereum EOA"
+ },
+ "signed_raw_tx": {
+ "title": "signed_raw_tx",
+ "type": "string",
+ "description": "A signed RLP encoded ETH transaction in form of a hex string (same as `w3.eth.account.sign_transaction(unsigned_tx, private_key).rawTransaction.hex()`)"
+ },
+ "wallet": {
+ "title": "wallet",
+ "type": "string",
+ "description": "Ethereum wallet address of account"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PublicDeregisterSessionKeyResponseSchema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["public_session_key", "transaction_id"],
+ "properties": {
+ "public_session_key": {
+ "title": "public_session_key",
+ "type": "string",
+ "description": "Session key in the form of an Ethereum EOA"
+ },
+ "transaction_id": {
+ "title": "transaction_id",
+ "type": "string",
+ "format": "uuid",
+ "description": "ID to lookup status of transaction"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PublicDeregisterSessionKeyResultSchema": {
+ "required": ["public_session_key", "transaction_id"],
+ "properties": {
+ "public_session_key": {
+ "title": "public_session_key",
+ "type": "string",
+ "description": "Session key in the form of an Ethereum EOA"
+ },
+ "transaction_id": {
+ "title": "transaction_id",
+ "type": "string",
+ "format": "uuid",
+ "description": "ID to lookup status of transaction"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateGetNotificationsParamsSchema": {
+ "required": ["subaccount_id"],
+ "properties": {
+ "page": {
+ "title": "page",
+ "type": "integer",
+ "default": 1,
+ "description": "Page number of results to return"
+ },
+ "page_size": {
+ "title": "page_size",
+ "type": "integer",
+ "default": 20,
+ "description": "Number of results per page"
+ },
+ "status": {
+ "title": "status",
+ "type": "string",
+ "default": null,
+ "enum": ["unseen", "seen", "hidden"],
+ "description": "Status of the notification",
+ "nullable": true
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id"
+ },
+ "type": {
+ "title": "type",
+ "type": "string",
+ "default": null,
+ "enum": ["deposit", "withdraw", "transfer", "trade", "settlement", "liquidation", "custom"],
+ "description": "Status of the notification",
+ "nullable": true
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateGetNotificationsResponseSchema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["notifications", "subaccount_id"],
+ "properties": {
+ "notifications": {
+ "title": "notifications",
+ "type": "array",
+ "description": "Notification response",
+ "items": {
+ "required": ["event", "event_details", "id", "status", "subaccount_id", "timestamp"],
+ "properties": {
+ "event": {
+ "title": "event",
+ "type": "string",
+ "description": "The specific event leading to the notification."
+ },
+ "event_details": {
+ "title": "event_details",
+ "type": "object",
+ "description": "A JSON-structured dictionary containing detailed data or context about the event.",
+ "additionalProperties": {}
+ },
+ "id": {
+ "title": "id",
+ "type": "integer",
+ "description": "The unique identifier for the notification."
+ },
+ "status": {
+ "title": "status",
+ "type": "string",
+ "description": "The status of the notification, indicating if it has been read, pending, or processed."
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "The subaccount_id associated with the notification."
+ },
+ "timestamp": {
+ "title": "timestamp",
+ "type": "integer",
+ "description": "The timestamp indicating when the notification was created or triggered."
+ },
+ "transaction_id": {
+ "title": "transaction_id",
+ "type": "integer",
+ "default": null,
+ "description": "The transaction id associated with the notification.",
+ "nullable": true
+ },
+ "tx_hash": {
+ "title": "tx_hash",
+ "type": "string",
+ "default": null,
+ "description": "The transaction hash associated with the notification.",
+ "nullable": true
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateGetNotificationsResultSchema": {
+ "required": ["notifications", "subaccount_id"],
+ "properties": {
+ "notifications": {
+ "title": "notifications",
+ "type": "array",
+ "description": "Notification response",
+ "items": {
+ "required": ["event", "event_details", "id", "status", "subaccount_id", "timestamp"],
+ "properties": {
+ "event": {
+ "title": "event",
+ "type": "string",
+ "description": "The specific event leading to the notification."
+ },
+ "event_details": {
+ "title": "event_details",
+ "type": "object",
+ "description": "A JSON-structured dictionary containing detailed data or context about the event.",
+ "additionalProperties": {}
+ },
+ "id": {
+ "title": "id",
+ "type": "integer",
+ "description": "The unique identifier for the notification."
+ },
+ "status": {
+ "title": "status",
+ "type": "string",
+ "description": "The status of the notification, indicating if it has been read, pending, or processed."
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "The subaccount_id associated with the notification."
+ },
+ "timestamp": {
+ "title": "timestamp",
+ "type": "integer",
+ "description": "The timestamp indicating when the notification was created or triggered."
+ },
+ "transaction_id": {
+ "title": "transaction_id",
+ "type": "integer",
+ "default": null,
+ "description": "The transaction id associated with the notification.",
+ "nullable": true
+ },
+ "tx_hash": {
+ "title": "tx_hash",
+ "type": "string",
+ "default": null,
+ "description": "The transaction hash associated with the notification.",
+ "nullable": true
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "NotificationResponseSchema": {
+ "required": ["event", "event_details", "id", "status", "subaccount_id", "timestamp"],
+ "properties": {
+ "event": {
+ "title": "event",
+ "type": "string",
+ "description": "The specific event leading to the notification."
+ },
+ "event_details": {
+ "title": "event_details",
+ "type": "object",
+ "description": "A JSON-structured dictionary containing detailed data or context about the event.",
+ "additionalProperties": {}
+ },
+ "id": {
+ "title": "id",
+ "type": "integer",
+ "description": "The unique identifier for the notification."
+ },
+ "status": {
+ "title": "status",
+ "type": "string",
+ "description": "The status of the notification, indicating if it has been read, pending, or processed."
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "The subaccount_id associated with the notification."
+ },
+ "timestamp": {
+ "title": "timestamp",
+ "type": "integer",
+ "description": "The timestamp indicating when the notification was created or triggered."
+ },
+ "transaction_id": {
+ "title": "transaction_id",
+ "type": "integer",
+ "default": null,
+ "description": "The transaction id associated with the notification.",
+ "nullable": true
+ },
+ "tx_hash": {
+ "title": "tx_hash",
+ "type": "string",
+ "default": null,
+ "description": "The transaction hash associated with the notification.",
+ "nullable": true
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateDepositParamsSchema": {
+ "required": ["amount", "asset_name", "nonce", "signature", "signature_expiry_sec", "signer", "subaccount_id"],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Amount of the asset to deposit"
+ },
+ "asset_name": {
+ "title": "asset_name",
+ "type": "string",
+ "description": "Name of asset to deposit"
+ },
+ "nonce": {
+ "title": "nonce",
+ "type": "integer",
+ "description": "Unique nonce defined as (e.g. 1695836058725001, where 001 is the random number)"
+ },
+ "signature": {
+ "title": "signature",
+ "type": "string",
+ "description": "Ethereum signature of the deposit"
+ },
+ "signature_expiry_sec": {
+ "title": "signature_expiry_sec",
+ "type": "integer",
+ "description": "Unix timestamp in seconds. Expiry MUST be >5min from now"
+ },
+ "signer": {
+ "title": "signer",
+ "type": "string",
+ "description": "Ethereum wallet address that is signing the deposit"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateDepositResponseSchema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["status", "transaction_id"],
+ "properties": {
+ "status": {
+ "title": "status",
+ "type": "string",
+ "description": "`requested`"
+ },
+ "transaction_id": {
+ "title": "transaction_id",
+ "type": "string",
+ "format": "uuid",
+ "description": "Transaction id of the deposit"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateDepositResultSchema": {
+ "required": ["status", "transaction_id"],
+ "properties": {
+ "status": {
+ "title": "status",
+ "type": "string",
+ "description": "`requested`"
+ },
+ "transaction_id": {
+ "title": "transaction_id",
+ "type": "string",
+ "format": "uuid",
+ "description": "Transaction id of the deposit"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateGetOpenOrdersParamsSchema": {
+ "required": ["subaccount_id"],
+ "properties": {
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id for which to get open orders"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateGetOpenOrdersResponseSchema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["orders", "subaccount_id"],
+ "properties": {
+ "orders": {
+ "title": "orders",
+ "type": "array",
+ "description": "List of open orders",
+ "items": {
+ "required": [
+ "amount",
+ "average_price",
+ "cancel_reason",
+ "creation_timestamp",
+ "direction",
+ "filled_amount",
+ "instrument_name",
+ "is_transfer",
+ "label",
+ "last_update_timestamp",
+ "limit_price",
+ "max_fee",
+ "mmp",
+ "nonce",
+ "order_fee",
+ "order_id",
+ "order_status",
+ "order_type",
+ "signature",
+ "signature_expiry_sec",
+ "signer",
+ "subaccount_id",
+ "time_in_force"
+ ],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Order amount in units of the base"
+ },
+ "average_price": {
+ "title": "average_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Average fill price"
+ },
+ "cancel_reason": {
+ "title": "cancel_reason",
+ "type": "string",
+ "enum": [
+ "",
+ "user_request",
+ "mmp_trigger",
+ "insufficient_margin",
+ "signed_max_fee_too_low",
+ "cancel_on_disconnect",
+ "ioc_or_market_partial_fill",
+ "session_key_deregistered",
+ "subaccount_withdrawn",
+ "compliance"
+ ],
+ "description": "If cancelled, reason behind order cancellation"
+ },
+ "creation_timestamp": {
+ "title": "creation_timestamp",
+ "type": "integer",
+ "description": "Creation timestamp (in ms since Unix epoch)"
+ },
+ "direction": {
+ "title": "direction",
+ "type": "string",
+ "enum": ["buy", "sell"],
+ "description": "Order direction"
+ },
+ "filled_amount": {
+ "title": "filled_amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total filled amount for the order"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ },
+ "is_transfer": {
+ "title": "is_transfer",
+ "type": "boolean",
+ "description": "Whether the order was generated through `private/transfer_position`"
+ },
+ "label": {
+ "title": "label",
+ "type": "string",
+ "description": "Optional user-defined label for the order"
+ },
+ "last_update_timestamp": {
+ "title": "last_update_timestamp",
+ "type": "integer",
+ "description": "Last update timestamp (in ms since Unix epoch)"
+ },
+ "limit_price": {
+ "title": "limit_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Limit price in quote currency"
+ },
+ "max_fee": {
+ "title": "max_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Max fee in units of the quote currency"
+ },
+ "mmp": {
+ "title": "mmp",
+ "type": "boolean",
+ "description": "Whether the order is tagged for market maker protections"
+ },
+ "nonce": {
+ "title": "nonce",
+ "type": "integer",
+ "description": "Unique nonce defined as (e.g. 1695836058725001, where 001 is the random number)"
+ },
+ "order_fee": {
+ "title": "order_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total order fee paid so far"
+ },
+ "order_id": {
+ "title": "order_id",
+ "type": "string",
+ "description": "Order ID"
+ },
+ "order_status": {
+ "title": "order_status",
+ "type": "string",
+ "enum": ["open", "filled", "rejected", "cancelled", "expired"],
+ "description": "Order status"
+ },
+ "order_type": {
+ "title": "order_type",
+ "type": "string",
+ "enum": ["limit", "market"],
+ "description": "Order type"
+ },
+ "signature": {
+ "title": "signature",
+ "type": "string",
+ "description": "Ethereum signature of the order"
+ },
+ "signature_expiry_sec": {
+ "title": "signature_expiry_sec",
+ "type": "integer",
+ "description": "Signature expiry timestamp"
+ },
+ "signer": {
+ "title": "signer",
+ "type": "string",
+ "description": "Owner wallet address or registered session key that signed order"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount ID"
+ },
+ "time_in_force": {
+ "title": "time_in_force",
+ "type": "string",
+ "enum": ["gtc", "post_only", "fok", "ioc"],
+ "description": "Time in force"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id for which to get open orders"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateGetOpenOrdersResultSchema": {
+ "required": ["orders", "subaccount_id"],
+ "properties": {
+ "orders": {
+ "title": "orders",
+ "type": "array",
+ "description": "List of open orders",
+ "items": {
+ "required": [
+ "amount",
+ "average_price",
+ "cancel_reason",
+ "creation_timestamp",
+ "direction",
+ "filled_amount",
+ "instrument_name",
+ "is_transfer",
+ "label",
+ "last_update_timestamp",
+ "limit_price",
+ "max_fee",
+ "mmp",
+ "nonce",
+ "order_fee",
+ "order_id",
+ "order_status",
+ "order_type",
+ "signature",
+ "signature_expiry_sec",
+ "signer",
+ "subaccount_id",
+ "time_in_force"
+ ],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Order amount in units of the base"
+ },
+ "average_price": {
+ "title": "average_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Average fill price"
+ },
+ "cancel_reason": {
+ "title": "cancel_reason",
+ "type": "string",
+ "enum": [
+ "",
+ "user_request",
+ "mmp_trigger",
+ "insufficient_margin",
+ "signed_max_fee_too_low",
+ "cancel_on_disconnect",
+ "ioc_or_market_partial_fill",
+ "session_key_deregistered",
+ "subaccount_withdrawn",
+ "compliance"
+ ],
+ "description": "If cancelled, reason behind order cancellation"
+ },
+ "creation_timestamp": {
+ "title": "creation_timestamp",
+ "type": "integer",
+ "description": "Creation timestamp (in ms since Unix epoch)"
+ },
+ "direction": {
+ "title": "direction",
+ "type": "string",
+ "enum": ["buy", "sell"],
+ "description": "Order direction"
+ },
+ "filled_amount": {
+ "title": "filled_amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total filled amount for the order"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ },
+ "is_transfer": {
+ "title": "is_transfer",
+ "type": "boolean",
+ "description": "Whether the order was generated through `private/transfer_position`"
+ },
+ "label": {
+ "title": "label",
+ "type": "string",
+ "description": "Optional user-defined label for the order"
+ },
+ "last_update_timestamp": {
+ "title": "last_update_timestamp",
+ "type": "integer",
+ "description": "Last update timestamp (in ms since Unix epoch)"
+ },
+ "limit_price": {
+ "title": "limit_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Limit price in quote currency"
+ },
+ "max_fee": {
+ "title": "max_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Max fee in units of the quote currency"
+ },
+ "mmp": {
+ "title": "mmp",
+ "type": "boolean",
+ "description": "Whether the order is tagged for market maker protections"
+ },
+ "nonce": {
+ "title": "nonce",
+ "type": "integer",
+ "description": "Unique nonce defined as (e.g. 1695836058725001, where 001 is the random number)"
+ },
+ "order_fee": {
+ "title": "order_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total order fee paid so far"
+ },
+ "order_id": {
+ "title": "order_id",
+ "type": "string",
+ "description": "Order ID"
+ },
+ "order_status": {
+ "title": "order_status",
+ "type": "string",
+ "enum": ["open", "filled", "rejected", "cancelled", "expired"],
+ "description": "Order status"
+ },
+ "order_type": {
+ "title": "order_type",
+ "type": "string",
+ "enum": ["limit", "market"],
+ "description": "Order type"
+ },
+ "signature": {
+ "title": "signature",
+ "type": "string",
+ "description": "Ethereum signature of the order"
+ },
+ "signature_expiry_sec": {
+ "title": "signature_expiry_sec",
+ "type": "integer",
+ "description": "Signature expiry timestamp"
+ },
+ "signer": {
+ "title": "signer",
+ "type": "string",
+ "description": "Owner wallet address or registered session key that signed order"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount ID"
+ },
+ "time_in_force": {
+ "title": "time_in_force",
+ "type": "string",
+ "enum": ["gtc", "post_only", "fok", "ioc"],
+ "description": "Time in force"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id for which to get open orders"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateGetInterestHistoryParamsSchema": {
+ "required": ["subaccount_id"],
+ "properties": {
+ "end_timestamp": {
+ "title": "end_timestamp",
+ "type": "integer",
+ "default": 9223372036854776000,
+ "description": "End timestamp of the event history (default current time)"
+ },
+ "start_timestamp": {
+ "title": "start_timestamp",
+ "type": "integer",
+ "default": 0,
+ "description": "Start timestamp of the event history (default 0)"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount id"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateGetInterestHistoryResponseSchema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["events"],
+ "properties": {
+ "events": {
+ "title": "events",
+ "type": "array",
+ "description": "List of interest payments",
+ "items": {
+ "required": ["interest", "timestamp"],
+ "properties": {
+ "interest": {
+ "title": "interest",
+ "type": "string",
+ "format": "decimal",
+ "description": "Dollar interest paid (if negative) or received (if positive) by the subaccount"
+ },
+ "timestamp": {
+ "title": "timestamp",
+ "type": "integer",
+ "description": "Timestamp of the interest payment (in ms since UNIX epoch)"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateGetInterestHistoryResultSchema": {
+ "required": ["events"],
+ "properties": {
+ "events": {
+ "title": "events",
+ "type": "array",
+ "description": "List of interest payments",
+ "items": {
+ "required": ["interest", "timestamp"],
+ "properties": {
+ "interest": {
+ "title": "interest",
+ "type": "string",
+ "format": "decimal",
+ "description": "Dollar interest paid (if negative) or received (if positive) by the subaccount"
+ },
+ "timestamp": {
+ "title": "timestamp",
+ "type": "integer",
+ "description": "Timestamp of the interest payment (in ms since UNIX epoch)"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "InterestPaymentSchema": {
+ "required": ["interest", "timestamp"],
+ "properties": {
+ "interest": {
+ "title": "interest",
+ "type": "string",
+ "format": "decimal",
+ "description": "Dollar interest paid (if negative) or received (if positive) by the subaccount"
+ },
+ "timestamp": {
+ "title": "timestamp",
+ "type": "integer",
+ "description": "Timestamp of the interest payment (in ms since UNIX epoch)"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PublicGetInstrumentParamsSchema": {
+ "required": ["instrument_name"],
+ "properties": {
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PublicGetInstrumentResponseSchema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": [
+ "amount_step",
+ "base_asset_address",
+ "base_asset_sub_id",
+ "base_currency",
+ "base_fee",
+ "instrument_name",
+ "instrument_type",
+ "is_active",
+ "maker_fee_rate",
+ "maximum_amount",
+ "minimum_amount",
+ "option_details",
+ "perp_details",
+ "quote_currency",
+ "scheduled_activation",
+ "scheduled_deactivation",
+ "taker_fee_rate",
+ "tick_size"
+ ],
+ "properties": {
+ "amount_step": {
+ "title": "amount_step",
+ "type": "string",
+ "format": "decimal",
+ "description": "Minimum valid increment of order amount"
+ },
+ "base_asset_address": {
+ "title": "base_asset_address",
+ "type": "string",
+ "description": "Blockchain address of the base asset"
+ },
+ "base_asset_sub_id": {
+ "title": "base_asset_sub_id",
+ "type": "string",
+ "description": "Sub ID of the specific base asset as defined in Asset.sol"
+ },
+ "base_currency": {
+ "title": "base_currency",
+ "type": "string",
+ "description": "Underlying currency of base asset (`ETH`, `BTC`, etc)"
+ },
+ "base_fee": {
+ "title": "base_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "$ base fee added to every taker order"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ },
+ "instrument_type": {
+ "title": "instrument_type",
+ "type": "string",
+ "enum": ["erc20", "option", "perp"],
+ "description": "`erc20`, `option`, or `perp`"
+ },
+ "is_active": {
+ "title": "is_active",
+ "type": "boolean",
+ "description": "If `True`: instrument is tradeable within `activation` and `deactivation` timestamps"
+ },
+ "maker_fee_rate": {
+ "title": "maker_fee_rate",
+ "type": "string",
+ "format": "decimal",
+ "description": "Percent of spot price fee rate for makers"
+ },
+ "mark_price_fee_rate_cap": {
+ "title": "mark_price_fee_rate_cap",
+ "type": "string",
+ "format": "decimal",
+ "default": null,
+ "description": "Percent of option price fee cap, e.g. 12.5%, null if not applicable",
+ "nullable": true
+ },
+ "maximum_amount": {
+ "title": "maximum_amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Maximum valid amount of contracts / tokens per trade"
+ },
+ "minimum_amount": {
+ "title": "minimum_amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Minimum valid amount of contracts / tokens per trade"
+ },
+ "option_details": {
+ "required": ["expiry", "index", "option_type", "strike"],
+ "properties": {
+ "expiry": {
+ "title": "expiry",
+ "type": "integer",
+ "description": "Unix timestamp of expiry date (in seconds)"
+ },
+ "index": {
+ "title": "index",
+ "type": "string",
+ "description": "Underlying settlement price index"
+ },
+ "option_type": {
+ "title": "option_type",
+ "type": "string",
+ "enum": ["C", "P"]
+ },
+ "settlement_price": {
+ "title": "settlement_price",
+ "type": "string",
+ "format": "decimal",
+ "default": null,
+ "description": "Settlement price of the option",
+ "nullable": true
+ },
+ "strike": {
+ "title": "strike",
+ "type": "string",
+ "format": "decimal"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "perp_details": {
+ "required": [
+ "aggregate_funding",
+ "funding_rate",
+ "index",
+ "max_rate_per_hour",
+ "min_rate_per_hour",
+ "static_interest_rate"
+ ],
+ "properties": {
+ "aggregate_funding": {
+ "title": "aggregate_funding",
+ "type": "string",
+ "format": "decimal",
+ "description": "Latest aggregated funding as per `PerpAsset.sol`"
+ },
+ "funding_rate": {
+ "title": "funding_rate",
+ "type": "string",
+ "format": "decimal",
+ "description": "Current hourly funding rate as per `PerpAsset.sol`"
+ },
+ "index": {
+ "title": "index",
+ "type": "string",
+ "description": "Underlying spot price index for funding rate"
+ },
+ "max_rate_per_hour": {
+ "title": "max_rate_per_hour",
+ "type": "string",
+ "format": "decimal",
+ "description": "Max rate per hour as per `PerpAsset.sol`"
+ },
+ "min_rate_per_hour": {
+ "title": "min_rate_per_hour",
+ "type": "string",
+ "format": "decimal",
+ "description": "Min rate per hour as per `PerpAsset.sol`"
+ },
+ "static_interest_rate": {
+ "title": "static_interest_rate",
+ "type": "string",
+ "format": "decimal",
+ "description": "Static interest rate as per `PerpAsset.sol`"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "quote_currency": {
+ "title": "quote_currency",
+ "type": "string",
+ "description": "Quote currency (`USD` for perps, `USDC` for options)"
+ },
+ "scheduled_activation": {
+ "title": "scheduled_activation",
+ "type": "integer",
+ "description": "Timestamp at which became or will become active (if applicable)"
+ },
+ "scheduled_deactivation": {
+ "title": "scheduled_deactivation",
+ "type": "integer",
+ "description": "Scheduled deactivation time for instrument (if applicable)"
+ },
+ "taker_fee_rate": {
+ "title": "taker_fee_rate",
+ "type": "string",
+ "format": "decimal",
+ "description": "Percent of spot price fee rate for takers"
+ },
+ "tick_size": {
+ "title": "tick_size",
+ "type": "string",
+ "format": "decimal",
+ "description": "Tick size of the instrument, i.e. minimum price increment"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PublicGetInstrumentResultSchema": {
+ "required": [
+ "amount_step",
+ "base_asset_address",
+ "base_asset_sub_id",
+ "base_currency",
+ "base_fee",
+ "instrument_name",
+ "instrument_type",
+ "is_active",
+ "maker_fee_rate",
+ "maximum_amount",
+ "minimum_amount",
+ "option_details",
+ "perp_details",
+ "quote_currency",
+ "scheduled_activation",
+ "scheduled_deactivation",
+ "taker_fee_rate",
+ "tick_size"
+ ],
+ "properties": {
+ "amount_step": {
+ "title": "amount_step",
+ "type": "string",
+ "format": "decimal",
+ "description": "Minimum valid increment of order amount"
+ },
+ "base_asset_address": {
+ "title": "base_asset_address",
+ "type": "string",
+ "description": "Blockchain address of the base asset"
+ },
+ "base_asset_sub_id": {
+ "title": "base_asset_sub_id",
+ "type": "string",
+ "description": "Sub ID of the specific base asset as defined in Asset.sol"
+ },
+ "base_currency": {
+ "title": "base_currency",
+ "type": "string",
+ "description": "Underlying currency of base asset (`ETH`, `BTC`, etc)"
+ },
+ "base_fee": {
+ "title": "base_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "$ base fee added to every taker order"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ },
+ "instrument_type": {
+ "title": "instrument_type",
+ "type": "string",
+ "enum": ["erc20", "option", "perp"],
+ "description": "`erc20`, `option`, or `perp`"
+ },
+ "is_active": {
+ "title": "is_active",
+ "type": "boolean",
+ "description": "If `True`: instrument is tradeable within `activation` and `deactivation` timestamps"
+ },
+ "maker_fee_rate": {
+ "title": "maker_fee_rate",
+ "type": "string",
+ "format": "decimal",
+ "description": "Percent of spot price fee rate for makers"
+ },
+ "mark_price_fee_rate_cap": {
+ "title": "mark_price_fee_rate_cap",
+ "type": "string",
+ "format": "decimal",
+ "default": null,
+ "description": "Percent of option price fee cap, e.g. 12.5%, null if not applicable",
+ "nullable": true
+ },
+ "maximum_amount": {
+ "title": "maximum_amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Maximum valid amount of contracts / tokens per trade"
+ },
+ "minimum_amount": {
+ "title": "minimum_amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Minimum valid amount of contracts / tokens per trade"
+ },
+ "option_details": {
+ "required": ["expiry", "index", "option_type", "strike"],
+ "properties": {
+ "expiry": {
+ "title": "expiry",
+ "type": "integer",
+ "description": "Unix timestamp of expiry date (in seconds)"
+ },
+ "index": {
+ "title": "index",
+ "type": "string",
+ "description": "Underlying settlement price index"
+ },
+ "option_type": {
+ "title": "option_type",
+ "type": "string",
+ "enum": ["C", "P"]
+ },
+ "settlement_price": {
+ "title": "settlement_price",
+ "type": "string",
+ "format": "decimal",
+ "default": null,
+ "description": "Settlement price of the option",
+ "nullable": true
+ },
+ "strike": {
+ "title": "strike",
+ "type": "string",
+ "format": "decimal"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "perp_details": {
+ "required": [
+ "aggregate_funding",
+ "funding_rate",
+ "index",
+ "max_rate_per_hour",
+ "min_rate_per_hour",
+ "static_interest_rate"
+ ],
+ "properties": {
+ "aggregate_funding": {
+ "title": "aggregate_funding",
+ "type": "string",
+ "format": "decimal",
+ "description": "Latest aggregated funding as per `PerpAsset.sol`"
+ },
+ "funding_rate": {
+ "title": "funding_rate",
+ "type": "string",
+ "format": "decimal",
+ "description": "Current hourly funding rate as per `PerpAsset.sol`"
+ },
+ "index": {
+ "title": "index",
+ "type": "string",
+ "description": "Underlying spot price index for funding rate"
+ },
+ "max_rate_per_hour": {
+ "title": "max_rate_per_hour",
+ "type": "string",
+ "format": "decimal",
+ "description": "Max rate per hour as per `PerpAsset.sol`"
+ },
+ "min_rate_per_hour": {
+ "title": "min_rate_per_hour",
+ "type": "string",
+ "format": "decimal",
+ "description": "Min rate per hour as per `PerpAsset.sol`"
+ },
+ "static_interest_rate": {
+ "title": "static_interest_rate",
+ "type": "string",
+ "format": "decimal",
+ "description": "Static interest rate as per `PerpAsset.sol`"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "quote_currency": {
+ "title": "quote_currency",
+ "type": "string",
+ "description": "Quote currency (`USD` for perps, `USDC` for options)"
+ },
+ "scheduled_activation": {
+ "title": "scheduled_activation",
+ "type": "integer",
+ "description": "Timestamp at which became or will become active (if applicable)"
+ },
+ "scheduled_deactivation": {
+ "title": "scheduled_deactivation",
+ "type": "integer",
+ "description": "Scheduled deactivation time for instrument (if applicable)"
+ },
+ "taker_fee_rate": {
+ "title": "taker_fee_rate",
+ "type": "string",
+ "format": "decimal",
+ "description": "Percent of spot price fee rate for takers"
+ },
+ "tick_size": {
+ "title": "tick_size",
+ "type": "string",
+ "format": "decimal",
+ "description": "Tick size of the instrument, i.e. minimum price increment"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateGetOrderHistoryParamsSchema": {
+ "required": ["subaccount_id"],
+ "properties": {
+ "page": {
+ "title": "page",
+ "type": "integer",
+ "default": 1,
+ "description": "Page number of results to return (default 1, returns last if above `num_pages`)"
+ },
+ "page_size": {
+ "title": "page_size",
+ "type": "integer",
+ "default": 100,
+ "description": "Number of results per page (default 100, max 1000)"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id for which to get order history"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateGetOrderHistoryResponseSchema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["orders", "pagination", "subaccount_id"],
+ "properties": {
+ "orders": {
+ "title": "orders",
+ "type": "array",
+ "description": "List of open orders",
+ "items": {
+ "required": [
+ "amount",
+ "average_price",
+ "cancel_reason",
+ "creation_timestamp",
+ "direction",
+ "filled_amount",
+ "instrument_name",
+ "is_transfer",
+ "label",
+ "last_update_timestamp",
+ "limit_price",
+ "max_fee",
+ "mmp",
+ "nonce",
+ "order_fee",
+ "order_id",
+ "order_status",
+ "order_type",
+ "signature",
+ "signature_expiry_sec",
+ "signer",
+ "subaccount_id",
+ "time_in_force"
+ ],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Order amount in units of the base"
+ },
+ "average_price": {
+ "title": "average_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Average fill price"
+ },
+ "cancel_reason": {
+ "title": "cancel_reason",
+ "type": "string",
+ "enum": [
+ "",
+ "user_request",
+ "mmp_trigger",
+ "insufficient_margin",
+ "signed_max_fee_too_low",
+ "cancel_on_disconnect",
+ "ioc_or_market_partial_fill",
+ "session_key_deregistered",
+ "subaccount_withdrawn",
+ "compliance"
+ ],
+ "description": "If cancelled, reason behind order cancellation"
+ },
+ "creation_timestamp": {
+ "title": "creation_timestamp",
+ "type": "integer",
+ "description": "Creation timestamp (in ms since Unix epoch)"
+ },
+ "direction": {
+ "title": "direction",
+ "type": "string",
+ "enum": ["buy", "sell"],
+ "description": "Order direction"
+ },
+ "filled_amount": {
+ "title": "filled_amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total filled amount for the order"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ },
+ "is_transfer": {
+ "title": "is_transfer",
+ "type": "boolean",
+ "description": "Whether the order was generated through `private/transfer_position`"
+ },
+ "label": {
+ "title": "label",
+ "type": "string",
+ "description": "Optional user-defined label for the order"
+ },
+ "last_update_timestamp": {
+ "title": "last_update_timestamp",
+ "type": "integer",
+ "description": "Last update timestamp (in ms since Unix epoch)"
+ },
+ "limit_price": {
+ "title": "limit_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Limit price in quote currency"
+ },
+ "max_fee": {
+ "title": "max_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Max fee in units of the quote currency"
+ },
+ "mmp": {
+ "title": "mmp",
+ "type": "boolean",
+ "description": "Whether the order is tagged for market maker protections"
+ },
+ "nonce": {
+ "title": "nonce",
+ "type": "integer",
+ "description": "Unique nonce defined as (e.g. 1695836058725001, where 001 is the random number)"
+ },
+ "order_fee": {
+ "title": "order_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total order fee paid so far"
+ },
+ "order_id": {
+ "title": "order_id",
+ "type": "string",
+ "description": "Order ID"
+ },
+ "order_status": {
+ "title": "order_status",
+ "type": "string",
+ "enum": ["open", "filled", "rejected", "cancelled", "expired"],
+ "description": "Order status"
+ },
+ "order_type": {
+ "title": "order_type",
+ "type": "string",
+ "enum": ["limit", "market"],
+ "description": "Order type"
+ },
+ "signature": {
+ "title": "signature",
+ "type": "string",
+ "description": "Ethereum signature of the order"
+ },
+ "signature_expiry_sec": {
+ "title": "signature_expiry_sec",
+ "type": "integer",
+ "description": "Signature expiry timestamp"
+ },
+ "signer": {
+ "title": "signer",
+ "type": "string",
+ "description": "Owner wallet address or registered session key that signed order"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount ID"
+ },
+ "time_in_force": {
+ "title": "time_in_force",
+ "type": "string",
+ "enum": ["gtc", "post_only", "fok", "ioc"],
+ "description": "Time in force"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "pagination": {
+ "required": ["count", "num_pages"],
+ "properties": {
+ "count": {
+ "title": "count",
+ "type": "integer",
+ "description": "Total number of items, across all pages"
+ },
+ "num_pages": {
+ "title": "num_pages",
+ "type": "integer",
+ "description": "Number of pages"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id for which to get open orders"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateGetOrderHistoryResultSchema": {
+ "required": ["orders", "pagination", "subaccount_id"],
+ "properties": {
+ "orders": {
+ "title": "orders",
+ "type": "array",
+ "description": "List of open orders",
+ "items": {
+ "required": [
+ "amount",
+ "average_price",
+ "cancel_reason",
+ "creation_timestamp",
+ "direction",
+ "filled_amount",
+ "instrument_name",
+ "is_transfer",
+ "label",
+ "last_update_timestamp",
+ "limit_price",
+ "max_fee",
+ "mmp",
+ "nonce",
+ "order_fee",
+ "order_id",
+ "order_status",
+ "order_type",
+ "signature",
+ "signature_expiry_sec",
+ "signer",
+ "subaccount_id",
+ "time_in_force"
+ ],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Order amount in units of the base"
+ },
+ "average_price": {
+ "title": "average_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Average fill price"
+ },
+ "cancel_reason": {
+ "title": "cancel_reason",
+ "type": "string",
+ "enum": [
+ "",
+ "user_request",
+ "mmp_trigger",
+ "insufficient_margin",
+ "signed_max_fee_too_low",
+ "cancel_on_disconnect",
+ "ioc_or_market_partial_fill",
+ "session_key_deregistered",
+ "subaccount_withdrawn",
+ "compliance"
+ ],
+ "description": "If cancelled, reason behind order cancellation"
+ },
+ "creation_timestamp": {
+ "title": "creation_timestamp",
+ "type": "integer",
+ "description": "Creation timestamp (in ms since Unix epoch)"
+ },
+ "direction": {
+ "title": "direction",
+ "type": "string",
+ "enum": ["buy", "sell"],
+ "description": "Order direction"
+ },
+ "filled_amount": {
+ "title": "filled_amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total filled amount for the order"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ },
+ "is_transfer": {
+ "title": "is_transfer",
+ "type": "boolean",
+ "description": "Whether the order was generated through `private/transfer_position`"
+ },
+ "label": {
+ "title": "label",
+ "type": "string",
+ "description": "Optional user-defined label for the order"
+ },
+ "last_update_timestamp": {
+ "title": "last_update_timestamp",
+ "type": "integer",
+ "description": "Last update timestamp (in ms since Unix epoch)"
+ },
+ "limit_price": {
+ "title": "limit_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Limit price in quote currency"
+ },
+ "max_fee": {
+ "title": "max_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Max fee in units of the quote currency"
+ },
+ "mmp": {
+ "title": "mmp",
+ "type": "boolean",
+ "description": "Whether the order is tagged for market maker protections"
+ },
+ "nonce": {
+ "title": "nonce",
+ "type": "integer",
+ "description": "Unique nonce defined as (e.g. 1695836058725001, where 001 is the random number)"
+ },
+ "order_fee": {
+ "title": "order_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Total order fee paid so far"
+ },
+ "order_id": {
+ "title": "order_id",
+ "type": "string",
+ "description": "Order ID"
+ },
+ "order_status": {
+ "title": "order_status",
+ "type": "string",
+ "enum": ["open", "filled", "rejected", "cancelled", "expired"],
+ "description": "Order status"
+ },
+ "order_type": {
+ "title": "order_type",
+ "type": "string",
+ "enum": ["limit", "market"],
+ "description": "Order type"
+ },
+ "signature": {
+ "title": "signature",
+ "type": "string",
+ "description": "Ethereum signature of the order"
+ },
+ "signature_expiry_sec": {
+ "title": "signature_expiry_sec",
+ "type": "integer",
+ "description": "Signature expiry timestamp"
+ },
+ "signer": {
+ "title": "signer",
+ "type": "string",
+ "description": "Owner wallet address or registered session key that signed order"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount ID"
+ },
+ "time_in_force": {
+ "title": "time_in_force",
+ "type": "string",
+ "enum": ["gtc", "post_only", "fok", "ioc"],
+ "description": "Time in force"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "pagination": {
+ "required": ["count", "num_pages"],
+ "properties": {
+ "count": {
+ "title": "count",
+ "type": "integer",
+ "description": "Total number of items, across all pages"
+ },
+ "num_pages": {
+ "title": "num_pages",
+ "type": "integer",
+ "description": "Number of pages"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id for which to get open orders"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateGetTradeHistoryParamsSchema": {
+ "required": ["subaccount_id"],
+ "properties": {
+ "from_timestamp": {
+ "title": "from_timestamp",
+ "type": "integer",
+ "default": 0,
+ "description": "Earliest timestamp to filter by (in ms since Unix epoch). If not provied, defaults to 0."
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "default": null,
+ "description": "Instrument name to filter by",
+ "nullable": true
+ },
+ "order_id": {
+ "title": "order_id",
+ "type": "string",
+ "default": null,
+ "description": "Order id to filter by",
+ "nullable": true
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id for which to get trades"
+ },
+ "to_timestamp": {
+ "title": "to_timestamp",
+ "type": "integer",
+ "default": 18446744073709552000,
+ "description": "Latest timestamp to filter by (in ms since Unix epoch). If not provied, defaults to returning all data up to current time."
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateGetTradeHistoryResponseSchema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["subaccount_id", "trades"],
+ "properties": {
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id for which to get the trade history"
+ },
+ "trades": {
+ "title": "trades",
+ "type": "array",
+ "description": "List of trades",
+ "items": {
+ "required": [
+ "direction",
+ "index_price",
+ "instrument_name",
+ "is_transfer",
+ "label",
+ "liquidity_role",
+ "mark_price",
+ "order_id",
+ "realized_pnl",
+ "subaccount_id",
+ "timestamp",
+ "trade_amount",
+ "trade_fee",
+ "trade_id",
+ "trade_price",
+ "tx_hash",
+ "tx_status"
+ ],
+ "properties": {
+ "direction": {
+ "title": "direction",
+ "type": "string",
+ "enum": ["buy", "sell"],
+ "description": "Order direction"
+ },
+ "index_price": {
+ "title": "index_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Index price of the underlying at the time of the trade"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ },
+ "is_transfer": {
+ "title": "is_transfer",
+ "type": "boolean",
+ "description": "Whether the trade was generated through `private/transfer_position`"
+ },
+ "label": {
+ "title": "label",
+ "type": "string",
+ "description": "Optional user-defined label for the order"
+ },
+ "liquidity_role": {
+ "title": "liquidity_role",
+ "type": "string",
+ "enum": ["maker", "taker"],
+ "description": "Role of the user in the trade"
+ },
+ "mark_price": {
+ "title": "mark_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Mark price of the instrument at the time of the trade"
+ },
+ "order_id": {
+ "title": "order_id",
+ "type": "string",
+ "description": "Order ID"
+ },
+ "realized_pnl": {
+ "title": "realized_pnl",
+ "type": "string",
+ "format": "decimal",
+ "description": "Realized PnL for this trade"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount ID"
+ },
+ "timestamp": {
+ "title": "timestamp",
+ "type": "integer",
+ "description": "Trade timestamp (in ms since Unix epoch)"
+ },
+ "trade_amount": {
+ "title": "trade_amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Amount filled in this trade"
+ },
+ "trade_fee": {
+ "title": "trade_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Fee for this trade"
+ },
+ "trade_id": {
+ "title": "trade_id",
+ "type": "string",
+ "description": "Trade ID"
+ },
+ "trade_price": {
+ "title": "trade_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Price at which the trade was filled"
+ },
+ "tx_hash": {
+ "title": "tx_hash",
+ "type": "string",
+ "default": null,
+ "description": "Blockchain transaction hash",
+ "nullable": true
+ },
+ "tx_status": {
+ "title": "tx_status",
+ "type": "string",
+ "enum": ["requested", "pending", "settled", "reverted", "ignored"],
+ "description": "Blockchain transaction status"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateGetTradeHistoryResultSchema": {
+ "required": ["subaccount_id", "trades"],
+ "properties": {
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id for which to get the trade history"
+ },
+ "trades": {
+ "title": "trades",
+ "type": "array",
+ "description": "List of trades",
+ "items": {
+ "required": [
+ "direction",
+ "index_price",
+ "instrument_name",
+ "is_transfer",
+ "label",
+ "liquidity_role",
+ "mark_price",
+ "order_id",
+ "realized_pnl",
+ "subaccount_id",
+ "timestamp",
+ "trade_amount",
+ "trade_fee",
+ "trade_id",
+ "trade_price",
+ "tx_hash",
+ "tx_status"
+ ],
+ "properties": {
+ "direction": {
+ "title": "direction",
+ "type": "string",
+ "enum": ["buy", "sell"],
+ "description": "Order direction"
+ },
+ "index_price": {
+ "title": "index_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Index price of the underlying at the time of the trade"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ },
+ "is_transfer": {
+ "title": "is_transfer",
+ "type": "boolean",
+ "description": "Whether the trade was generated through `private/transfer_position`"
+ },
+ "label": {
+ "title": "label",
+ "type": "string",
+ "description": "Optional user-defined label for the order"
+ },
+ "liquidity_role": {
+ "title": "liquidity_role",
+ "type": "string",
+ "enum": ["maker", "taker"],
+ "description": "Role of the user in the trade"
+ },
+ "mark_price": {
+ "title": "mark_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Mark price of the instrument at the time of the trade"
+ },
+ "order_id": {
+ "title": "order_id",
+ "type": "string",
+ "description": "Order ID"
+ },
+ "realized_pnl": {
+ "title": "realized_pnl",
+ "type": "string",
+ "format": "decimal",
+ "description": "Realized PnL for this trade"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount ID"
+ },
+ "timestamp": {
+ "title": "timestamp",
+ "type": "integer",
+ "description": "Trade timestamp (in ms since Unix epoch)"
+ },
+ "trade_amount": {
+ "title": "trade_amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Amount filled in this trade"
+ },
+ "trade_fee": {
+ "title": "trade_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Fee for this trade"
+ },
+ "trade_id": {
+ "title": "trade_id",
+ "type": "string",
+ "description": "Trade ID"
+ },
+ "trade_price": {
+ "title": "trade_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Price at which the trade was filled"
+ },
+ "tx_hash": {
+ "title": "tx_hash",
+ "type": "string",
+ "default": null,
+ "description": "Blockchain transaction hash",
+ "nullable": true
+ },
+ "tx_status": {
+ "title": "tx_status",
+ "type": "string",
+ "enum": ["requested", "pending", "settled", "reverted", "ignored"],
+ "description": "Blockchain transaction status"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateGetWithdrawalHistoryParamsSchema": {
+ "required": ["subaccount_id"],
+ "properties": {
+ "end_timestamp": {
+ "title": "end_timestamp",
+ "type": "integer",
+ "default": 9223372036854776000,
+ "description": "End timestamp of the event history (default current time)"
+ },
+ "start_timestamp": {
+ "title": "start_timestamp",
+ "type": "integer",
+ "default": 0,
+ "description": "Start timestamp of the event history (default 0)"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount id"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateGetWithdrawalHistoryResponseSchema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["events"],
+ "properties": {
+ "events": {
+ "title": "events",
+ "type": "array",
+ "description": "List of withdrawals",
+ "items": {
+ "required": ["amount", "asset", "timestamp", "tx_hash"],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Amount withdrawn by the subaccount"
+ },
+ "asset": {
+ "title": "asset",
+ "type": "string",
+ "description": "Asset withdrawn"
+ },
+ "timestamp": {
+ "title": "timestamp",
+ "type": "integer",
+ "description": "Timestamp of the withdrawal (in ms since UNIX epoch)"
+ },
+ "tx_hash": {
+ "title": "tx_hash",
+ "type": "string",
+ "description": "Hash of the transaction that withdrew the funds"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateGetWithdrawalHistoryResultSchema": {
+ "required": ["events"],
+ "properties": {
+ "events": {
+ "title": "events",
+ "type": "array",
+ "description": "List of withdrawals",
+ "items": {
+ "required": ["amount", "asset", "timestamp", "tx_hash"],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Amount withdrawn by the subaccount"
+ },
+ "asset": {
+ "title": "asset",
+ "type": "string",
+ "description": "Asset withdrawn"
+ },
+ "timestamp": {
+ "title": "timestamp",
+ "type": "integer",
+ "description": "Timestamp of the withdrawal (in ms since UNIX epoch)"
+ },
+ "tx_hash": {
+ "title": "tx_hash",
+ "type": "string",
+ "description": "Hash of the transaction that withdrew the funds"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "WithdrawalSchema": {
+ "required": ["amount", "asset", "timestamp", "tx_hash"],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Amount withdrawn by the subaccount"
+ },
+ "asset": {
+ "title": "asset",
+ "type": "string",
+ "description": "Asset withdrawn"
+ },
+ "timestamp": {
+ "title": "timestamp",
+ "type": "integer",
+ "description": "Timestamp of the withdrawal (in ms since UNIX epoch)"
+ },
+ "tx_hash": {
+ "title": "tx_hash",
+ "type": "string",
+ "description": "Hash of the transaction that withdrew the funds"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateGetMarginParamsSchema": {
+ "required": ["subaccount_id"],
+ "properties": {
+ "simulated_position_changes": {
+ "title": "simulated_position_changes",
+ "type": "array",
+ "default": null,
+ "description": "Optional, add positions to simulate a trade",
+ "items": {
+ "required": ["amount", "instrument_name"],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Position amount to simulate"
+ },
+ "entry_price": {
+ "title": "entry_price",
+ "type": "string",
+ "format": "decimal",
+ "default": null,
+ "description": "Only for perps. Entry price to use in the simulation. Mark price is used if not provided.",
+ "nullable": true
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "nullable": true
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateGetMarginResponseSchema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": [
+ "is_valid_trade",
+ "post_initial_margin",
+ "post_maintenance_margin",
+ "pre_initial_margin",
+ "pre_maintenance_margin",
+ "subaccount_id"
+ ],
+ "properties": {
+ "is_valid_trade": {
+ "title": "is_valid_trade",
+ "type": "boolean",
+ "description": "True if trade passes margin requirement"
+ },
+ "post_initial_margin": {
+ "title": "post_initial_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "Initial margin requirement post trade"
+ },
+ "post_maintenance_margin": {
+ "title": "post_maintenance_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "Maintenance margin requirement post trade"
+ },
+ "pre_initial_margin": {
+ "title": "pre_initial_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "Initial margin requirement before trade"
+ },
+ "pre_maintenance_margin": {
+ "title": "pre_maintenance_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "Maintenance margin requirement before trade"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateGetMarginResultSchema": {
+ "required": [
+ "is_valid_trade",
+ "post_initial_margin",
+ "post_maintenance_margin",
+ "pre_initial_margin",
+ "pre_maintenance_margin",
+ "subaccount_id"
+ ],
+ "properties": {
+ "is_valid_trade": {
+ "title": "is_valid_trade",
+ "type": "boolean",
+ "description": "True if trade passes margin requirement"
+ },
+ "post_initial_margin": {
+ "title": "post_initial_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "Initial margin requirement post trade"
+ },
+ "post_maintenance_margin": {
+ "title": "post_maintenance_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "Maintenance margin requirement post trade"
+ },
+ "pre_initial_margin": {
+ "title": "pre_initial_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "Initial margin requirement before trade"
+ },
+ "pre_maintenance_margin": {
+ "title": "pre_maintenance_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "Maintenance margin requirement before trade"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateTransferErc20ParamsSchema": {
+ "required": ["recipient_details", "recipient_subaccount_id", "sender_details", "subaccount_id", "transfer"],
+ "properties": {
+ "recipient_details": {
+ "required": ["nonce", "signature", "signature_expiry_sec", "signer"],
+ "properties": {
+ "nonce": {
+ "title": "nonce",
+ "type": "integer",
+ "description": "Unique nonce defined as (e.g. 1695836058725001, where 001 is the random number)"
+ },
+ "signature": {
+ "title": "signature",
+ "type": "string",
+ "description": "Ethereum signature of the transfer"
+ },
+ "signature_expiry_sec": {
+ "title": "signature_expiry_sec",
+ "type": "integer",
+ "description": "Unix timestamp in seconds. Expiry MUST be >5min from now"
+ },
+ "signer": {
+ "title": "signer",
+ "type": "string",
+ "description": "Ethereum wallet address that is signing the transfer"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "recipient_subaccount_id": {
+ "title": "recipient_subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id of the recipient"
+ },
+ "sender_details": {
+ "required": ["nonce", "signature", "signature_expiry_sec", "signer"],
+ "properties": {
+ "nonce": {
+ "title": "nonce",
+ "type": "integer",
+ "description": "Unique nonce defined as (e.g. 1695836058725001, where 001 is the random number)"
+ },
+ "signature": {
+ "title": "signature",
+ "type": "string",
+ "description": "Ethereum signature of the transfer"
+ },
+ "signature_expiry_sec": {
+ "title": "signature_expiry_sec",
+ "type": "integer",
+ "description": "Unix timestamp in seconds. Expiry MUST be >5min from now"
+ },
+ "signer": {
+ "title": "signer",
+ "type": "string",
+ "description": "Ethereum wallet address that is signing the transfer"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id"
+ },
+ "transfer": {
+ "required": ["address", "amount", "sub_id"],
+ "properties": {
+ "address": {
+ "title": "address",
+ "type": "string",
+ "description": "Ethereum address of the asset being transferred"
+ },
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Amount to transfer"
+ },
+ "sub_id": {
+ "title": "sub_id",
+ "type": "integer",
+ "description": "Sub ID of the asset being transferred"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "SignatureDetailsSchema": {
+ "required": ["nonce", "signature", "signature_expiry_sec", "signer"],
+ "properties": {
+ "nonce": {
+ "title": "nonce",
+ "type": "integer",
+ "description": "Unique nonce defined as (e.g. 1695836058725001, where 001 is the random number)"
+ },
+ "signature": {
+ "title": "signature",
+ "type": "string",
+ "description": "Ethereum signature of the transfer"
+ },
+ "signature_expiry_sec": {
+ "title": "signature_expiry_sec",
+ "type": "integer",
+ "description": "Unix timestamp in seconds. Expiry MUST be >5min from now"
+ },
+ "signer": {
+ "title": "signer",
+ "type": "string",
+ "description": "Ethereum wallet address that is signing the transfer"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "TransferDetailsSchema": {
+ "required": ["address", "amount", "sub_id"],
+ "properties": {
+ "address": {
+ "title": "address",
+ "type": "string",
+ "description": "Ethereum address of the asset being transferred"
+ },
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Amount to transfer"
+ },
+ "sub_id": {
+ "title": "sub_id",
+ "type": "integer",
+ "description": "Sub ID of the asset being transferred"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateTransferErc20ResponseSchema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["status", "transaction_id"],
+ "properties": {
+ "status": {
+ "title": "status",
+ "type": "string",
+ "description": "`requested`"
+ },
+ "transaction_id": {
+ "title": "transaction_id",
+ "type": "string",
+ "format": "uuid",
+ "description": "Transaction id of the transfer"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateTransferErc20ResultSchema": {
+ "required": ["status", "transaction_id"],
+ "properties": {
+ "status": {
+ "title": "status",
+ "type": "string",
+ "description": "`requested`"
+ },
+ "transaction_id": {
+ "title": "transaction_id",
+ "type": "string",
+ "format": "uuid",
+ "description": "Transaction id of the transfer"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PublicRegisterSessionKeyParamsSchema": {
+ "required": ["expiry_sec", "label", "public_session_key", "signed_raw_tx", "wallet"],
+ "properties": {
+ "expiry_sec": {
+ "title": "expiry_sec",
+ "type": "integer",
+ "description": "Expiry of the session key"
+ },
+ "label": {
+ "title": "label",
+ "type": "string",
+ "description": "Ethereum wallet address"
+ },
+ "public_session_key": {
+ "title": "public_session_key",
+ "type": "string",
+ "description": "Session key in the form of an Ethereum EOA"
+ },
+ "signed_raw_tx": {
+ "title": "signed_raw_tx",
+ "type": "string",
+ "description": "A signed RLP encoded ETH transaction in form of a hex string (same as `w3.eth.account.sign_transaction(unsigned_tx, private_key).rawTransaction.hex()`)"
+ },
+ "wallet": {
+ "title": "wallet",
+ "type": "string",
+ "description": "Ethereum wallet address of account"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PublicRegisterSessionKeyResponseSchema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["label", "public_session_key", "transaction_id"],
+ "properties": {
+ "label": {
+ "title": "label",
+ "type": "string",
+ "description": "User-defined session key label"
+ },
+ "public_session_key": {
+ "title": "public_session_key",
+ "type": "string",
+ "description": "Session key in the form of an Ethereum EOA"
+ },
+ "transaction_id": {
+ "title": "transaction_id",
+ "type": "string",
+ "format": "uuid",
+ "description": "ID to lookup status of transaction"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PublicRegisterSessionKeyResultSchema": {
+ "required": ["label", "public_session_key", "transaction_id"],
+ "properties": {
+ "label": {
+ "title": "label",
+ "type": "string",
+ "description": "User-defined session key label"
+ },
+ "public_session_key": {
+ "title": "public_session_key",
+ "type": "string",
+ "description": "Session key in the form of an Ethereum EOA"
+ },
+ "transaction_id": {
+ "title": "transaction_id",
+ "type": "string",
+ "format": "uuid",
+ "description": "ID to lookup status of transaction"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateGetCollateralsParamsSchema": {
+ "required": ["subaccount_id"],
+ "properties": {
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateGetCollateralsResponseSchema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["collaterals", "subaccount_id"],
+ "properties": {
+ "collaterals": {
+ "title": "collaterals",
+ "type": "array",
+ "description": "All collaterals that count towards margin of subaccount",
+ "items": {
+ "required": [
+ "amount",
+ "asset_name",
+ "asset_type",
+ "cumulative_interest",
+ "currency",
+ "initial_margin",
+ "maintenance_margin",
+ "mark_price",
+ "mark_value",
+ "pending_interest"
+ ],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Asset amount of given collateral"
+ },
+ "asset_name": {
+ "title": "asset_name",
+ "type": "string",
+ "description": "Asset name"
+ },
+ "asset_type": {
+ "title": "asset_type",
+ "type": "string",
+ "enum": ["erc20", "option", "perp"],
+ "description": "Type of asset collateral (currently always `erc20`)"
+ },
+ "cumulative_interest": {
+ "title": "cumulative_interest",
+ "type": "string",
+ "format": "decimal",
+ "description": "Cumulative interest earned on supplying collateral or paid for borrowing"
+ },
+ "currency": {
+ "title": "currency",
+ "type": "string",
+ "description": "Underlying currency of asset (`ETH`, `BTC`, etc)"
+ },
+ "initial_margin": {
+ "title": "initial_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "USD value of collateral that contributes to initial margin"
+ },
+ "maintenance_margin": {
+ "title": "maintenance_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "USD value of collateral that contributes to maintenance margin"
+ },
+ "mark_price": {
+ "title": "mark_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Current mark price of the asset"
+ },
+ "mark_value": {
+ "title": "mark_value",
+ "type": "string",
+ "format": "decimal",
+ "description": "USD value of the collateral (amount * mark price)"
+ },
+ "pending_interest": {
+ "title": "pending_interest",
+ "type": "string",
+ "format": "decimal",
+ "description": "Portion of interest that has not yet been settled on-chain. This number is added to the portfolio value for margin calculations purposes."
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateGetCollateralsResultSchema": {
+ "required": ["collaterals", "subaccount_id"],
+ "properties": {
+ "collaterals": {
+ "title": "collaterals",
+ "type": "array",
+ "description": "All collaterals that count towards margin of subaccount",
+ "items": {
+ "required": [
+ "amount",
+ "asset_name",
+ "asset_type",
+ "cumulative_interest",
+ "currency",
+ "initial_margin",
+ "maintenance_margin",
+ "mark_price",
+ "mark_value",
+ "pending_interest"
+ ],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Asset amount of given collateral"
+ },
+ "asset_name": {
+ "title": "asset_name",
+ "type": "string",
+ "description": "Asset name"
+ },
+ "asset_type": {
+ "title": "asset_type",
+ "type": "string",
+ "enum": ["erc20", "option", "perp"],
+ "description": "Type of asset collateral (currently always `erc20`)"
+ },
+ "cumulative_interest": {
+ "title": "cumulative_interest",
+ "type": "string",
+ "format": "decimal",
+ "description": "Cumulative interest earned on supplying collateral or paid for borrowing"
+ },
+ "currency": {
+ "title": "currency",
+ "type": "string",
+ "description": "Underlying currency of asset (`ETH`, `BTC`, etc)"
+ },
+ "initial_margin": {
+ "title": "initial_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "USD value of collateral that contributes to initial margin"
+ },
+ "maintenance_margin": {
+ "title": "maintenance_margin",
+ "type": "string",
+ "format": "decimal",
+ "description": "USD value of collateral that contributes to maintenance margin"
+ },
+ "mark_price": {
+ "title": "mark_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Current mark price of the asset"
+ },
+ "mark_value": {
+ "title": "mark_value",
+ "type": "string",
+ "format": "decimal",
+ "description": "USD value of the collateral (amount * mark price)"
+ },
+ "pending_interest": {
+ "title": "pending_interest",
+ "type": "string",
+ "format": "decimal",
+ "description": "Portion of interest that has not yet been settled on-chain. This number is added to the portfolio value for margin calculations purposes."
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PublicGetSpotFeedHistoryParamsSchema": {
+ "required": ["currency", "end_timestamp", "period", "start_timestamp"],
+ "properties": {
+ "currency": {
+ "title": "currency",
+ "type": "string",
+ "description": "Currency"
+ },
+ "end_timestamp": {
+ "title": "end_timestamp",
+ "type": "integer",
+ "description": "End timestamp"
+ },
+ "period": {
+ "title": "period",
+ "type": "integer",
+ "description": "Period"
+ },
+ "start_timestamp": {
+ "title": "start_timestamp",
+ "type": "integer",
+ "description": "Start timestamp"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PublicGetSpotFeedHistoryResponseSchema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["currency", "spot_feed_history"],
+ "properties": {
+ "currency": {
+ "title": "currency",
+ "type": "string",
+ "description": "Currency"
+ },
+ "spot_feed_history": {
+ "title": "spot_feed_history",
+ "type": "array",
+ "description": "Spot feed history",
+ "items": {
+ "required": ["confidence", "price", "timestamp", "timestamp_bucket"],
+ "properties": {
+ "confidence": {
+ "title": "confidence",
+ "type": "string",
+ "format": "decimal",
+ "description": "Confidence score of the spot price"
+ },
+ "price": {
+ "title": "price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Spot price"
+ },
+ "timestamp": {
+ "title": "timestamp",
+ "type": "integer",
+ "description": "Timestamp of when the spot price was recored into the database"
+ },
+ "timestamp_bucket": {
+ "title": "timestamp_bucket",
+ "type": "integer",
+ "description": "Timestamp bucket; this value is regularly spaced out with `period` seconds between data points, missing values are forward-filled from earlier data where possible, if no earlier data is available, values are back-filled from the first observed data point"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PublicGetSpotFeedHistoryResultSchema": {
+ "required": ["currency", "spot_feed_history"],
+ "properties": {
+ "currency": {
+ "title": "currency",
+ "type": "string",
+ "description": "Currency"
+ },
+ "spot_feed_history": {
+ "title": "spot_feed_history",
+ "type": "array",
+ "description": "Spot feed history",
+ "items": {
+ "required": ["confidence", "price", "timestamp", "timestamp_bucket"],
+ "properties": {
+ "confidence": {
+ "title": "confidence",
+ "type": "string",
+ "format": "decimal",
+ "description": "Confidence score of the spot price"
+ },
+ "price": {
+ "title": "price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Spot price"
+ },
+ "timestamp": {
+ "title": "timestamp",
+ "type": "integer",
+ "description": "Timestamp of when the spot price was recored into the database"
+ },
+ "timestamp_bucket": {
+ "title": "timestamp_bucket",
+ "type": "integer",
+ "description": "Timestamp bucket; this value is regularly spaced out with `period` seconds between data points, missing values are forward-filled from earlier data where possible, if no earlier data is available, values are back-filled from the first observed data point"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "SpotFeedHistoryResponseSchema": {
+ "required": ["confidence", "price", "timestamp", "timestamp_bucket"],
+ "properties": {
+ "confidence": {
+ "title": "confidence",
+ "type": "string",
+ "format": "decimal",
+ "description": "Confidence score of the spot price"
+ },
+ "price": {
+ "title": "price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Spot price"
+ },
+ "timestamp": {
+ "title": "timestamp",
+ "type": "integer",
+ "description": "Timestamp of when the spot price was recored into the database"
+ },
+ "timestamp_bucket": {
+ "title": "timestamp_bucket",
+ "type": "integer",
+ "description": "Timestamp bucket; this value is regularly spaced out with `period` seconds between data points, missing values are forward-filled from earlier data where possible, if no earlier data is available, values are back-filled from the first observed data point"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateCancelByLabelParamsSchema": {
+ "required": ["label", "subaccount_id"],
+ "properties": {
+ "label": {
+ "title": "label",
+ "type": "string",
+ "description": "Cancel all orders for this label"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount ID"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateCancelByLabelResponseSchema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["cancelled_orders"],
+ "properties": {
+ "cancelled_orders": {
+ "title": "cancelled_orders",
+ "type": "integer",
+ "description": "Number of cancelled orders"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateCancelByLabelResultSchema": {
+ "required": ["cancelled_orders"],
+ "properties": {
+ "cancelled_orders": {
+ "title": "cancelled_orders",
+ "type": "integer",
+ "description": "Number of cancelled orders"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PublicBuildRegisterSessionKeyTxParamsSchema": {
+ "required": ["expiry_sec", "gas", "nonce", "public_session_key", "wallet"],
+ "properties": {
+ "expiry_sec": {
+ "title": "expiry_sec",
+ "type": "integer",
+ "description": "Expiry of the session key"
+ },
+ "gas": {
+ "title": "gas",
+ "type": "integer",
+ "default": null,
+ "description": "Gas allowance for transaction. If none, will use estimateGas * 150%",
+ "nullable": true
+ },
+ "nonce": {
+ "title": "nonce",
+ "type": "integer",
+ "default": null,
+ "description": "Wallet's transaction count, If none, will use eth.getTransactionCount()",
+ "nullable": true
+ },
+ "public_session_key": {
+ "title": "public_session_key",
+ "type": "string",
+ "description": "Session key in the form of an Ethereum EOA"
+ },
+ "wallet": {
+ "title": "wallet",
+ "type": "string",
+ "description": "Ethereum wallet address of account"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PublicBuildRegisterSessionKeyTxResponseSchema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["tx_params"],
+ "properties": {
+ "tx_params": {
+ "title": "tx_params",
+ "type": "object",
+ "description": "Transaction params in dictionary form, same as `TxParams` in `web3.py`",
+ "additionalProperties": {}
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PublicBuildRegisterSessionKeyTxResultSchema": {
+ "required": ["tx_params"],
+ "properties": {
+ "tx_params": {
+ "title": "tx_params",
+ "type": "object",
+ "description": "Transaction params in dictionary form, same as `TxParams` in `web3.py`",
+ "additionalProperties": {}
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PublicGetInstrumentsParamsSchema": {
+ "required": ["currency", "expired", "instrument_type"],
+ "properties": {
+ "currency": {
+ "title": "currency",
+ "type": "string",
+ "description": "Underlying currency of asset (`ETH`, `BTC`, etc)"
+ },
+ "expired": {
+ "title": "expired",
+ "type": "boolean",
+ "description": "If `True`: include expired assets"
+ },
+ "instrument_type": {
+ "title": "instrument_type",
+ "type": "string",
+ "enum": ["erc20", "option", "perp"],
+ "description": "`erc20`, `option`, or `perp`"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PublicGetInstrumentsResponseSchema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "title": "result",
+ "type": "array",
+ "description": "",
+ "items": {
+ "required": [
+ "amount_step",
+ "base_asset_address",
+ "base_asset_sub_id",
+ "base_currency",
+ "base_fee",
+ "instrument_name",
+ "instrument_type",
+ "is_active",
+ "maker_fee_rate",
+ "maximum_amount",
+ "minimum_amount",
+ "option_details",
+ "perp_details",
+ "quote_currency",
+ "scheduled_activation",
+ "scheduled_deactivation",
+ "taker_fee_rate",
+ "tick_size"
+ ],
+ "properties": {
+ "amount_step": {
+ "title": "amount_step",
+ "type": "string",
+ "format": "decimal",
+ "description": "Minimum valid increment of order amount"
+ },
+ "base_asset_address": {
+ "title": "base_asset_address",
+ "type": "string",
+ "description": "Blockchain address of the base asset"
+ },
+ "base_asset_sub_id": {
+ "title": "base_asset_sub_id",
+ "type": "string",
+ "description": "Sub ID of the specific base asset as defined in Asset.sol"
+ },
+ "base_currency": {
+ "title": "base_currency",
+ "type": "string",
+ "description": "Underlying currency of base asset (`ETH`, `BTC`, etc)"
+ },
+ "base_fee": {
+ "title": "base_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "$ base fee added to every taker order"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ },
+ "instrument_type": {
+ "title": "instrument_type",
+ "type": "string",
+ "enum": ["erc20", "option", "perp"],
+ "description": "`erc20`, `option`, or `perp`"
+ },
+ "is_active": {
+ "title": "is_active",
+ "type": "boolean",
+ "description": "If `True`: instrument is tradeable within `activation` and `deactivation` timestamps"
+ },
+ "maker_fee_rate": {
+ "title": "maker_fee_rate",
+ "type": "string",
+ "format": "decimal",
+ "description": "Percent of spot price fee rate for makers"
+ },
+ "mark_price_fee_rate_cap": {
+ "title": "mark_price_fee_rate_cap",
+ "type": "string",
+ "format": "decimal",
+ "default": null,
+ "description": "Percent of option price fee cap, e.g. 12.5%, null if not applicable",
+ "nullable": true
+ },
+ "maximum_amount": {
+ "title": "maximum_amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Maximum valid amount of contracts / tokens per trade"
+ },
+ "minimum_amount": {
+ "title": "minimum_amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Minimum valid amount of contracts / tokens per trade"
+ },
+ "option_details": {
+ "required": ["expiry", "index", "option_type", "strike"],
+ "properties": {
+ "expiry": {
+ "title": "expiry",
+ "type": "integer",
+ "description": "Unix timestamp of expiry date (in seconds)"
+ },
+ "index": {
+ "title": "index",
+ "type": "string",
+ "description": "Underlying settlement price index"
+ },
+ "option_type": {
+ "title": "option_type",
+ "type": "string",
+ "enum": ["C", "P"]
+ },
+ "settlement_price": {
+ "title": "settlement_price",
+ "type": "string",
+ "format": "decimal",
+ "default": null,
+ "description": "Settlement price of the option",
+ "nullable": true
+ },
+ "strike": {
+ "title": "strike",
+ "type": "string",
+ "format": "decimal"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "perp_details": {
+ "required": [
+ "aggregate_funding",
+ "funding_rate",
+ "index",
+ "max_rate_per_hour",
+ "min_rate_per_hour",
+ "static_interest_rate"
+ ],
+ "properties": {
+ "aggregate_funding": {
+ "title": "aggregate_funding",
+ "type": "string",
+ "format": "decimal",
+ "description": "Latest aggregated funding as per `PerpAsset.sol`"
+ },
+ "funding_rate": {
+ "title": "funding_rate",
+ "type": "string",
+ "format": "decimal",
+ "description": "Current hourly funding rate as per `PerpAsset.sol`"
+ },
+ "index": {
+ "title": "index",
+ "type": "string",
+ "description": "Underlying spot price index for funding rate"
+ },
+ "max_rate_per_hour": {
+ "title": "max_rate_per_hour",
+ "type": "string",
+ "format": "decimal",
+ "description": "Max rate per hour as per `PerpAsset.sol`"
+ },
+ "min_rate_per_hour": {
+ "title": "min_rate_per_hour",
+ "type": "string",
+ "format": "decimal",
+ "description": "Min rate per hour as per `PerpAsset.sol`"
+ },
+ "static_interest_rate": {
+ "title": "static_interest_rate",
+ "type": "string",
+ "format": "decimal",
+ "description": "Static interest rate as per `PerpAsset.sol`"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "quote_currency": {
+ "title": "quote_currency",
+ "type": "string",
+ "description": "Quote currency (`USD` for perps, `USDC` for options)"
+ },
+ "scheduled_activation": {
+ "title": "scheduled_activation",
+ "type": "integer",
+ "description": "Timestamp at which became or will become active (if applicable)"
+ },
+ "scheduled_deactivation": {
+ "title": "scheduled_deactivation",
+ "type": "integer",
+ "description": "Scheduled deactivation time for instrument (if applicable)"
+ },
+ "taker_fee_rate": {
+ "title": "taker_fee_rate",
+ "type": "string",
+ "format": "decimal",
+ "description": "Percent of spot price fee rate for takers"
+ },
+ "tick_size": {
+ "title": "tick_size",
+ "type": "string",
+ "format": "decimal",
+ "description": "Tick size of the instrument, i.e. minimum price increment"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "InstrumentPublicResponseSchema": {
+ "required": [
+ "amount_step",
+ "base_asset_address",
+ "base_asset_sub_id",
+ "base_currency",
+ "base_fee",
+ "instrument_name",
+ "instrument_type",
+ "is_active",
+ "maker_fee_rate",
+ "maximum_amount",
+ "minimum_amount",
+ "option_details",
+ "perp_details",
+ "quote_currency",
+ "scheduled_activation",
+ "scheduled_deactivation",
+ "taker_fee_rate",
+ "tick_size"
+ ],
+ "properties": {
+ "amount_step": {
+ "title": "amount_step",
+ "type": "string",
+ "format": "decimal",
+ "description": "Minimum valid increment of order amount"
+ },
+ "base_asset_address": {
+ "title": "base_asset_address",
+ "type": "string",
+ "description": "Blockchain address of the base asset"
+ },
+ "base_asset_sub_id": {
+ "title": "base_asset_sub_id",
+ "type": "string",
+ "description": "Sub ID of the specific base asset as defined in Asset.sol"
+ },
+ "base_currency": {
+ "title": "base_currency",
+ "type": "string",
+ "description": "Underlying currency of base asset (`ETH`, `BTC`, etc)"
+ },
+ "base_fee": {
+ "title": "base_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "$ base fee added to every taker order"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ },
+ "instrument_type": {
+ "title": "instrument_type",
+ "type": "string",
+ "enum": ["erc20", "option", "perp"],
+ "description": "`erc20`, `option`, or `perp`"
+ },
+ "is_active": {
+ "title": "is_active",
+ "type": "boolean",
+ "description": "If `True`: instrument is tradeable within `activation` and `deactivation` timestamps"
+ },
+ "maker_fee_rate": {
+ "title": "maker_fee_rate",
+ "type": "string",
+ "format": "decimal",
+ "description": "Percent of spot price fee rate for makers"
+ },
+ "mark_price_fee_rate_cap": {
+ "title": "mark_price_fee_rate_cap",
+ "type": "string",
+ "format": "decimal",
+ "default": null,
+ "description": "Percent of option price fee cap, e.g. 12.5%, null if not applicable",
+ "nullable": true
+ },
+ "maximum_amount": {
+ "title": "maximum_amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Maximum valid amount of contracts / tokens per trade"
+ },
+ "minimum_amount": {
+ "title": "minimum_amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Minimum valid amount of contracts / tokens per trade"
+ },
+ "option_details": {
+ "required": ["expiry", "index", "option_type", "strike"],
+ "properties": {
+ "expiry": {
+ "title": "expiry",
+ "type": "integer",
+ "description": "Unix timestamp of expiry date (in seconds)"
+ },
+ "index": {
+ "title": "index",
+ "type": "string",
+ "description": "Underlying settlement price index"
+ },
+ "option_type": {
+ "title": "option_type",
+ "type": "string",
+ "enum": ["C", "P"]
+ },
+ "settlement_price": {
+ "title": "settlement_price",
+ "type": "string",
+ "format": "decimal",
+ "default": null,
+ "description": "Settlement price of the option",
+ "nullable": true
+ },
+ "strike": {
+ "title": "strike",
+ "type": "string",
+ "format": "decimal"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "perp_details": {
+ "required": [
+ "aggregate_funding",
+ "funding_rate",
+ "index",
+ "max_rate_per_hour",
+ "min_rate_per_hour",
+ "static_interest_rate"
+ ],
+ "properties": {
+ "aggregate_funding": {
+ "title": "aggregate_funding",
+ "type": "string",
+ "format": "decimal",
+ "description": "Latest aggregated funding as per `PerpAsset.sol`"
+ },
+ "funding_rate": {
+ "title": "funding_rate",
+ "type": "string",
+ "format": "decimal",
+ "description": "Current hourly funding rate as per `PerpAsset.sol`"
+ },
+ "index": {
+ "title": "index",
+ "type": "string",
+ "description": "Underlying spot price index for funding rate"
+ },
+ "max_rate_per_hour": {
+ "title": "max_rate_per_hour",
+ "type": "string",
+ "format": "decimal",
+ "description": "Max rate per hour as per `PerpAsset.sol`"
+ },
+ "min_rate_per_hour": {
+ "title": "min_rate_per_hour",
+ "type": "string",
+ "format": "decimal",
+ "description": "Min rate per hour as per `PerpAsset.sol`"
+ },
+ "static_interest_rate": {
+ "title": "static_interest_rate",
+ "type": "string",
+ "format": "decimal",
+ "description": "Static interest rate as per `PerpAsset.sol`"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "quote_currency": {
+ "title": "quote_currency",
+ "type": "string",
+ "description": "Quote currency (`USD` for perps, `USDC` for options)"
+ },
+ "scheduled_activation": {
+ "title": "scheduled_activation",
+ "type": "integer",
+ "description": "Timestamp at which became or will become active (if applicable)"
+ },
+ "scheduled_deactivation": {
+ "title": "scheduled_deactivation",
+ "type": "integer",
+ "description": "Scheduled deactivation time for instrument (if applicable)"
+ },
+ "taker_fee_rate": {
+ "title": "taker_fee_rate",
+ "type": "string",
+ "format": "decimal",
+ "description": "Percent of spot price fee rate for takers"
+ },
+ "tick_size": {
+ "title": "tick_size",
+ "type": "string",
+ "format": "decimal",
+ "description": "Tick size of the instrument, i.e. minimum price increment"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PublicCreateAccountParamsSchema": {
+ "required": ["wallet"],
+ "properties": {
+ "wallet": {
+ "title": "wallet",
+ "type": "string",
+ "description": "Ethereum wallet address"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PublicCreateAccountResponseSchema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["status", "wallet"],
+ "properties": {
+ "status": {
+ "title": "status",
+ "type": "string",
+ "description": "`created` or `exists`"
+ },
+ "wallet": {
+ "title": "wallet",
+ "type": "string",
+ "description": "Ethereum wallet address"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PublicCreateAccountResultSchema": {
+ "required": ["status", "wallet"],
+ "properties": {
+ "status": {
+ "title": "status",
+ "type": "string",
+ "description": "`created` or `exists`"
+ },
+ "wallet": {
+ "title": "wallet",
+ "type": "string",
+ "description": "Ethereum wallet address"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PublicLoginParamsSchema": {
+ "required": ["signature", "timestamp", "wallet"],
+ "properties": {
+ "signature": {
+ "title": "signature",
+ "type": "string",
+ "description": "Signature of the timestamp, signed with the wallet's private key or a session key"
+ },
+ "timestamp": {
+ "title": "timestamp",
+ "type": "string",
+ "description": "Message that was signed, in the form of a timestamp in ms since Unix epoch"
+ },
+ "wallet": {
+ "title": "wallet",
+ "type": "string",
+ "description": "Public key (wallet) of the account"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PublicLoginResponseSchema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "title": "result",
+ "type": "array",
+ "description": "List of subaccount IDs that have been authenticated",
+ "items": {
+ "title": "result",
+ "type": "integer"
+ }
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PublicCreateSubaccountDebugParamsSchema": {
+ "required": ["amount", "asset_name", "margin_type", "nonce", "signature_expiry_sec", "signer", "wallet"],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Amount of the asset to deposit"
+ },
+ "asset_name": {
+ "title": "asset_name",
+ "type": "string",
+ "description": "Name of asset to deposit"
+ },
+ "currency": {
+ "title": "currency",
+ "type": "string",
+ "default": null,
+ "description": "Base currency of the subaccount (only for `PM`)",
+ "nullable": true
+ },
+ "margin_type": {
+ "title": "margin_type",
+ "type": "string",
+ "enum": ["PM", "SM"],
+ "description": "`PM` (Portfolio Margin) or `SM` (Standard Margin)"
+ },
+ "nonce": {
+ "title": "nonce",
+ "type": "integer",
+ "description": "Unique nonce defined as (e.g. 1695836058725001, where 001 is the random number)"
+ },
+ "signature_expiry_sec": {
+ "title": "signature_expiry_sec",
+ "type": "integer",
+ "description": "Unix timestamp in seconds. Expiry MUST be >5min from now"
+ },
+ "signer": {
+ "title": "signer",
+ "type": "string",
+ "description": "Ethereum wallet address that is signing the deposit"
+ },
+ "wallet": {
+ "title": "wallet",
+ "type": "string",
+ "description": "Ethereum wallet address"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PublicCreateSubaccountDebugResponseSchema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["action_hash", "encoded_data", "encoded_data_hashed", "typed_data_hash"],
+ "properties": {
+ "action_hash": {
+ "title": "action_hash",
+ "type": "string",
+ "description": "Keccak hashed action data"
+ },
+ "encoded_data": {
+ "title": "encoded_data",
+ "type": "string",
+ "description": "ABI encoded deposit data"
+ },
+ "encoded_data_hashed": {
+ "title": "encoded_data_hashed",
+ "type": "string",
+ "description": "Keccak hashed encoded_data"
+ },
+ "typed_data_hash": {
+ "title": "typed_data_hash",
+ "type": "string",
+ "description": "EIP 712 typed data hash"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PublicCreateSubaccountDebugResultSchema": {
+ "required": ["action_hash", "encoded_data", "encoded_data_hashed", "typed_data_hash"],
+ "properties": {
+ "action_hash": {
+ "title": "action_hash",
+ "type": "string",
+ "description": "Keccak hashed action data"
+ },
+ "encoded_data": {
+ "title": "encoded_data",
+ "type": "string",
+ "description": "ABI encoded deposit data"
+ },
+ "encoded_data_hashed": {
+ "title": "encoded_data_hashed",
+ "type": "string",
+ "description": "Keccak hashed encoded_data"
+ },
+ "typed_data_hash": {
+ "title": "typed_data_hash",
+ "type": "string",
+ "description": "EIP 712 typed data hash"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateCancelByNonceParamsSchema": {
+ "required": ["nonce", "subaccount_id"],
+ "properties": {
+ "nonce": {
+ "title": "nonce",
+ "type": "integer",
+ "description": "Cancel an order with this nonce"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount ID"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateCancelByNonceResponseSchema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["cancelled_orders"],
+ "properties": {
+ "cancelled_orders": {
+ "title": "cancelled_orders",
+ "type": "integer",
+ "description": "Number of cancelled orders"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateCancelByNonceResultSchema": {
+ "required": ["cancelled_orders"],
+ "properties": {
+ "cancelled_orders": {
+ "title": "cancelled_orders",
+ "type": "integer",
+ "description": "Number of cancelled orders"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateGetDepositHistoryParamsSchema": {
+ "required": ["subaccount_id"],
+ "properties": {
+ "end_timestamp": {
+ "title": "end_timestamp",
+ "type": "integer",
+ "default": 9223372036854776000,
+ "description": "End timestamp of the event history (default current time)"
+ },
+ "start_timestamp": {
+ "title": "start_timestamp",
+ "type": "integer",
+ "default": 0,
+ "description": "Start timestamp of the event history (default 0)"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount id"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateGetDepositHistoryResponseSchema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["events"],
+ "properties": {
+ "events": {
+ "title": "events",
+ "type": "array",
+ "description": "List of deposit payments",
+ "items": {
+ "required": ["amount", "asset", "timestamp", "tx_hash"],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Amount deposited by the subaccount"
+ },
+ "asset": {
+ "title": "asset",
+ "type": "string",
+ "description": "Asset deposited"
+ },
+ "timestamp": {
+ "title": "timestamp",
+ "type": "integer",
+ "description": "Timestamp of the deposit (in ms since UNIX epoch)"
+ },
+ "tx_hash": {
+ "title": "tx_hash",
+ "type": "string",
+ "description": "Hash of the transaction that deposited the funds"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateGetDepositHistoryResultSchema": {
+ "required": ["events"],
+ "properties": {
+ "events": {
+ "title": "events",
+ "type": "array",
+ "description": "List of deposit payments",
+ "items": {
+ "required": ["amount", "asset", "timestamp", "tx_hash"],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Amount deposited by the subaccount"
+ },
+ "asset": {
+ "title": "asset",
+ "type": "string",
+ "description": "Asset deposited"
+ },
+ "timestamp": {
+ "title": "timestamp",
+ "type": "integer",
+ "description": "Timestamp of the deposit (in ms since UNIX epoch)"
+ },
+ "tx_hash": {
+ "title": "tx_hash",
+ "type": "string",
+ "description": "Hash of the transaction that deposited the funds"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "DepositSchema": {
+ "required": ["amount", "asset", "timestamp", "tx_hash"],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Amount deposited by the subaccount"
+ },
+ "asset": {
+ "title": "asset",
+ "type": "string",
+ "description": "Asset deposited"
+ },
+ "timestamp": {
+ "title": "timestamp",
+ "type": "integer",
+ "description": "Timestamp of the deposit (in ms since UNIX epoch)"
+ },
+ "tx_hash": {
+ "title": "tx_hash",
+ "type": "string",
+ "description": "Hash of the transaction that deposited the funds"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateGetSubaccountsParamsSchema": {
+ "required": ["wallet"],
+ "properties": {
+ "wallet": {
+ "title": "wallet",
+ "type": "string",
+ "description": "Ethereum wallet address of account"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateGetSubaccountsResponseSchema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["subaccount_ids", "wallet"],
+ "properties": {
+ "subaccount_ids": {
+ "title": "subaccount_ids",
+ "type": "array",
+ "description": "List of subaccount_ids owned by the wallet in `SubAccounts.sol`",
+ "items": {
+ "title": "subaccount_ids",
+ "type": "integer"
+ }
+ },
+ "wallet": {
+ "title": "wallet",
+ "type": "string",
+ "description": "Ethereum wallet address"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateGetSubaccountsResultSchema": {
+ "required": ["subaccount_ids", "wallet"],
+ "properties": {
+ "subaccount_ids": {
+ "title": "subaccount_ids",
+ "type": "array",
+ "description": "List of subaccount_ids owned by the wallet in `SubAccounts.sol`",
+ "items": {
+ "title": "subaccount_ids",
+ "type": "integer"
+ }
+ },
+ "wallet": {
+ "title": "wallet",
+ "type": "string",
+ "description": "Ethereum wallet address"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateSessionKeysParamsSchema": {
+ "required": ["wallet"],
+ "properties": {
+ "wallet": {
+ "title": "wallet",
+ "type": "string",
+ "description": "Ethereum wallet address of account"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateSessionKeysResponseSchema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["public_session_keys"],
+ "properties": {
+ "public_session_keys": {
+ "title": "public_session_keys",
+ "type": "array",
+ "description": "List of session keys (includes unactivated and expired keys)",
+ "items": {
+ "required": ["expiry_sec", "public_session_key"],
+ "properties": {
+ "expiry_sec": {
+ "title": "expiry_sec",
+ "type": "integer",
+ "description": "Session key expiry timestamp in sec"
+ },
+ "label": {
+ "title": "label",
+ "type": "string",
+ "default": "",
+ "description": "User-defined session key label"
+ },
+ "public_session_key": {
+ "title": "public_session_key",
+ "type": "string",
+ "description": "Public session key address (Ethereum EOA)"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateSessionKeysResultSchema": {
+ "required": ["public_session_keys"],
+ "properties": {
+ "public_session_keys": {
+ "title": "public_session_keys",
+ "type": "array",
+ "description": "List of session keys (includes unactivated and expired keys)",
+ "items": {
+ "required": ["expiry_sec", "public_session_key"],
+ "properties": {
+ "expiry_sec": {
+ "title": "expiry_sec",
+ "type": "integer",
+ "description": "Session key expiry timestamp in sec"
+ },
+ "label": {
+ "title": "label",
+ "type": "string",
+ "default": "",
+ "description": "User-defined session key label"
+ },
+ "public_session_key": {
+ "title": "public_session_key",
+ "type": "string",
+ "description": "Public session key address (Ethereum EOA)"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "SessionKeyResponseSchema": {
+ "required": ["expiry_sec", "public_session_key"],
+ "properties": {
+ "expiry_sec": {
+ "title": "expiry_sec",
+ "type": "integer",
+ "description": "Session key expiry timestamp in sec"
+ },
+ "label": {
+ "title": "label",
+ "type": "string",
+ "default": "",
+ "description": "User-defined session key label"
+ },
+ "public_session_key": {
+ "title": "public_session_key",
+ "type": "string",
+ "description": "Public session key address (Ethereum EOA)"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateChangeSessionKeyLabelParamsSchema": {
+ "required": ["label"],
+ "properties": {
+ "label": {
+ "title": "label",
+ "type": "string"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateChangeSessionKeyLabelResponseSchema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["label"],
+ "properties": {
+ "label": {
+ "title": "label",
+ "type": "string"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateChangeSessionKeyLabelResultSchema": {
+ "required": ["label"],
+ "properties": {
+ "label": {
+ "title": "label",
+ "type": "string"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateGetAccountParamsSchema": {
+ "required": ["wallet"],
+ "properties": {
+ "wallet": {
+ "title": "wallet",
+ "type": "string",
+ "description": "Ethereum wallet address of account"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateGetAccountResponseSchema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": [
+ "cancel_on_disconnect",
+ "subaccount_ids",
+ "wallet",
+ "websocket_matching_tps",
+ "websocket_non_matching_tps"
+ ],
+ "properties": {
+ "cancel_on_disconnect": {
+ "title": "cancel_on_disconnect",
+ "type": "boolean",
+ "description": "Whether cancel on disconnect is enabled for the account"
+ },
+ "subaccount_ids": {
+ "title": "subaccount_ids",
+ "type": "array",
+ "description": "List of subaccount_ids owned by the wallet in `SubAccounts.sol`",
+ "items": {
+ "title": "subaccount_ids",
+ "type": "integer"
+ }
+ },
+ "wallet": {
+ "title": "wallet",
+ "type": "string",
+ "description": "Ethereum wallet address"
+ },
+ "websocket_matching_tps": {
+ "title": "websocket_matching_tps",
+ "type": "integer",
+ "description": "Max transactions per second for matching requests over websocket (see `Rate Limiting` in docs)"
+ },
+ "websocket_non_matching_tps": {
+ "title": "websocket_non_matching_tps",
+ "type": "integer",
+ "description": "Max transactions per second for non-matching requests over websocket (see `Rate Limiting` in docs)"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateGetAccountResultSchema": {
+ "required": [
+ "cancel_on_disconnect",
+ "subaccount_ids",
+ "wallet",
+ "websocket_matching_tps",
+ "websocket_non_matching_tps"
+ ],
+ "properties": {
+ "cancel_on_disconnect": {
+ "title": "cancel_on_disconnect",
+ "type": "boolean",
+ "description": "Whether cancel on disconnect is enabled for the account"
+ },
+ "subaccount_ids": {
+ "title": "subaccount_ids",
+ "type": "array",
+ "description": "List of subaccount_ids owned by the wallet in `SubAccounts.sol`",
+ "items": {
+ "title": "subaccount_ids",
+ "type": "integer"
+ }
+ },
+ "wallet": {
+ "title": "wallet",
+ "type": "string",
+ "description": "Ethereum wallet address"
+ },
+ "websocket_matching_tps": {
+ "title": "websocket_matching_tps",
+ "type": "integer",
+ "description": "Max transactions per second for matching requests over websocket (see `Rate Limiting` in docs)"
+ },
+ "websocket_non_matching_tps": {
+ "title": "websocket_non_matching_tps",
+ "type": "integer",
+ "description": "Max transactions per second for non-matching requests over websocket (see `Rate Limiting` in docs)"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateGetOptionSettlementHistoryParamsSchema": {
+ "required": ["subaccount_id"],
+ "properties": {
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id for which to get expired option settlement history"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateGetOptionSettlementHistoryResponseSchema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["settlements", "subaccount_id"],
+ "properties": {
+ "settlements": {
+ "title": "settlements",
+ "type": "array",
+ "description": "List of expired option settlements",
+ "items": {
+ "required": ["amount", "expiry", "instrument_name", "option_settlement_pnl", "settlement_price"],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Amount that was settled"
+ },
+ "expiry": {
+ "title": "expiry",
+ "type": "integer",
+ "description": "Expiry timestamp of the option"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ },
+ "option_settlement_pnl": {
+ "title": "option_settlement_pnl",
+ "type": "string",
+ "format": "decimal",
+ "description": "USD profit or loss from option settlements calculated as: settlement value - (average price x amount)"
+ },
+ "settlement_price": {
+ "title": "settlement_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Price of option settlement"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id for which to get expired option settlement history"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PrivateGetOptionSettlementHistoryResultSchema": {
+ "required": ["settlements", "subaccount_id"],
+ "properties": {
+ "settlements": {
+ "title": "settlements",
+ "type": "array",
+ "description": "List of expired option settlements",
+ "items": {
+ "required": ["amount", "expiry", "instrument_name", "option_settlement_pnl", "settlement_price"],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Amount that was settled"
+ },
+ "expiry": {
+ "title": "expiry",
+ "type": "integer",
+ "description": "Expiry timestamp of the option"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ },
+ "option_settlement_pnl": {
+ "title": "option_settlement_pnl",
+ "type": "string",
+ "format": "decimal",
+ "description": "USD profit or loss from option settlements calculated as: settlement value - (average price x amount)"
+ },
+ "settlement_price": {
+ "title": "settlement_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Price of option settlement"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount_id for which to get expired option settlement history"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "OptionSettlementResponseSchema": {
+ "required": ["amount", "expiry", "instrument_name", "option_settlement_pnl", "settlement_price"],
+ "properties": {
+ "amount": {
+ "title": "amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Amount that was settled"
+ },
+ "expiry": {
+ "title": "expiry",
+ "type": "integer",
+ "description": "Expiry timestamp of the option"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ },
+ "option_settlement_pnl": {
+ "title": "option_settlement_pnl",
+ "type": "string",
+ "format": "decimal",
+ "description": "USD profit or loss from option settlements calculated as: settlement value - (average price x amount)"
+ },
+ "settlement_price": {
+ "title": "settlement_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Price of option settlement"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PublicGetTradeHistoryParamsSchema": {
+ "properties": {
+ "currency": {
+ "title": "currency",
+ "type": "string",
+ "default": null,
+ "description": "Currency to filter by (defaults to all)",
+ "nullable": true
+ },
+ "from_timestamp": {
+ "title": "from_timestamp",
+ "type": "integer",
+ "default": 0,
+ "description": "Earliest timestamp to filter by (in ms since Unix epoch). If not provied, defaults to 0."
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "default": null,
+ "description": "Instrument name to filter by (defaults to all)",
+ "nullable": true
+ },
+ "instrument_type": {
+ "title": "instrument_type",
+ "type": "string",
+ "default": null,
+ "enum": ["erc20", "option", "perp"],
+ "description": "Instrument type to filter by (defaults to all)",
+ "nullable": true
+ },
+ "page": {
+ "title": "page",
+ "type": "integer",
+ "default": 1,
+ "description": "Page number of results to return (default 1, returns last if above `num_pages`)"
+ },
+ "page_size": {
+ "title": "page_size",
+ "type": "integer",
+ "default": 100,
+ "description": "Number of results per page (default 100, max 1000)"
+ },
+ "to_timestamp": {
+ "title": "to_timestamp",
+ "type": "integer",
+ "default": 18446744073709552000,
+ "description": "Latest timestamp to filter by (in ms since Unix epoch). If not provied, defaults to returning all data up to current time."
+ },
+ "tx_status": {
+ "title": "tx_status",
+ "type": "string",
+ "default": "settled",
+ "enum": ["settled", "reverted"],
+ "description": "Transaction status to filter by (default `settled`)."
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PublicGetTradeHistoryResponseSchema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["pagination", "trades"],
+ "properties": {
+ "pagination": {
+ "required": ["count", "num_pages"],
+ "properties": {
+ "count": {
+ "title": "count",
+ "type": "integer",
+ "description": "Total number of items, across all pages"
+ },
+ "num_pages": {
+ "title": "num_pages",
+ "type": "integer",
+ "description": "Number of pages"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "trades": {
+ "title": "trades",
+ "type": "array",
+ "description": "List of trades",
+ "items": {
+ "required": [
+ "direction",
+ "index_price",
+ "instrument_name",
+ "liquidity_role",
+ "mark_price",
+ "subaccount_id",
+ "timestamp",
+ "trade_amount",
+ "trade_fee",
+ "trade_id",
+ "trade_price",
+ "tx_hash",
+ "tx_status",
+ "wallet"
+ ],
+ "properties": {
+ "direction": {
+ "title": "direction",
+ "type": "string",
+ "enum": ["buy", "sell"],
+ "description": "Order direction"
+ },
+ "index_price": {
+ "title": "index_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Index price of the underlying at the time of the trade"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ },
+ "liquidity_role": {
+ "title": "liquidity_role",
+ "type": "string",
+ "enum": ["maker", "taker"],
+ "description": "Role of the user in the trade"
+ },
+ "mark_price": {
+ "title": "mark_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Mark price of the instrument at the time of the trade"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount ID"
+ },
+ "timestamp": {
+ "title": "timestamp",
+ "type": "integer",
+ "description": "Trade timestamp (in ms since Unix epoch)"
+ },
+ "trade_amount": {
+ "title": "trade_amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Amount filled in this trade"
+ },
+ "trade_fee": {
+ "title": "trade_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Fee for this trade"
+ },
+ "trade_id": {
+ "title": "trade_id",
+ "type": "string",
+ "description": "Trade ID"
+ },
+ "trade_price": {
+ "title": "trade_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Price at which the trade was filled"
+ },
+ "tx_hash": {
+ "title": "tx_hash",
+ "type": "string",
+ "description": "Blockchain transaction hash"
+ },
+ "tx_status": {
+ "title": "tx_status",
+ "type": "string",
+ "enum": ["settled", "reverted"],
+ "description": "Blockchain transaction status"
+ },
+ "wallet": {
+ "title": "wallet",
+ "type": "string",
+ "description": "Wallet address (owner) of the subaccount"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PublicGetTradeHistoryResultSchema": {
+ "required": ["pagination", "trades"],
+ "properties": {
+ "pagination": {
+ "required": ["count", "num_pages"],
+ "properties": {
+ "count": {
+ "title": "count",
+ "type": "integer",
+ "description": "Total number of items, across all pages"
+ },
+ "num_pages": {
+ "title": "num_pages",
+ "type": "integer",
+ "description": "Number of pages"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "trades": {
+ "title": "trades",
+ "type": "array",
+ "description": "List of trades",
+ "items": {
+ "required": [
+ "direction",
+ "index_price",
+ "instrument_name",
+ "liquidity_role",
+ "mark_price",
+ "subaccount_id",
+ "timestamp",
+ "trade_amount",
+ "trade_fee",
+ "trade_id",
+ "trade_price",
+ "tx_hash",
+ "tx_status",
+ "wallet"
+ ],
+ "properties": {
+ "direction": {
+ "title": "direction",
+ "type": "string",
+ "enum": ["buy", "sell"],
+ "description": "Order direction"
+ },
+ "index_price": {
+ "title": "index_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Index price of the underlying at the time of the trade"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ },
+ "liquidity_role": {
+ "title": "liquidity_role",
+ "type": "string",
+ "enum": ["maker", "taker"],
+ "description": "Role of the user in the trade"
+ },
+ "mark_price": {
+ "title": "mark_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Mark price of the instrument at the time of the trade"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount ID"
+ },
+ "timestamp": {
+ "title": "timestamp",
+ "type": "integer",
+ "description": "Trade timestamp (in ms since Unix epoch)"
+ },
+ "trade_amount": {
+ "title": "trade_amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Amount filled in this trade"
+ },
+ "trade_fee": {
+ "title": "trade_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Fee for this trade"
+ },
+ "trade_id": {
+ "title": "trade_id",
+ "type": "string",
+ "description": "Trade ID"
+ },
+ "trade_price": {
+ "title": "trade_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Price at which the trade was filled"
+ },
+ "tx_hash": {
+ "title": "tx_hash",
+ "type": "string",
+ "description": "Blockchain transaction hash"
+ },
+ "tx_status": {
+ "title": "tx_status",
+ "type": "string",
+ "enum": ["settled", "reverted"],
+ "description": "Blockchain transaction status"
+ },
+ "wallet": {
+ "title": "wallet",
+ "type": "string",
+ "description": "Wallet address (owner) of the subaccount"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "TradeSettledPublicResponseSchema": {
+ "required": [
+ "direction",
+ "index_price",
+ "instrument_name",
+ "liquidity_role",
+ "mark_price",
+ "subaccount_id",
+ "timestamp",
+ "trade_amount",
+ "trade_fee",
+ "trade_id",
+ "trade_price",
+ "tx_hash",
+ "tx_status",
+ "wallet"
+ ],
+ "properties": {
+ "direction": {
+ "title": "direction",
+ "type": "string",
+ "enum": ["buy", "sell"],
+ "description": "Order direction"
+ },
+ "index_price": {
+ "title": "index_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Index price of the underlying at the time of the trade"
+ },
+ "instrument_name": {
+ "title": "instrument_name",
+ "type": "string",
+ "description": "Instrument name"
+ },
+ "liquidity_role": {
+ "title": "liquidity_role",
+ "type": "string",
+ "enum": ["maker", "taker"],
+ "description": "Role of the user in the trade"
+ },
+ "mark_price": {
+ "title": "mark_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Mark price of the instrument at the time of the trade"
+ },
+ "subaccount_id": {
+ "title": "subaccount_id",
+ "type": "integer",
+ "description": "Subaccount ID"
+ },
+ "timestamp": {
+ "title": "timestamp",
+ "type": "integer",
+ "description": "Trade timestamp (in ms since Unix epoch)"
+ },
+ "trade_amount": {
+ "title": "trade_amount",
+ "type": "string",
+ "format": "decimal",
+ "description": "Amount filled in this trade"
+ },
+ "trade_fee": {
+ "title": "trade_fee",
+ "type": "string",
+ "format": "decimal",
+ "description": "Fee for this trade"
+ },
+ "trade_id": {
+ "title": "trade_id",
+ "type": "string",
+ "description": "Trade ID"
+ },
+ "trade_price": {
+ "title": "trade_price",
+ "type": "string",
+ "format": "decimal",
+ "description": "Price at which the trade was filled"
+ },
+ "tx_hash": {
+ "title": "tx_hash",
+ "type": "string",
+ "description": "Blockchain transaction hash"
+ },
+ "tx_status": {
+ "title": "tx_status",
+ "type": "string",
+ "enum": ["settled", "reverted"],
+ "description": "Blockchain transaction status"
+ },
+ "wallet": {
+ "title": "wallet",
+ "type": "string",
+ "description": "Wallet address (owner) of the subaccount"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PublicGetLatestSignedFeedsParamsSchema": {
+ "properties": {
+ "currency": {
+ "title": "currency",
+ "type": "string",
+ "default": null,
+ "description": "Currency filter, (defaults to all currencies)",
+ "nullable": true
+ },
+ "expiry": {
+ "title": "expiry",
+ "type": "integer",
+ "default": null,
+ "description": "Expiry filter for options and forward data (defaults to all expiries). Use `0` to get data only for spot and perpetuals",
+ "nullable": true
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PublicGetLatestSignedFeedsResponseSchema": {
+ "required": ["id", "result"],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "title": "",
+ "type": "string"
+ },
+ {
+ "title": "",
+ "type": "integer"
+ }
+ ]
+ },
+ "result": {
+ "required": ["fwd_data", "perp_data", "spot_data", "vol_data"],
+ "properties": {
+ "fwd_data": {
+ "title": "fwd_data",
+ "type": "object",
+ "description": "currency -> expiry -> latest forward feed data",
+ "additionalProperties": {
+ "title": "fwd_data",
+ "type": "object",
+ "additionalProperties": {
+ "required": [
+ "confidence",
+ "currency",
+ "deadline",
+ "expiry",
+ "fwd_diff",
+ "signatures",
+ "spot_aggregate_latest",
+ "spot_aggregate_start",
+ "timestamp"
+ ],
+ "properties": {
+ "confidence": {
+ "title": "confidence",
+ "type": "string",
+ "format": "decimal",
+ "description": "The confidence score of the price"
+ },
+ "currency": {
+ "title": "currency",
+ "type": "string",
+ "description": "The currency for which the spot feed represents"
+ },
+ "deadline": {
+ "title": "deadline",
+ "type": "integer",
+ "description": "The latest time the data can be submitted on chain"
+ },
+ "expiry": {
+ "title": "expiry",
+ "type": "integer",
+ "description": "The expiry for the forward feed"
+ },
+ "fwd_diff": {
+ "title": "fwd_diff",
+ "type": "string",
+ "format": "decimal",
+ "description": "difference of forward price from current spot price"
+ },
+ "signatures": {
+ "properties": {
+ "signatures": {
+ "title": "signatures",
+ "type": "array",
+ "description": "The signatures of the given signers",
+ "items": {
+ "title": "signatures",
+ "type": "string"
+ }
+ },
+ "signers": {
+ "title": "signers",
+ "type": "array",
+ "description": "The signers who verify the data integrity",
+ "items": {
+ "title": "signers",
+ "type": "string"
+ }
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "spot_aggregate_latest": {
+ "title": "spot_aggregate_latest",
+ "type": "string",
+ "format": "decimal",
+ "description": "expiry -> spot * time value at the latest timestamp"
+ },
+ "spot_aggregate_start": {
+ "title": "spot_aggregate_start",
+ "type": "string",
+ "format": "decimal",
+ "description": "spot * time value at the start of the settlement period"
+ },
+ "timestamp": {
+ "title": "timestamp",
+ "type": "integer",
+ "description": "The timestamp for which the data was created"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ },
+ "perp_data": {
+ "title": "perp_data",
+ "type": "object",
+ "description": "currency -> feed type -> latest perp feed data",
+ "additionalProperties": {
+ "title": "perp_data",
+ "type": "object",
+ "additionalProperties": {
+ "required": [
+ "confidence",
+ "currency",
+ "deadline",
+ "signatures",
+ "spot_diff_value",
+ "timestamp",
+ "type"
+ ],
+ "properties": {
+ "confidence": {
+ "title": "confidence",
+ "type": "string",
+ "format": "decimal",
+ "description": "The confidence score of the price"
+ },
+ "currency": {
+ "title": "currency",
+ "type": "string",
+ "description": "The currency for which the spot feed represents"
+ },
+ "deadline": {
+ "title": "deadline",
+ "type": "integer",
+ "description": "The latest time the data can be submitted on chain"
+ },
+ "signatures": {
+ "properties": {
+ "signatures": {
+ "title": "signatures",
+ "type": "array",
+ "description": "The signatures of the given signers",
+ "items": {
+ "title": "signatures",
+ "type": "string"
+ }
+ },
+ "signers": {
+ "title": "signers",
+ "type": "array",
+ "description": "The signers who verify the data integrity",
+ "items": {
+ "title": "signers",
+ "type": "string"
+ }
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "spot_diff_value": {
+ "title": "spot_diff_value",
+ "type": "string",
+ "format": "decimal",
+ "description": "The difference between the spot price and the perp price"
+ },
+ "timestamp": {
+ "title": "timestamp",
+ "type": "integer",
+ "description": "The timestamp for which the data was created"
+ },
+ "type": {
+ "title": "type",
+ "type": "string",
+ "enum": ["P", "A", "B"],
+ "description": "The type of perp feed; mid price, ask impact or bid impact"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ },
+ "spot_data": {
+ "title": "spot_data",
+ "type": "object",
+ "description": "currency -> latest spot feed data",
+ "additionalProperties": {
+ "required": ["confidence", "currency", "deadline", "price", "signatures", "timestamp"],
+ "properties": {
+ "confidence": {
+ "title": "confidence",
+ "type": "string",
+ "format": "decimal",
+ "description": "The confidence score of the price"
+ },
+ "currency": {
+ "title": "currency",
+ "type": "string",
+ "description": "The currency for which the spot feed represents"
+ },
+ "deadline": {
+ "title": "deadline",
+ "type": "integer",
+ "description": "The latest time the data can be submitted on chain"
+ },
+ "price": {
+ "title": "price",
+ "type": "string",
+ "format": "decimal",
+ "description": "The price of the currency in USD"
+ },
+ "signatures": {
+ "properties": {
+ "signatures": {
+ "title": "signatures",
+ "type": "array",
+ "description": "The signatures of the given signers",
+ "items": {
+ "title": "signatures",
+ "type": "string"
+ }
+ },
+ "signers": {
+ "title": "signers",
+ "type": "array",
+ "description": "The signers who verify the data integrity",
+ "items": {
+ "title": "signers",
+ "type": "string"
+ }
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "timestamp": {
+ "title": "timestamp",
+ "type": "integer",
+ "description": "The timestamp for which the data was created"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "vol_data": {
+ "title": "vol_data",
+ "type": "object",
+ "description": "currency -> expiry -> latest vol feed data",
+ "additionalProperties": {
+ "title": "vol_data",
+ "type": "object",
+ "additionalProperties": {
+ "required": ["confidence", "currency", "deadline", "expiry", "signatures", "timestamp", "vol_data"],
+ "properties": {
+ "confidence": {
+ "title": "confidence",
+ "type": "string",
+ "format": "decimal",
+ "description": "The confidence score of the price"
+ },
+ "currency": {
+ "title": "currency",
+ "type": "string",
+ "description": "The currency for which the spot feed represents"
+ },
+ "deadline": {
+ "title": "deadline",
+ "type": "integer",
+ "description": "The latest time the data can be submitted on chain"
+ },
+ "expiry": {
+ "title": "expiry",
+ "type": "integer",
+ "description": "The expiry for the options for the vol feed"
+ },
+ "signatures": {
+ "properties": {
+ "signatures": {
+ "title": "signatures",
+ "type": "array",
+ "description": "The signatures of the given signers",
+ "items": {
+ "title": "signatures",
+ "type": "string"
+ }
+ },
+ "signers": {
+ "title": "signers",
+ "type": "array",
+ "description": "The signers who verify the data integrity",
+ "items": {
+ "title": "signers",
+ "type": "string"
+ }
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "timestamp": {
+ "title": "timestamp",
+ "type": "integer",
+ "description": "The timestamp for which the data was created"
+ },
+ "vol_data": {
+ "required": ["SVI_a", "SVI_b", "SVI_fwd", "SVI_m", "SVI_refTau", "SVI_rho", "SVI_sigma"],
+ "properties": {
+ "SVI_a": {
+ "title": "SVI_a",
+ "type": "string",
+ "format": "decimal"
+ },
+ "SVI_b": {
+ "title": "SVI_b",
+ "type": "string",
+ "format": "decimal"
+ },
+ "SVI_fwd": {
+ "title": "SVI_fwd",
+ "type": "string",
+ "format": "decimal"
+ },
+ "SVI_m": {
+ "title": "SVI_m",
+ "type": "string",
+ "format": "decimal"
+ },
+ "SVI_refTau": {
+ "title": "SVI_refTau",
+ "type": "string",
+ "format": "decimal"
+ },
+ "SVI_rho": {
+ "title": "SVI_rho",
+ "type": "string",
+ "format": "decimal"
+ },
+ "SVI_sigma": {
+ "title": "SVI_sigma",
+ "type": "string",
+ "format": "decimal"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PublicGetLatestSignedFeedsResultSchema": {
+ "required": ["fwd_data", "perp_data", "spot_data", "vol_data"],
+ "properties": {
+ "fwd_data": {
+ "title": "fwd_data",
+ "type": "object",
+ "description": "currency -> expiry -> latest forward feed data",
+ "additionalProperties": {
+ "title": "fwd_data",
+ "type": "object",
+ "additionalProperties": {
+ "required": [
+ "confidence",
+ "currency",
+ "deadline",
+ "expiry",
+ "fwd_diff",
+ "signatures",
+ "spot_aggregate_latest",
+ "spot_aggregate_start",
+ "timestamp"
+ ],
+ "properties": {
+ "confidence": {
+ "title": "confidence",
+ "type": "string",
+ "format": "decimal",
+ "description": "The confidence score of the price"
+ },
+ "currency": {
+ "title": "currency",
+ "type": "string",
+ "description": "The currency for which the spot feed represents"
+ },
+ "deadline": {
+ "title": "deadline",
+ "type": "integer",
+ "description": "The latest time the data can be submitted on chain"
+ },
+ "expiry": {
+ "title": "expiry",
+ "type": "integer",
+ "description": "The expiry for the forward feed"
+ },
+ "fwd_diff": {
+ "title": "fwd_diff",
+ "type": "string",
+ "format": "decimal",
+ "description": "difference of forward price from current spot price"
+ },
+ "signatures": {
+ "properties": {
+ "signatures": {
+ "title": "signatures",
+ "type": "array",
+ "description": "The signatures of the given signers",
+ "items": {
+ "title": "signatures",
+ "type": "string"
+ }
+ },
+ "signers": {
+ "title": "signers",
+ "type": "array",
+ "description": "The signers who verify the data integrity",
+ "items": {
+ "title": "signers",
+ "type": "string"
+ }
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "spot_aggregate_latest": {
+ "title": "spot_aggregate_latest",
+ "type": "string",
+ "format": "decimal",
+ "description": "expiry -> spot * time value at the latest timestamp"
+ },
+ "spot_aggregate_start": {
+ "title": "spot_aggregate_start",
+ "type": "string",
+ "format": "decimal",
+ "description": "spot * time value at the start of the settlement period"
+ },
+ "timestamp": {
+ "title": "timestamp",
+ "type": "integer",
+ "description": "The timestamp for which the data was created"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ },
+ "perp_data": {
+ "title": "perp_data",
+ "type": "object",
+ "description": "currency -> feed type -> latest perp feed data",
+ "additionalProperties": {
+ "title": "perp_data",
+ "type": "object",
+ "additionalProperties": {
+ "required": [
+ "confidence",
+ "currency",
+ "deadline",
+ "signatures",
+ "spot_diff_value",
+ "timestamp",
+ "type"
+ ],
+ "properties": {
+ "confidence": {
+ "title": "confidence",
+ "type": "string",
+ "format": "decimal",
+ "description": "The confidence score of the price"
+ },
+ "currency": {
+ "title": "currency",
+ "type": "string",
+ "description": "The currency for which the spot feed represents"
+ },
+ "deadline": {
+ "title": "deadline",
+ "type": "integer",
+ "description": "The latest time the data can be submitted on chain"
+ },
+ "signatures": {
+ "properties": {
+ "signatures": {
+ "title": "signatures",
+ "type": "array",
+ "description": "The signatures of the given signers",
+ "items": {
+ "title": "signatures",
+ "type": "string"
+ }
+ },
+ "signers": {
+ "title": "signers",
+ "type": "array",
+ "description": "The signers who verify the data integrity",
+ "items": {
+ "title": "signers",
+ "type": "string"
+ }
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "spot_diff_value": {
+ "title": "spot_diff_value",
+ "type": "string",
+ "format": "decimal",
+ "description": "The difference between the spot price and the perp price"
+ },
+ "timestamp": {
+ "title": "timestamp",
+ "type": "integer",
+ "description": "The timestamp for which the data was created"
+ },
+ "type": {
+ "title": "type",
+ "type": "string",
+ "enum": ["P", "A", "B"],
+ "description": "The type of perp feed; mid price, ask impact or bid impact"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ },
+ "spot_data": {
+ "title": "spot_data",
+ "type": "object",
+ "description": "currency -> latest spot feed data",
+ "additionalProperties": {
+ "required": ["confidence", "currency", "deadline", "price", "signatures", "timestamp"],
+ "properties": {
+ "confidence": {
+ "title": "confidence",
+ "type": "string",
+ "format": "decimal",
+ "description": "The confidence score of the price"
+ },
+ "currency": {
+ "title": "currency",
+ "type": "string",
+ "description": "The currency for which the spot feed represents"
+ },
+ "deadline": {
+ "title": "deadline",
+ "type": "integer",
+ "description": "The latest time the data can be submitted on chain"
+ },
+ "price": {
+ "title": "price",
+ "type": "string",
+ "format": "decimal",
+ "description": "The price of the currency in USD"
+ },
+ "signatures": {
+ "properties": {
+ "signatures": {
+ "title": "signatures",
+ "type": "array",
+ "description": "The signatures of the given signers",
+ "items": {
+ "title": "signatures",
+ "type": "string"
+ }
+ },
+ "signers": {
+ "title": "signers",
+ "type": "array",
+ "description": "The signers who verify the data integrity",
+ "items": {
+ "title": "signers",
+ "type": "string"
+ }
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "timestamp": {
+ "title": "timestamp",
+ "type": "integer",
+ "description": "The timestamp for which the data was created"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "vol_data": {
+ "title": "vol_data",
+ "type": "object",
+ "description": "currency -> expiry -> latest vol feed data",
+ "additionalProperties": {
+ "title": "vol_data",
+ "type": "object",
+ "additionalProperties": {
+ "required": ["confidence", "currency", "deadline", "expiry", "signatures", "timestamp", "vol_data"],
+ "properties": {
+ "confidence": {
+ "title": "confidence",
+ "type": "string",
+ "format": "decimal",
+ "description": "The confidence score of the price"
+ },
+ "currency": {
+ "title": "currency",
+ "type": "string",
+ "description": "The currency for which the spot feed represents"
+ },
+ "deadline": {
+ "title": "deadline",
+ "type": "integer",
+ "description": "The latest time the data can be submitted on chain"
+ },
+ "expiry": {
+ "title": "expiry",
+ "type": "integer",
+ "description": "The expiry for the options for the vol feed"
+ },
+ "signatures": {
+ "properties": {
+ "signatures": {
+ "title": "signatures",
+ "type": "array",
+ "description": "The signatures of the given signers",
+ "items": {
+ "title": "signatures",
+ "type": "string"
+ }
+ },
+ "signers": {
+ "title": "signers",
+ "type": "array",
+ "description": "The signers who verify the data integrity",
+ "items": {
+ "title": "signers",
+ "type": "string"
+ }
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "timestamp": {
+ "title": "timestamp",
+ "type": "integer",
+ "description": "The timestamp for which the data was created"
+ },
+ "vol_data": {
+ "required": ["SVI_a", "SVI_b", "SVI_fwd", "SVI_m", "SVI_refTau", "SVI_rho", "SVI_sigma"],
+ "properties": {
+ "SVI_a": {
+ "title": "SVI_a",
+ "type": "string",
+ "format": "decimal"
+ },
+ "SVI_b": {
+ "title": "SVI_b",
+ "type": "string",
+ "format": "decimal"
+ },
+ "SVI_fwd": {
+ "title": "SVI_fwd",
+ "type": "string",
+ "format": "decimal"
+ },
+ "SVI_m": {
+ "title": "SVI_m",
+ "type": "string",
+ "format": "decimal"
+ },
+ "SVI_refTau": {
+ "title": "SVI_refTau",
+ "type": "string",
+ "format": "decimal"
+ },
+ "SVI_rho": {
+ "title": "SVI_rho",
+ "type": "string",
+ "format": "decimal"
+ },
+ "SVI_sigma": {
+ "title": "SVI_sigma",
+ "type": "string",
+ "format": "decimal"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "ForwardFeedDataSchema": {
+ "required": [
+ "confidence",
+ "currency",
+ "deadline",
+ "expiry",
+ "fwd_diff",
+ "signatures",
+ "spot_aggregate_latest",
+ "spot_aggregate_start",
+ "timestamp"
+ ],
+ "properties": {
+ "confidence": {
+ "title": "confidence",
+ "type": "string",
+ "format": "decimal",
+ "description": "The confidence score of the price"
+ },
+ "currency": {
+ "title": "currency",
+ "type": "string",
+ "description": "The currency for which the spot feed represents"
+ },
+ "deadline": {
+ "title": "deadline",
+ "type": "integer",
+ "description": "The latest time the data can be submitted on chain"
+ },
+ "expiry": {
+ "title": "expiry",
+ "type": "integer",
+ "description": "The expiry for the forward feed"
+ },
+ "fwd_diff": {
+ "title": "fwd_diff",
+ "type": "string",
+ "format": "decimal",
+ "description": "difference of forward price from current spot price"
+ },
+ "signatures": {
+ "properties": {
+ "signatures": {
+ "title": "signatures",
+ "type": "array",
+ "description": "The signatures of the given signers",
+ "items": {
+ "title": "signatures",
+ "type": "string"
+ }
+ },
+ "signers": {
+ "title": "signers",
+ "type": "array",
+ "description": "The signers who verify the data integrity",
+ "items": {
+ "title": "signers",
+ "type": "string"
+ }
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "spot_aggregate_latest": {
+ "title": "spot_aggregate_latest",
+ "type": "string",
+ "format": "decimal",
+ "description": "expiry -> spot * time value at the latest timestamp"
+ },
+ "spot_aggregate_start": {
+ "title": "spot_aggregate_start",
+ "type": "string",
+ "format": "decimal",
+ "description": "spot * time value at the start of the settlement period"
+ },
+ "timestamp": {
+ "title": "timestamp",
+ "type": "integer",
+ "description": "The timestamp for which the data was created"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "OracleSignatureDataSchema": {
+ "properties": {
+ "signatures": {
+ "title": "signatures",
+ "type": "array",
+ "description": "The signatures of the given signers",
+ "items": {
+ "title": "signatures",
+ "type": "string"
+ }
+ },
+ "signers": {
+ "title": "signers",
+ "type": "array",
+ "description": "The signers who verify the data integrity",
+ "items": {
+ "title": "signers",
+ "type": "string"
+ }
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "PerpFeedDataSchema": {
+ "required": ["confidence", "currency", "deadline", "signatures", "spot_diff_value", "timestamp", "type"],
+ "properties": {
+ "confidence": {
+ "title": "confidence",
+ "type": "string",
+ "format": "decimal",
+ "description": "The confidence score of the price"
+ },
+ "currency": {
+ "title": "currency",
+ "type": "string",
+ "description": "The currency for which the spot feed represents"
+ },
+ "deadline": {
+ "title": "deadline",
+ "type": "integer",
+ "description": "The latest time the data can be submitted on chain"
+ },
+ "signatures": {
+ "properties": {
+ "signatures": {
+ "title": "signatures",
+ "type": "array",
+ "description": "The signatures of the given signers",
+ "items": {
+ "title": "signatures",
+ "type": "string"
+ }
+ },
+ "signers": {
+ "title": "signers",
+ "type": "array",
+ "description": "The signers who verify the data integrity",
+ "items": {
+ "title": "signers",
+ "type": "string"
+ }
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "spot_diff_value": {
+ "title": "spot_diff_value",
+ "type": "string",
+ "format": "decimal",
+ "description": "The difference between the spot price and the perp price"
+ },
+ "timestamp": {
+ "title": "timestamp",
+ "type": "integer",
+ "description": "The timestamp for which the data was created"
+ },
+ "type": {
+ "title": "type",
+ "type": "string",
+ "enum": ["P", "A", "B"],
+ "description": "The type of perp feed; mid price, ask impact or bid impact"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "SpotFeedDataSchema": {
+ "required": ["confidence", "currency", "deadline", "price", "signatures", "timestamp"],
+ "properties": {
+ "confidence": {
+ "title": "confidence",
+ "type": "string",
+ "format": "decimal",
+ "description": "The confidence score of the price"
+ },
+ "currency": {
+ "title": "currency",
+ "type": "string",
+ "description": "The currency for which the spot feed represents"
+ },
+ "deadline": {
+ "title": "deadline",
+ "type": "integer",
+ "description": "The latest time the data can be submitted on chain"
+ },
+ "price": {
+ "title": "price",
+ "type": "string",
+ "format": "decimal",
+ "description": "The price of the currency in USD"
+ },
+ "signatures": {
+ "properties": {
+ "signatures": {
+ "title": "signatures",
+ "type": "array",
+ "description": "The signatures of the given signers",
+ "items": {
+ "title": "signatures",
+ "type": "string"
+ }
+ },
+ "signers": {
+ "title": "signers",
+ "type": "array",
+ "description": "The signers who verify the data integrity",
+ "items": {
+ "title": "signers",
+ "type": "string"
+ }
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "timestamp": {
+ "title": "timestamp",
+ "type": "integer",
+ "description": "The timestamp for which the data was created"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "VolFeedDataSchema": {
+ "required": ["confidence", "currency", "deadline", "expiry", "signatures", "timestamp", "vol_data"],
+ "properties": {
+ "confidence": {
+ "title": "confidence",
+ "type": "string",
+ "format": "decimal",
+ "description": "The confidence score of the price"
+ },
+ "currency": {
+ "title": "currency",
+ "type": "string",
+ "description": "The currency for which the spot feed represents"
+ },
+ "deadline": {
+ "title": "deadline",
+ "type": "integer",
+ "description": "The latest time the data can be submitted on chain"
+ },
+ "expiry": {
+ "title": "expiry",
+ "type": "integer",
+ "description": "The expiry for the options for the vol feed"
+ },
+ "signatures": {
+ "properties": {
+ "signatures": {
+ "title": "signatures",
+ "type": "array",
+ "description": "The signatures of the given signers",
+ "items": {
+ "title": "signatures",
+ "type": "string"
+ }
+ },
+ "signers": {
+ "title": "signers",
+ "type": "array",
+ "description": "The signers who verify the data integrity",
+ "items": {
+ "title": "signers",
+ "type": "string"
+ }
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "timestamp": {
+ "title": "timestamp",
+ "type": "integer",
+ "description": "The timestamp for which the data was created"
+ },
+ "vol_data": {
+ "required": ["SVI_a", "SVI_b", "SVI_fwd", "SVI_m", "SVI_refTau", "SVI_rho", "SVI_sigma"],
+ "properties": {
+ "SVI_a": {
+ "title": "SVI_a",
+ "type": "string",
+ "format": "decimal"
+ },
+ "SVI_b": {
+ "title": "SVI_b",
+ "type": "string",
+ "format": "decimal"
+ },
+ "SVI_fwd": {
+ "title": "SVI_fwd",
+ "type": "string",
+ "format": "decimal"
+ },
+ "SVI_m": {
+ "title": "SVI_m",
+ "type": "string",
+ "format": "decimal"
+ },
+ "SVI_refTau": {
+ "title": "SVI_refTau",
+ "type": "string",
+ "format": "decimal"
+ },
+ "SVI_rho": {
+ "title": "SVI_rho",
+ "type": "string",
+ "format": "decimal"
+ },
+ "SVI_sigma": {
+ "title": "SVI_sigma",
+ "type": "string",
+ "format": "decimal"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ },
+ "VolSVIParamDataSchema": {
+ "required": ["SVI_a", "SVI_b", "SVI_fwd", "SVI_m", "SVI_refTau", "SVI_rho", "SVI_sigma"],
+ "properties": {
+ "SVI_a": {
+ "title": "SVI_a",
+ "type": "string",
+ "format": "decimal"
+ },
+ "SVI_b": {
+ "title": "SVI_b",
+ "type": "string",
+ "format": "decimal"
+ },
+ "SVI_fwd": {
+ "title": "SVI_fwd",
+ "type": "string",
+ "format": "decimal"
+ },
+ "SVI_m": {
+ "title": "SVI_m",
+ "type": "string",
+ "format": "decimal"
+ },
+ "SVI_refTau": {
+ "title": "SVI_refTau",
+ "type": "string",
+ "format": "decimal"
+ },
+ "SVI_rho": {
+ "title": "SVI_rho",
+ "type": "string",
+ "format": "decimal"
+ },
+ "SVI_sigma": {
+ "title": "SVI_sigma",
+ "type": "string",
+ "format": "decimal"
+ }
+ },
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+}
diff --git a/app/src/api/schemas.ts b/app/src/api/schemas.ts
new file mode 100644
index 0000000..ff142e7
--- /dev/null
+++ b/app/src/api/schemas.ts
@@ -0,0 +1,115 @@
+const PostPrivateCancel = {"body":{"required":["instrument_name","order_id","subaccount_id"],"properties":{"instrument_name":{"title":"instrument_name","type":"string"},"order_id":{"title":"order_id","type":"string","format":"uuid"},"subaccount_id":{"title":"subaccount_id","type":"integer"}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"},"response":{"200":{"required":["id","result"],"properties":{"id":{"anyOf":[{"title":"","type":"string"},{"title":"","type":"integer"}]},"result":{"required":["amount","average_price","cancel_reason","creation_timestamp","direction","filled_amount","instrument_name","is_transfer","label","last_update_timestamp","limit_price","max_fee","mmp","nonce","order_fee","order_id","order_status","order_type","signature","signature_expiry_sec","signer","subaccount_id","time_in_force"],"properties":{"amount":{"title":"amount","type":"string","format":"decimal","description":"Order amount in units of the base"},"average_price":{"title":"average_price","type":"string","format":"decimal","description":"Average fill price"},"cancel_reason":{"title":"cancel_reason","type":"string","enum":["","user_request","mmp_trigger","insufficient_margin","signed_max_fee_too_low","cancel_on_disconnect","ioc_or_market_partial_fill","session_key_deregistered","subaccount_withdrawn","compliance"],"description":"If cancelled, reason behind order cancellation\n\n`user_request` `mmp_trigger` `insufficient_margin` `signed_max_fee_too_low` `cancel_on_disconnect` `ioc_or_market_partial_fill` `session_key_deregistered` `subaccount_withdrawn` `compliance`"},"creation_timestamp":{"title":"creation_timestamp","type":"integer","description":"Creation timestamp (in ms since Unix epoch)"},"direction":{"title":"direction","type":"string","enum":["buy","sell"],"description":"Order direction\n\n`buy` `sell`"},"filled_amount":{"title":"filled_amount","type":"string","format":"decimal","description":"Total filled amount for the order"},"instrument_name":{"title":"instrument_name","type":"string","description":"Instrument name"},"is_transfer":{"title":"is_transfer","type":"boolean","description":"Whether the order was generated through `private/transfer_position`"},"label":{"title":"label","type":"string","description":"Optional user-defined label for the order"},"last_update_timestamp":{"title":"last_update_timestamp","type":"integer","description":"Last update timestamp (in ms since Unix epoch)"},"limit_price":{"title":"limit_price","type":"string","format":"decimal","description":"Limit price in quote currency"},"max_fee":{"title":"max_fee","type":"string","format":"decimal","description":"Max fee in units of the quote currency"},"mmp":{"title":"mmp","type":"boolean","description":"Whether the order is tagged for market maker protections"},"nonce":{"title":"nonce","type":"integer","description":"Unique nonce defined as (e.g. 1695836058725001, where 001 is the random number)"},"order_fee":{"title":"order_fee","type":"string","format":"decimal","description":"Total order fee paid so far"},"order_id":{"title":"order_id","type":"string","description":"Order ID"},"order_status":{"title":"order_status","type":"string","enum":["open","filled","rejected","cancelled","expired"],"description":"Order status\n\n`open` `filled` `rejected` `cancelled` `expired`"},"order_type":{"title":"order_type","type":"string","enum":["limit","market"],"description":"Order type\n\n`limit` `market`"},"signature":{"title":"signature","type":"string","description":"Ethereum signature of the order"},"signature_expiry_sec":{"title":"signature_expiry_sec","type":"integer","description":"Signature expiry timestamp"},"signer":{"title":"signer","type":"string","description":"Owner wallet address or registered session key that signed order"},"subaccount_id":{"title":"subaccount_id","type":"integer","description":"Subaccount ID"},"time_in_force":{"title":"time_in_force","type":"string","enum":["gtc","post_only","fok","ioc"],"description":"Time in force\n\n`gtc` `post_only` `fok` `ioc`"}},"type":"object","additionalProperties":false}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"}}} as const
+;
+const PostPrivateCancelAll = {"body":{"required":["subaccount_id"],"properties":{"subaccount_id":{"title":"subaccount_id","type":"integer","description":"Subaccount ID"}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"},"response":{"200":{"required":["id","result"],"properties":{"id":{"anyOf":[{"title":"","type":"string"},{"title":"","type":"integer"}]},"result":{"required":["cancelled_orders"],"properties":{"cancelled_orders":{"title":"cancelled_orders","type":"integer","description":"Number of cancelled orders"}},"type":"object","additionalProperties":false}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"}}} as const
+;
+const PostPrivateCancelByInstrument = {"body":{"required":["instrument_name","subaccount_id"],"properties":{"instrument_name":{"title":"instrument_name","type":"string","description":"Cancel all orders for this instrument"},"subaccount_id":{"title":"subaccount_id","type":"integer","description":"Subaccount ID"}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"},"response":{"200":{"required":["id","result"],"properties":{"id":{"anyOf":[{"title":"","type":"string"},{"title":"","type":"integer"}]},"result":{"required":["cancelled_orders"],"properties":{"cancelled_orders":{"title":"cancelled_orders","type":"integer","description":"Number of cancelled orders"}},"type":"object","additionalProperties":false}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"}}} as const
+;
+const PostPrivateCancelByLabel = {"body":{"required":["label","subaccount_id"],"properties":{"label":{"title":"label","type":"string","description":"Cancel all orders for this label"},"subaccount_id":{"title":"subaccount_id","type":"integer","description":"Subaccount ID"}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"},"response":{"200":{"required":["id","result"],"properties":{"id":{"anyOf":[{"title":"","type":"string"},{"title":"","type":"integer"}]},"result":{"required":["cancelled_orders"],"properties":{"cancelled_orders":{"title":"cancelled_orders","type":"integer","description":"Number of cancelled orders"}},"type":"object","additionalProperties":false}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"}}} as const
+;
+const PostPrivateCancelByNonce = {"body":{"required":["nonce","subaccount_id"],"properties":{"nonce":{"title":"nonce","type":"integer","description":"Cancel an order with this nonce"},"subaccount_id":{"title":"subaccount_id","type":"integer","description":"Subaccount ID"}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"},"response":{"200":{"required":["id","result"],"properties":{"id":{"anyOf":[{"title":"","type":"string"},{"title":"","type":"integer"}]},"result":{"required":["cancelled_orders"],"properties":{"cancelled_orders":{"title":"cancelled_orders","type":"integer","description":"Number of cancelled orders"}},"type":"object","additionalProperties":false}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"}}} as const
+;
+const PostPrivateChangeSessionKeyLabel = {"body":{"required":["label"],"properties":{"label":{"title":"label","type":"string"}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"},"response":{"200":{"required":["id","result"],"properties":{"id":{"anyOf":[{"title":"","type":"string"},{"title":"","type":"integer"}]},"result":{"required":["label"],"properties":{"label":{"title":"label","type":"string"}},"type":"object","additionalProperties":false}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"}}} as const
+;
+const PostPrivateChangeSubaccountLabel = {"body":{"required":["label","subaccount_id"],"properties":{"label":{"title":"label","type":"string","description":"User defined label"},"subaccount_id":{"title":"subaccount_id","type":"integer","description":"Subaccount_id"}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"},"response":{"200":{"required":["id","result"],"properties":{"id":{"anyOf":[{"title":"","type":"string"},{"title":"","type":"integer"}]},"result":{"required":["label","subaccount_id"],"properties":{"label":{"title":"label","type":"string","description":"User defined label"},"subaccount_id":{"title":"subaccount_id","type":"integer","description":"Subaccount_id"}},"type":"object","additionalProperties":false}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"}}} as const
+;
+const PostPrivateCreateSubaccount = {"body":{"required":["amount","asset_name","margin_type","nonce","signature","signature_expiry_sec","signer","wallet"],"properties":{"amount":{"title":"amount","type":"string","format":"decimal","description":"Amount of the asset to deposit"},"asset_name":{"title":"asset_name","type":"string","description":"Name of asset to deposit"},"currency":{"title":"currency","type":["string","null"],"default":null,"description":"Base currency of the subaccount (only for `PM`)"},"margin_type":{"title":"margin_type","type":"string","enum":["PM","SM"],"description":"`PM` (Portfolio Margin) or `SM` (Standard Margin)"},"nonce":{"title":"nonce","type":"integer","description":"Unique nonce defined as (e.g. 1695836058725001, where 001 is the random number)"},"signature":{"title":"signature","type":"string","description":"Ethereum signature of the deposit"},"signature_expiry_sec":{"title":"signature_expiry_sec","type":"integer","description":"Unix timestamp in seconds. Expiry MUST be >5min from now"},"signer":{"title":"signer","type":"string","description":"Ethereum wallet address that is signing the deposit"},"wallet":{"title":"wallet","type":"string","description":"Ethereum wallet address"}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"},"response":{"200":{"required":["id","result"],"properties":{"id":{"anyOf":[{"title":"","type":"string"},{"title":"","type":"integer"}]},"result":{"required":["status","transaction_id"],"properties":{"status":{"title":"status","type":"string","description":"`requested`"},"transaction_id":{"title":"transaction_id","type":"string","format":"uuid","description":"Transaction id of the request"}},"type":"object","additionalProperties":false}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"}}} as const
+;
+const PostPrivateDeposit = {"body":{"required":["amount","asset_name","nonce","signature","signature_expiry_sec","signer","subaccount_id"],"properties":{"amount":{"title":"amount","type":"string","format":"decimal","description":"Amount of the asset to deposit"},"asset_name":{"title":"asset_name","type":"string","description":"Name of asset to deposit"},"nonce":{"title":"nonce","type":"integer","description":"Unique nonce defined as (e.g. 1695836058725001, where 001 is the random number)"},"signature":{"title":"signature","type":"string","description":"Ethereum signature of the deposit"},"signature_expiry_sec":{"title":"signature_expiry_sec","type":"integer","description":"Unix timestamp in seconds. Expiry MUST be >5min from now"},"signer":{"title":"signer","type":"string","description":"Ethereum wallet address that is signing the deposit"},"subaccount_id":{"title":"subaccount_id","type":"integer","description":"Subaccount_id"}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"},"response":{"200":{"required":["id","result"],"properties":{"id":{"anyOf":[{"title":"","type":"string"},{"title":"","type":"integer"}]},"result":{"required":["status","transaction_id"],"properties":{"status":{"title":"status","type":"string","description":"`requested`"},"transaction_id":{"title":"transaction_id","type":"string","format":"uuid","description":"Transaction id of the deposit"}},"type":"object","additionalProperties":false}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"}}} as const
+;
+const PostPrivateExpiredAndCancelledHistory = {"body":{"required":["end_timestamp","expiry","start_timestamp","subaccount_id","wallet"],"properties":{"end_timestamp":{"title":"end_timestamp","type":"integer","description":"End Unix timestamp"},"expiry":{"title":"expiry","type":"integer","description":"Expiry of download link in seconds. Maximum of 604800."},"start_timestamp":{"title":"start_timestamp","type":"integer","description":"Start Unix timestamp"},"subaccount_id":{"title":"subaccount_id","type":"integer","description":"Subaccount to download data for"},"wallet":{"title":"wallet","type":"string","description":"Wallet to download data for"}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"},"response":{"200":{"required":["id","result"],"properties":{"id":{"anyOf":[{"title":"","type":"string"},{"title":"","type":"integer"}]},"result":{"required":["presigned_urls"],"properties":{"presigned_urls":{"title":"presigned_urls","type":"array","description":"List of presigned URLs to the snapshots","items":{"title":"presigned_urls","type":"string"}}},"type":"object","additionalProperties":false}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"}}} as const
+;
+const PostPrivateGetAccount = {"body":{"required":["wallet"],"properties":{"wallet":{"title":"wallet","type":"string","description":"Ethereum wallet address of account"}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"},"response":{"200":{"required":["id","result"],"properties":{"id":{"anyOf":[{"title":"","type":"string"},{"title":"","type":"integer"}]},"result":{"required":["cancel_on_disconnect","subaccount_ids","wallet","websocket_matching_tps","websocket_non_matching_tps"],"properties":{"cancel_on_disconnect":{"title":"cancel_on_disconnect","type":"boolean","description":"Whether cancel on disconnect is enabled for the account"},"subaccount_ids":{"title":"subaccount_ids","type":"array","description":"List of subaccount_ids owned by the wallet in `SubAccounts.sol`","items":{"title":"subaccount_ids","type":"integer"}},"wallet":{"title":"wallet","type":"string","description":"Ethereum wallet address"},"websocket_matching_tps":{"title":"websocket_matching_tps","type":"integer","description":"Max transactions per second for matching requests over websocket (see `Rate Limiting` in docs)"},"websocket_non_matching_tps":{"title":"websocket_non_matching_tps","type":"integer","description":"Max transactions per second for non-matching requests over websocket (see `Rate Limiting` in docs)"}},"type":"object","additionalProperties":false}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"}}} as const
+;
+const PostPrivateGetCollaterals = {"body":{"required":["subaccount_id"],"properties":{"subaccount_id":{"title":"subaccount_id","type":"integer","description":"Subaccount_id"}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"},"response":{"200":{"required":["id","result"],"properties":{"id":{"anyOf":[{"title":"","type":"string"},{"title":"","type":"integer"}]},"result":{"required":["collaterals","subaccount_id"],"properties":{"collaterals":{"title":"collaterals","type":"array","description":"All collaterals that count towards margin of subaccount","items":{"required":["amount","asset_name","asset_type","cumulative_interest","currency","initial_margin","maintenance_margin","mark_price","mark_value","pending_interest"],"properties":{"amount":{"title":"amount","type":"string","format":"decimal","description":"Asset amount of given collateral"},"asset_name":{"title":"asset_name","type":"string","description":"Asset name"},"asset_type":{"title":"asset_type","type":"string","enum":["erc20","option","perp"],"description":"Type of asset collateral (currently always `erc20`)\n\n`erc20` `option` `perp`"},"cumulative_interest":{"title":"cumulative_interest","type":"string","format":"decimal","description":"Cumulative interest earned on supplying collateral or paid for borrowing"},"currency":{"title":"currency","type":"string","description":"Underlying currency of asset (`ETH`, `BTC`, etc)"},"initial_margin":{"title":"initial_margin","type":"string","format":"decimal","description":"USD value of collateral that contributes to initial margin"},"maintenance_margin":{"title":"maintenance_margin","type":"string","format":"decimal","description":"USD value of collateral that contributes to maintenance margin"},"mark_price":{"title":"mark_price","type":"string","format":"decimal","description":"Current mark price of the asset"},"mark_value":{"title":"mark_value","type":"string","format":"decimal","description":"USD value of the collateral (amount * mark price)"},"pending_interest":{"title":"pending_interest","type":"string","format":"decimal","description":"Portion of interest that has not yet been settled on-chain. This number is added to the portfolio value for margin calculations purposes."}},"type":"object","additionalProperties":false}},"subaccount_id":{"title":"subaccount_id","type":"integer","description":"Subaccount_id"}},"type":"object","additionalProperties":false}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"}}} as const
+;
+const PostPrivateGetDepositHistory = {"body":{"required":["subaccount_id"],"properties":{"end_timestamp":{"title":"end_timestamp","type":"integer","default":9223372036854776000,"description":"End timestamp of the event history (default current time)"},"start_timestamp":{"title":"start_timestamp","type":"integer","default":0,"description":"Start timestamp of the event history (default 0)"},"subaccount_id":{"title":"subaccount_id","type":"integer","description":"Subaccount id"}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"},"response":{"200":{"required":["id","result"],"properties":{"id":{"anyOf":[{"title":"","type":"string"},{"title":"","type":"integer"}]},"result":{"required":["events"],"properties":{"events":{"title":"events","type":"array","description":"List of deposit payments","items":{"required":["amount","asset","timestamp","tx_hash"],"properties":{"amount":{"title":"amount","type":"string","format":"decimal","description":"Amount deposited by the subaccount"},"asset":{"title":"asset","type":"string","description":"Asset deposited"},"timestamp":{"title":"timestamp","type":"integer","description":"Timestamp of the deposit (in ms since UNIX epoch)"},"tx_hash":{"title":"tx_hash","type":"string","description":"Hash of the transaction that deposited the funds"}},"type":"object","additionalProperties":false}}},"type":"object","additionalProperties":false}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"}}} as const
+;
+const PostPrivateGetErc20TransferHistory = {"body":{"required":["subaccount_id"],"properties":{"end_timestamp":{"title":"end_timestamp","type":"integer","default":9223372036854776000,"description":"End timestamp of the event history (default current time)"},"start_timestamp":{"title":"start_timestamp","type":"integer","default":0,"description":"Start timestamp of the event history (default 0)"},"subaccount_id":{"title":"subaccount_id","type":"integer","description":"Subaccount id"}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"},"response":{"200":{"required":["id","result"],"properties":{"id":{"anyOf":[{"title":"","type":"string"},{"title":"","type":"integer"}]},"result":{"required":["events"],"properties":{"events":{"title":"events","type":"array","description":"List of erc20 transfers","items":{"required":["amount","asset","counterparty_subaccount_id","is_outgoing","timestamp","tx_hash"],"properties":{"amount":{"title":"amount","type":"string","format":"decimal","description":"Amount withdrawn by the subaccount"},"asset":{"title":"asset","type":"string","description":"Asset withdrawn"},"counterparty_subaccount_id":{"title":"counterparty_subaccount_id","type":"integer","description":"Recipient or sender subaccount_id of transfer"},"is_outgoing":{"title":"is_outgoing","type":"boolean","description":"True if the transfer was initiated by the subaccount, False otherwise"},"timestamp":{"title":"timestamp","type":"integer","description":"Timestamp of the transfer (in ms since UNIX epoch)"},"tx_hash":{"title":"tx_hash","type":"string","description":"Hash of the transaction that withdrew the funds"}},"type":"object","additionalProperties":false}}},"type":"object","additionalProperties":false}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"}}} as const
+;
+const PostPrivateGetFundingHistory = {"body":{"required":["subaccount_id"],"properties":{"end_timestamp":{"title":"end_timestamp","type":"integer","default":9223372036854776000,"description":"End timestamp of the event history (default current time)"},"instrument_name":{"title":"instrument_name","type":["string","null"],"default":null,"description":"Instrument name (returns history for all perpetuals if not provided)"},"start_timestamp":{"title":"start_timestamp","type":"integer","default":0,"description":"Start timestamp of the event history (default 0)"},"subaccount_id":{"title":"subaccount_id","type":"integer","description":"Subaccount id"}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"},"response":{"200":{"required":["id","result"],"properties":{"id":{"anyOf":[{"title":"","type":"string"},{"title":"","type":"integer"}]},"result":{"required":["events"],"properties":{"events":{"title":"events","type":"array","description":"List of funding payments","items":{"required":["funding","instrument_name","timestamp"],"properties":{"funding":{"title":"funding","type":"string","format":"decimal","description":"Dollar funding paid (if negative) or received (if positive) by the subaccount"},"instrument_name":{"title":"instrument_name","type":"string","description":"Instrument name"},"timestamp":{"title":"timestamp","type":"integer","description":"Timestamp of the funding payment (in ms since UNIX epoch)"}},"type":"object","additionalProperties":false}}},"type":"object","additionalProperties":false}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"}}} as const
+;
+const PostPrivateGetInterestHistory = {"body":{"required":["subaccount_id"],"properties":{"end_timestamp":{"title":"end_timestamp","type":"integer","default":9223372036854776000,"description":"End timestamp of the event history (default current time)"},"start_timestamp":{"title":"start_timestamp","type":"integer","default":0,"description":"Start timestamp of the event history (default 0)"},"subaccount_id":{"title":"subaccount_id","type":"integer","description":"Subaccount id"}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"},"response":{"200":{"required":["id","result"],"properties":{"id":{"anyOf":[{"title":"","type":"string"},{"title":"","type":"integer"}]},"result":{"required":["events"],"properties":{"events":{"title":"events","type":"array","description":"List of interest payments","items":{"required":["interest","timestamp"],"properties":{"interest":{"title":"interest","type":"string","format":"decimal","description":"Dollar interest paid (if negative) or received (if positive) by the subaccount"},"timestamp":{"title":"timestamp","type":"integer","description":"Timestamp of the interest payment (in ms since UNIX epoch)"}},"type":"object","additionalProperties":false}}},"type":"object","additionalProperties":false}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"}}} as const
+;
+const PostPrivateGetLiquidationHistory = {"body":{"required":["subaccount_id"],"properties":{"end_timestamp":{"title":"end_timestamp","type":"integer","default":9223372036854776000,"description":"End timestamp of the event history (default current time)"},"start_timestamp":{"title":"start_timestamp","type":"integer","default":0,"description":"Start timestamp of the event history (default 0)"},"subaccount_id":{"title":"subaccount_id","type":"integer","description":"Subaccount id"}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"},"response":{"200":{"required":["id","result"],"properties":{"id":{"anyOf":[{"title":"","type":"string"},{"title":"","type":"integer"}]},"result":{"title":"result","type":"array","description":"","items":{"required":["auction_id","auction_type","bids","end_timestamp","fee","start_timestamp","tx_hash"],"properties":{"auction_id":{"title":"auction_id","type":"string","description":"Unique ID of the auction"},"auction_type":{"title":"auction_type","type":"string","enum":["solvent","insolvent"],"description":"Type of auction\n\n`solvent` `insolvent`"},"bids":{"title":"bids","type":"array","description":"List of auction bid events","items":{"required":["amounts_liquidated","cash_received","discount_pnl","percent_liquidated","positions_realized_pnl","realized_pnl","timestamp","tx_hash"],"properties":{"amounts_liquidated":{"title":"amounts_liquidated","type":"object","description":"Amounts of each asset that were closed","additionalProperties":{"title":"amounts_liquidated","type":"string","format":"decimal"}},"cash_received":{"title":"cash_received","type":"string","format":"decimal","description":"Cash received for auctioning off the percentage of the subaccount"},"discount_pnl":{"title":"discount_pnl","type":"string","format":"decimal","description":"Realized PnL due to being liquidated at a discount to mark portfolio value"},"percent_liquidated":{"title":"percent_liquidated","type":"string","format":"decimal","description":"Percent of the subaccount that was liquidated"},"positions_realized_pnl":{"title":"positions_realized_pnl","type":"object","description":"Realized PnL of each position that was closed","additionalProperties":{"title":"positions_realized_pnl","type":"string","format":"decimal"}},"realized_pnl":{"title":"realized_pnl","type":"string","format":"decimal","description":"Realized PnL of the auction bid, assuming positions are closed at mark price at the time of the liquidation"},"timestamp":{"title":"timestamp","type":"integer","description":"Timestamp of the bid (in ms since UNIX epoch)"},"tx_hash":{"title":"tx_hash","type":"string","description":"Hash of the bid transaction"}},"type":"object","additionalProperties":false}},"end_timestamp":{"title":"end_timestamp","type":["integer","null"],"default":null,"description":"Timestamp of the auction end (in ms since UNIX epoch), or `null` if not ended"},"fee":{"title":"fee","type":"string","format":"decimal","description":"Fee paid by the subaccount"},"start_timestamp":{"title":"start_timestamp","type":"integer","description":"Timestamp of the auction start (in ms since UNIX epoch)"},"tx_hash":{"title":"tx_hash","type":"string","description":"Hash of the transaction that started the auction"}},"type":"object","additionalProperties":false}}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"}}} as const
+;
+const PostPrivateGetMargin = {"body":{"required":["subaccount_id"],"properties":{"simulated_position_changes":{"title":"simulated_position_changes","type":["array","null"],"default":null,"description":"Optional, add positions to simulate a trade","items":{"required":["amount","instrument_name"],"properties":{"amount":{"title":"amount","type":"string","format":"decimal","description":"Position amount to simulate"},"entry_price":{"title":"entry_price","type":["string","null"],"format":"decimal","default":null,"description":"Only for perps. Entry price to use in the simulation. Mark price is used if not provided."},"instrument_name":{"title":"instrument_name","type":"string","description":"Instrument name"}},"type":"object","additionalProperties":false}},"subaccount_id":{"title":"subaccount_id","type":"integer","description":"Subaccount_id"}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"},"response":{"200":{"required":["id","result"],"properties":{"id":{"anyOf":[{"title":"","type":"string"},{"title":"","type":"integer"}]},"result":{"required":["is_valid_trade","post_initial_margin","post_maintenance_margin","pre_initial_margin","pre_maintenance_margin","subaccount_id"],"properties":{"is_valid_trade":{"title":"is_valid_trade","type":"boolean","description":"True if trade passes margin requirement"},"post_initial_margin":{"title":"post_initial_margin","type":"string","format":"decimal","description":"Initial margin requirement post trade"},"post_maintenance_margin":{"title":"post_maintenance_margin","type":"string","format":"decimal","description":"Maintenance margin requirement post trade"},"pre_initial_margin":{"title":"pre_initial_margin","type":"string","format":"decimal","description":"Initial margin requirement before trade"},"pre_maintenance_margin":{"title":"pre_maintenance_margin","type":"string","format":"decimal","description":"Maintenance margin requirement before trade"},"subaccount_id":{"title":"subaccount_id","type":"integer","description":"Subaccount_id"}},"type":"object","additionalProperties":false}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"}}} as const
+;
+const PostPrivateGetMmpConfig = {"body":{"required":["subaccount_id"],"properties":{"currency":{"title":"currency","type":["string","null"],"default":null,"description":"Currency to get the config for. If not provided, returns all configs for the subaccount"},"subaccount_id":{"title":"subaccount_id","type":"integer","description":"Subaccount_id for which to get the config"}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"},"response":{"200":{"required":["id","result"],"properties":{"id":{"anyOf":[{"title":"","type":"string"},{"title":"","type":"integer"}]},"result":{"title":"result","type":"array","description":"","items":{"required":["currency","mmp_frozen_time","mmp_interval","subaccount_id"],"properties":{"currency":{"title":"currency","type":"string","description":"Currency of this mmp config"},"mmp_amount_limit":{"title":"mmp_amount_limit","type":"string","format":"decimal","default":"0","description":"Maximum total order amount that can be traded within the mmp_interval across all instruments of the provided currency. The amounts are not netted, so a filled bid of 1 and a filled ask of 2 would count as 3.
Default: 0 (no limit)"},"mmp_delta_limit":{"title":"mmp_delta_limit","type":"string","format":"decimal","default":"0","description":"Maximum total delta that can be traded within the mmp_interval across all instruments of the provided currency. This quantity is netted, so a filled order with +1 delta and a filled order with -2 delta would count as -1
Default: 0 (no limit)"},"mmp_frozen_time":{"title":"mmp_frozen_time","type":"integer","description":"Time interval in ms setting how long the subaccount is frozen after an mmp trigger, if 0 then a manual reset would be required via private/reset_mmp"},"mmp_interval":{"title":"mmp_interval","type":"integer","description":"Time interval in ms over which the limits are monotored, if 0 then mmp is disabled"},"subaccount_id":{"title":"subaccount_id","type":"integer","description":"Subaccount_id for which to set the config"}},"type":"object","additionalProperties":false}}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"}}} as const
+;
+const PostPrivateGetNotifications = {"body":{"required":["subaccount_id"],"properties":{"page":{"title":"page","type":"integer","default":1,"description":"Page number of results to return"},"page_size":{"title":"page_size","type":"integer","default":20,"description":"Number of results per page"},"status":{"title":"status","type":["string","null"],"default":null,"enum":["unseen","seen","hidden"],"description":"Status of the notification\n\nDefault: `null`"},"subaccount_id":{"title":"subaccount_id","type":"integer","description":"Subaccount_id"},"type":{"title":"type","type":["string","null"],"default":null,"enum":["deposit","withdraw","transfer","trade","settlement","liquidation","custom"],"description":"Status of the notification\n\nDefault: `null`"}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"},"response":{"200":{"required":["id","result"],"properties":{"id":{"anyOf":[{"title":"","type":"string"},{"title":"","type":"integer"}]},"result":{"required":["notifications","subaccount_id"],"properties":{"notifications":{"title":"notifications","type":"array","description":"Notification response","items":{"required":["event","event_details","id","status","subaccount_id","timestamp"],"properties":{"event":{"title":"event","type":"string","description":"The specific event leading to the notification."},"event_details":{"title":"event_details","type":"object","description":"A JSON-structured dictionary containing detailed data or context about the event.","additionalProperties":true},"id":{"title":"id","type":"integer","description":"The unique identifier for the notification."},"status":{"title":"status","type":"string","description":"The status of the notification, indicating if it has been read, pending, or processed."},"subaccount_id":{"title":"subaccount_id","type":"integer","description":"The subaccount_id associated with the notification."},"timestamp":{"title":"timestamp","type":"integer","description":"The timestamp indicating when the notification was created or triggered."},"transaction_id":{"title":"transaction_id","type":["integer","null"],"default":null,"description":"The transaction id associated with the notification."},"tx_hash":{"title":"tx_hash","type":["string","null"],"default":null,"description":"The transaction hash associated with the notification."}},"type":"object","additionalProperties":false}},"subaccount_id":{"title":"subaccount_id","type":"integer","description":"Subaccount_id"}},"type":"object","additionalProperties":false}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"}}} as const
+;
+const PostPrivateGetOpenOrders = {"body":{"required":["subaccount_id"],"properties":{"subaccount_id":{"title":"subaccount_id","type":"integer","description":"Subaccount_id for which to get open orders"}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"},"response":{"200":{"required":["id","result"],"properties":{"id":{"anyOf":[{"title":"","type":"string"},{"title":"","type":"integer"}]},"result":{"required":["orders","subaccount_id"],"properties":{"orders":{"title":"orders","type":"array","description":"List of open orders","items":{"required":["amount","average_price","cancel_reason","creation_timestamp","direction","filled_amount","instrument_name","is_transfer","label","last_update_timestamp","limit_price","max_fee","mmp","nonce","order_fee","order_id","order_status","order_type","signature","signature_expiry_sec","signer","subaccount_id","time_in_force"],"properties":{"amount":{"title":"amount","type":"string","format":"decimal","description":"Order amount in units of the base"},"average_price":{"title":"average_price","type":"string","format":"decimal","description":"Average fill price"},"cancel_reason":{"title":"cancel_reason","type":"string","enum":["","user_request","mmp_trigger","insufficient_margin","signed_max_fee_too_low","cancel_on_disconnect","ioc_or_market_partial_fill","session_key_deregistered","subaccount_withdrawn","compliance"],"description":"If cancelled, reason behind order cancellation\n\n`user_request` `mmp_trigger` `insufficient_margin` `signed_max_fee_too_low` `cancel_on_disconnect` `ioc_or_market_partial_fill` `session_key_deregistered` `subaccount_withdrawn` `compliance`"},"creation_timestamp":{"title":"creation_timestamp","type":"integer","description":"Creation timestamp (in ms since Unix epoch)"},"direction":{"title":"direction","type":"string","enum":["buy","sell"],"description":"Order direction\n\n`buy` `sell`"},"filled_amount":{"title":"filled_amount","type":"string","format":"decimal","description":"Total filled amount for the order"},"instrument_name":{"title":"instrument_name","type":"string","description":"Instrument name"},"is_transfer":{"title":"is_transfer","type":"boolean","description":"Whether the order was generated through `private/transfer_position`"},"label":{"title":"label","type":"string","description":"Optional user-defined label for the order"},"last_update_timestamp":{"title":"last_update_timestamp","type":"integer","description":"Last update timestamp (in ms since Unix epoch)"},"limit_price":{"title":"limit_price","type":"string","format":"decimal","description":"Limit price in quote currency"},"max_fee":{"title":"max_fee","type":"string","format":"decimal","description":"Max fee in units of the quote currency"},"mmp":{"title":"mmp","type":"boolean","description":"Whether the order is tagged for market maker protections"},"nonce":{"title":"nonce","type":"integer","description":"Unique nonce defined as (e.g. 1695836058725001, where 001 is the random number)"},"order_fee":{"title":"order_fee","type":"string","format":"decimal","description":"Total order fee paid so far"},"order_id":{"title":"order_id","type":"string","description":"Order ID"},"order_status":{"title":"order_status","type":"string","enum":["open","filled","rejected","cancelled","expired"],"description":"Order status\n\n`open` `filled` `rejected` `cancelled` `expired`"},"order_type":{"title":"order_type","type":"string","enum":["limit","market"],"description":"Order type\n\n`limit` `market`"},"signature":{"title":"signature","type":"string","description":"Ethereum signature of the order"},"signature_expiry_sec":{"title":"signature_expiry_sec","type":"integer","description":"Signature expiry timestamp"},"signer":{"title":"signer","type":"string","description":"Owner wallet address or registered session key that signed order"},"subaccount_id":{"title":"subaccount_id","type":"integer","description":"Subaccount ID"},"time_in_force":{"title":"time_in_force","type":"string","enum":["gtc","post_only","fok","ioc"],"description":"Time in force\n\n`gtc` `post_only` `fok` `ioc`"}},"type":"object","additionalProperties":false}},"subaccount_id":{"title":"subaccount_id","type":"integer","description":"Subaccount_id for which to get open orders"}},"type":"object","additionalProperties":false}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"}}} as const
+;
+const PostPrivateGetOptionSettlementHistory = {"body":{"required":["subaccount_id"],"properties":{"subaccount_id":{"title":"subaccount_id","type":"integer","description":"Subaccount_id for which to get expired option settlement history"}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"},"response":{"200":{"required":["id","result"],"properties":{"id":{"anyOf":[{"title":"","type":"string"},{"title":"","type":"integer"}]},"result":{"required":["settlements","subaccount_id"],"properties":{"settlements":{"title":"settlements","type":"array","description":"List of expired option settlements","items":{"required":["amount","expiry","instrument_name","option_settlement_pnl","settlement_price"],"properties":{"amount":{"title":"amount","type":"string","format":"decimal","description":"Amount that was settled"},"expiry":{"title":"expiry","type":"integer","description":"Expiry timestamp of the option"},"instrument_name":{"title":"instrument_name","type":"string","description":"Instrument name"},"option_settlement_pnl":{"title":"option_settlement_pnl","type":"string","format":"decimal","description":"USD profit or loss from option settlements calculated as: settlement value - (average price x amount)"},"settlement_price":{"title":"settlement_price","type":"string","format":"decimal","description":"Price of option settlement"}},"type":"object","additionalProperties":false}},"subaccount_id":{"title":"subaccount_id","type":"integer","description":"Subaccount_id for which to get expired option settlement history"}},"type":"object","additionalProperties":false}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"}}} as const
+;
+const PostPrivateGetOrder = {"body":{"required":["order_id","subaccount_id"],"properties":{"order_id":{"title":"order_id","type":"string","description":"Order ID"},"subaccount_id":{"title":"subaccount_id","type":"integer","description":"Subaccount ID"}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"},"response":{"200":{"required":["id","result"],"properties":{"id":{"anyOf":[{"title":"","type":"string"},{"title":"","type":"integer"}]},"result":{"required":["amount","average_price","cancel_reason","creation_timestamp","direction","filled_amount","instrument_name","is_transfer","label","last_update_timestamp","limit_price","max_fee","mmp","nonce","order_fee","order_id","order_status","order_type","signature","signature_expiry_sec","signer","subaccount_id","time_in_force"],"properties":{"amount":{"title":"amount","type":"string","format":"decimal","description":"Order amount in units of the base"},"average_price":{"title":"average_price","type":"string","format":"decimal","description":"Average fill price"},"cancel_reason":{"title":"cancel_reason","type":"string","enum":["","user_request","mmp_trigger","insufficient_margin","signed_max_fee_too_low","cancel_on_disconnect","ioc_or_market_partial_fill","session_key_deregistered","subaccount_withdrawn","compliance"],"description":"If cancelled, reason behind order cancellation\n\n`user_request` `mmp_trigger` `insufficient_margin` `signed_max_fee_too_low` `cancel_on_disconnect` `ioc_or_market_partial_fill` `session_key_deregistered` `subaccount_withdrawn` `compliance`"},"creation_timestamp":{"title":"creation_timestamp","type":"integer","description":"Creation timestamp (in ms since Unix epoch)"},"direction":{"title":"direction","type":"string","enum":["buy","sell"],"description":"Order direction\n\n`buy` `sell`"},"filled_amount":{"title":"filled_amount","type":"string","format":"decimal","description":"Total filled amount for the order"},"instrument_name":{"title":"instrument_name","type":"string","description":"Instrument name"},"is_transfer":{"title":"is_transfer","type":"boolean","description":"Whether the order was generated through `private/transfer_position`"},"label":{"title":"label","type":"string","description":"Optional user-defined label for the order"},"last_update_timestamp":{"title":"last_update_timestamp","type":"integer","description":"Last update timestamp (in ms since Unix epoch)"},"limit_price":{"title":"limit_price","type":"string","format":"decimal","description":"Limit price in quote currency"},"max_fee":{"title":"max_fee","type":"string","format":"decimal","description":"Max fee in units of the quote currency"},"mmp":{"title":"mmp","type":"boolean","description":"Whether the order is tagged for market maker protections"},"nonce":{"title":"nonce","type":"integer","description":"Unique nonce defined as (e.g. 1695836058725001, where 001 is the random number)"},"order_fee":{"title":"order_fee","type":"string","format":"decimal","description":"Total order fee paid so far"},"order_id":{"title":"order_id","type":"string","description":"Order ID"},"order_status":{"title":"order_status","type":"string","enum":["open","filled","rejected","cancelled","expired"],"description":"Order status\n\n`open` `filled` `rejected` `cancelled` `expired`"},"order_type":{"title":"order_type","type":"string","enum":["limit","market"],"description":"Order type\n\n`limit` `market`"},"signature":{"title":"signature","type":"string","description":"Ethereum signature of the order"},"signature_expiry_sec":{"title":"signature_expiry_sec","type":"integer","description":"Signature expiry timestamp"},"signer":{"title":"signer","type":"string","description":"Owner wallet address or registered session key that signed order"},"subaccount_id":{"title":"subaccount_id","type":"integer","description":"Subaccount ID"},"time_in_force":{"title":"time_in_force","type":"string","enum":["gtc","post_only","fok","ioc"],"description":"Time in force\n\n`gtc` `post_only` `fok` `ioc`"}},"type":"object","additionalProperties":false}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"}}} as const
+;
+const PostPrivateGetOrderHistory = {"body":{"required":["subaccount_id"],"properties":{"page":{"title":"page","type":"integer","default":1,"description":"Page number of results to return (default 1, returns last if above `num_pages`)"},"page_size":{"title":"page_size","type":"integer","default":100,"description":"Number of results per page (default 100, max 1000)"},"subaccount_id":{"title":"subaccount_id","type":"integer","description":"Subaccount_id for which to get order history"}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"},"response":{"200":{"required":["id","result"],"properties":{"id":{"anyOf":[{"title":"","type":"string"},{"title":"","type":"integer"}]},"result":{"required":["orders","pagination","subaccount_id"],"properties":{"orders":{"title":"orders","type":"array","description":"List of open orders","items":{"required":["amount","average_price","cancel_reason","creation_timestamp","direction","filled_amount","instrument_name","is_transfer","label","last_update_timestamp","limit_price","max_fee","mmp","nonce","order_fee","order_id","order_status","order_type","signature","signature_expiry_sec","signer","subaccount_id","time_in_force"],"properties":{"amount":{"title":"amount","type":"string","format":"decimal","description":"Order amount in units of the base"},"average_price":{"title":"average_price","type":"string","format":"decimal","description":"Average fill price"},"cancel_reason":{"title":"cancel_reason","type":"string","enum":["","user_request","mmp_trigger","insufficient_margin","signed_max_fee_too_low","cancel_on_disconnect","ioc_or_market_partial_fill","session_key_deregistered","subaccount_withdrawn","compliance"],"description":"If cancelled, reason behind order cancellation\n\n`user_request` `mmp_trigger` `insufficient_margin` `signed_max_fee_too_low` `cancel_on_disconnect` `ioc_or_market_partial_fill` `session_key_deregistered` `subaccount_withdrawn` `compliance`"},"creation_timestamp":{"title":"creation_timestamp","type":"integer","description":"Creation timestamp (in ms since Unix epoch)"},"direction":{"title":"direction","type":"string","enum":["buy","sell"],"description":"Order direction\n\n`buy` `sell`"},"filled_amount":{"title":"filled_amount","type":"string","format":"decimal","description":"Total filled amount for the order"},"instrument_name":{"title":"instrument_name","type":"string","description":"Instrument name"},"is_transfer":{"title":"is_transfer","type":"boolean","description":"Whether the order was generated through `private/transfer_position`"},"label":{"title":"label","type":"string","description":"Optional user-defined label for the order"},"last_update_timestamp":{"title":"last_update_timestamp","type":"integer","description":"Last update timestamp (in ms since Unix epoch)"},"limit_price":{"title":"limit_price","type":"string","format":"decimal","description":"Limit price in quote currency"},"max_fee":{"title":"max_fee","type":"string","format":"decimal","description":"Max fee in units of the quote currency"},"mmp":{"title":"mmp","type":"boolean","description":"Whether the order is tagged for market maker protections"},"nonce":{"title":"nonce","type":"integer","description":"Unique nonce defined as (e.g. 1695836058725001, where 001 is the random number)"},"order_fee":{"title":"order_fee","type":"string","format":"decimal","description":"Total order fee paid so far"},"order_id":{"title":"order_id","type":"string","description":"Order ID"},"order_status":{"title":"order_status","type":"string","enum":["open","filled","rejected","cancelled","expired"],"description":"Order status\n\n`open` `filled` `rejected` `cancelled` `expired`"},"order_type":{"title":"order_type","type":"string","enum":["limit","market"],"description":"Order type\n\n`limit` `market`"},"signature":{"title":"signature","type":"string","description":"Ethereum signature of the order"},"signature_expiry_sec":{"title":"signature_expiry_sec","type":"integer","description":"Signature expiry timestamp"},"signer":{"title":"signer","type":"string","description":"Owner wallet address or registered session key that signed order"},"subaccount_id":{"title":"subaccount_id","type":"integer","description":"Subaccount ID"},"time_in_force":{"title":"time_in_force","type":"string","enum":["gtc","post_only","fok","ioc"],"description":"Time in force\n\n`gtc` `post_only` `fok` `ioc`"}},"type":"object","additionalProperties":false}},"pagination":{"required":["count","num_pages"],"properties":{"count":{"title":"count","type":"integer","description":"Total number of items, across all pages"},"num_pages":{"title":"num_pages","type":"integer","description":"Number of pages"}},"type":"object","additionalProperties":false},"subaccount_id":{"title":"subaccount_id","type":"integer","description":"Subaccount_id for which to get open orders"}},"type":"object","additionalProperties":false}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"}}} as const
+;
+const PostPrivateGetOrders = {"body":{"required":["subaccount_id"],"properties":{"instrument_name":{"title":"instrument_name","type":["string","null"],"default":null,"description":"Filter by instrument name"},"label":{"title":"label","type":["string","null"],"default":null,"description":"Filter by label"},"page":{"title":"page","type":"integer","default":1,"description":"Page number of results to return (default 1, returns last if above `num_pages`)"},"page_size":{"title":"page_size","type":"integer","default":100,"description":"Number of results per page (default 100, max 1000)"},"status":{"title":"status","type":["string","null"],"default":null,"enum":["open","filled","rejected","cancelled","expired"],"description":"Filter by order status\n\nDefault: `null`"},"subaccount_id":{"title":"subaccount_id","type":"integer","description":"Subaccount_id for which to get open orders"}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"},"response":{"200":{"required":["id","result"],"properties":{"id":{"anyOf":[{"title":"","type":"string"},{"title":"","type":"integer"}]},"result":{"required":["orders","pagination","subaccount_id"],"properties":{"orders":{"title":"orders","type":"array","description":"List of open orders","items":{"required":["amount","average_price","cancel_reason","creation_timestamp","direction","filled_amount","instrument_name","is_transfer","label","last_update_timestamp","limit_price","max_fee","mmp","nonce","order_fee","order_id","order_status","order_type","signature","signature_expiry_sec","signer","subaccount_id","time_in_force"],"properties":{"amount":{"title":"amount","type":"string","format":"decimal","description":"Order amount in units of the base"},"average_price":{"title":"average_price","type":"string","format":"decimal","description":"Average fill price"},"cancel_reason":{"title":"cancel_reason","type":"string","enum":["","user_request","mmp_trigger","insufficient_margin","signed_max_fee_too_low","cancel_on_disconnect","ioc_or_market_partial_fill","session_key_deregistered","subaccount_withdrawn","compliance"],"description":"If cancelled, reason behind order cancellation\n\n`user_request` `mmp_trigger` `insufficient_margin` `signed_max_fee_too_low` `cancel_on_disconnect` `ioc_or_market_partial_fill` `session_key_deregistered` `subaccount_withdrawn` `compliance`"},"creation_timestamp":{"title":"creation_timestamp","type":"integer","description":"Creation timestamp (in ms since Unix epoch)"},"direction":{"title":"direction","type":"string","enum":["buy","sell"],"description":"Order direction\n\n`buy` `sell`"},"filled_amount":{"title":"filled_amount","type":"string","format":"decimal","description":"Total filled amount for the order"},"instrument_name":{"title":"instrument_name","type":"string","description":"Instrument name"},"is_transfer":{"title":"is_transfer","type":"boolean","description":"Whether the order was generated through `private/transfer_position`"},"label":{"title":"label","type":"string","description":"Optional user-defined label for the order"},"last_update_timestamp":{"title":"last_update_timestamp","type":"integer","description":"Last update timestamp (in ms since Unix epoch)"},"limit_price":{"title":"limit_price","type":"string","format":"decimal","description":"Limit price in quote currency"},"max_fee":{"title":"max_fee","type":"string","format":"decimal","description":"Max fee in units of the quote currency"},"mmp":{"title":"mmp","type":"boolean","description":"Whether the order is tagged for market maker protections"},"nonce":{"title":"nonce","type":"integer","description":"Unique nonce defined as (e.g. 1695836058725001, where 001 is the random number)"},"order_fee":{"title":"order_fee","type":"string","format":"decimal","description":"Total order fee paid so far"},"order_id":{"title":"order_id","type":"string","description":"Order ID"},"order_status":{"title":"order_status","type":"string","enum":["open","filled","rejected","cancelled","expired"],"description":"Order status\n\n`open` `filled` `rejected` `cancelled` `expired`"},"order_type":{"title":"order_type","type":"string","enum":["limit","market"],"description":"Order type\n\n`limit` `market`"},"signature":{"title":"signature","type":"string","description":"Ethereum signature of the order"},"signature_expiry_sec":{"title":"signature_expiry_sec","type":"integer","description":"Signature expiry timestamp"},"signer":{"title":"signer","type":"string","description":"Owner wallet address or registered session key that signed order"},"subaccount_id":{"title":"subaccount_id","type":"integer","description":"Subaccount ID"},"time_in_force":{"title":"time_in_force","type":"string","enum":["gtc","post_only","fok","ioc"],"description":"Time in force\n\n`gtc` `post_only` `fok` `ioc`"}},"type":"object","additionalProperties":false}},"pagination":{"required":["count","num_pages"],"properties":{"count":{"title":"count","type":"integer","description":"Total number of items, across all pages"},"num_pages":{"title":"num_pages","type":"integer","description":"Number of pages"}},"type":"object","additionalProperties":false},"subaccount_id":{"title":"subaccount_id","type":"integer","description":"Subaccount_id for which to get open orders"}},"type":"object","additionalProperties":false}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"}}} as const
+;
+const PostPrivateGetPositions = {"body":{"required":["subaccount_id"],"properties":{"subaccount_id":{"title":"subaccount_id","type":"integer","description":"Subaccount_id"}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"},"response":{"200":{"required":["id","result"],"properties":{"id":{"anyOf":[{"title":"","type":"string"},{"title":"","type":"integer"}]},"result":{"required":["positions","subaccount_id"],"properties":{"positions":{"title":"positions","type":"array","description":"All active positions of subaccount","items":{"required":["amount","average_price","cumulative_funding","delta","gamma","index_price","initial_margin","instrument_name","instrument_type","leverage","liquidation_price","maintenance_margin","mark_price","mark_value","net_settlements","open_orders_margin","pending_funding","realized_pnl","theta","unrealized_pnl","vega"],"properties":{"amount":{"title":"amount","type":"string","format":"decimal","description":"Position amount held by subaccount"},"average_price":{"title":"average_price","type":"string","format":"decimal","description":"Average price of whole position"},"cumulative_funding":{"title":"cumulative_funding","type":"string","format":"decimal","description":"Cumulative funding for the position (only for perpetuals)."},"delta":{"title":"delta","type":"string","format":"decimal","description":"Asset delta (w.r.t. forward price for options, `1.0` for perps)"},"gamma":{"title":"gamma","type":"string","format":"decimal","description":"Asset gamma (zero for non-options)"},"index_price":{"title":"index_price","type":"string","format":"decimal","description":"Current index (oracle) price for position's currency"},"initial_margin":{"title":"initial_margin","type":"string","format":"decimal","description":"USD initial margin requirement for this position"},"instrument_name":{"title":"instrument_name","type":"string","description":"Instrument name (same as the base Asset name)"},"instrument_type":{"title":"instrument_type","type":"string","enum":["erc20","option","perp"],"description":"`erc20`, `option`, or `perp`\n\n`erc20` `option` `perp`"},"leverage":{"title":"leverage","type":["string","null"],"format":"decimal","default":null,"description":"Only for perps. Leverage of the position, defined as `abs(notional) / collateral net of options margin`"},"liquidation_price":{"title":"liquidation_price","type":["string","null"],"format":"decimal","default":null,"description":"Index price at which position will be liquidated"},"maintenance_margin":{"title":"maintenance_margin","type":"string","format":"decimal","description":"USD maintenance margin requirement for this position"},"mark_price":{"title":"mark_price","type":"string","format":"decimal","description":"Current mark price for position's instrument"},"mark_value":{"title":"mark_value","type":"string","format":"decimal","description":"USD value of the position; this represents how much USD can be recieved by fully closing the position at the current oracle price"},"net_settlements":{"title":"net_settlements","type":"string","format":"decimal","description":"Net amount of USD from position settlements that has been paid to the user's subaccount. This number is subtracted from the portfolio value for margin calculations purposes.
Positive values mean the user has recieved USD from settlements, or is awaiting settlement of USD losses. Negative values mean the user has paid USD for settlements, or is awaiting settlement of USD gains."},"open_orders_margin":{"title":"open_orders_margin","type":"string","format":"decimal","description":"USD margin requirement for all open orders for this asset / instrument"},"pending_funding":{"title":"pending_funding","type":"string","format":"decimal","description":"A portion of funding payments that has not yet been settled into cash balance (only for perpetuals). This number is added to the portfolio value for margin calculations purposes."},"realized_pnl":{"title":"realized_pnl","type":"string","format":"decimal","description":"Realized trading profit or loss of the position."},"theta":{"title":"theta","type":"string","format":"decimal","description":"Asset theta (zero for non-options)"},"unrealized_pnl":{"title":"unrealized_pnl","type":"string","format":"decimal","description":"Unrealized trading profit or loss of the position."},"vega":{"title":"vega","type":"string","format":"decimal","description":"Asset vega (zero for non-options)"}},"type":"object","additionalProperties":false}},"subaccount_id":{"title":"subaccount_id","type":"integer","description":"Subaccount_id"}},"type":"object","additionalProperties":false}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"}}} as const
+;
+const PostPrivateGetSubaccount = {"body":{"required":["subaccount_id"],"properties":{"subaccount_id":{"title":"subaccount_id","type":"integer","description":"Subaccount_id"}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"},"response":{"200":{"required":["id","result"],"properties":{"id":{"anyOf":[{"title":"","type":"string"},{"title":"","type":"integer"}]},"result":{"required":["collaterals","collaterals_initial_margin","collaterals_maintenance_margin","collaterals_value","currency","initial_margin","maintenance_margin","margin_type","open_orders","open_orders_margin","positions","positions_initial_margin","positions_maintenance_margin","positions_value","subaccount_id","subaccount_value"],"properties":{"collaterals":{"title":"collaterals","type":"array","description":"All collaterals that count towards margin of subaccount","items":{"required":["amount","asset_name","asset_type","cumulative_interest","currency","initial_margin","maintenance_margin","mark_price","mark_value","pending_interest"],"properties":{"amount":{"title":"amount","type":"string","format":"decimal","description":"Asset amount of given collateral"},"asset_name":{"title":"asset_name","type":"string","description":"Asset name"},"asset_type":{"title":"asset_type","type":"string","enum":["erc20","option","perp"],"description":"Type of asset collateral (currently always `erc20`)\n\n`erc20` `option` `perp`"},"cumulative_interest":{"title":"cumulative_interest","type":"string","format":"decimal","description":"Cumulative interest earned on supplying collateral or paid for borrowing"},"currency":{"title":"currency","type":"string","description":"Underlying currency of asset (`ETH`, `BTC`, etc)"},"initial_margin":{"title":"initial_margin","type":"string","format":"decimal","description":"USD value of collateral that contributes to initial margin"},"maintenance_margin":{"title":"maintenance_margin","type":"string","format":"decimal","description":"USD value of collateral that contributes to maintenance margin"},"mark_price":{"title":"mark_price","type":"string","format":"decimal","description":"Current mark price of the asset"},"mark_value":{"title":"mark_value","type":"string","format":"decimal","description":"USD value of the collateral (amount * mark price)"},"pending_interest":{"title":"pending_interest","type":"string","format":"decimal","description":"Portion of interest that has not yet been settled on-chain. This number is added to the portfolio value for margin calculations purposes."}},"type":"object","additionalProperties":false}},"collaterals_initial_margin":{"title":"collaterals_initial_margin","type":"string","format":"decimal","description":"Total initial margin credit contributed by collaterals"},"collaterals_maintenance_margin":{"title":"collaterals_maintenance_margin","type":"string","format":"decimal","description":"Total maintenance margin credit contributed by collaterals"},"collaterals_value":{"title":"collaterals_value","type":"string","format":"decimal","description":"Total mark-to-market value of all collaterals"},"currency":{"title":"currency","type":"string","description":"Currency of subaccount"},"initial_margin":{"title":"initial_margin","type":"string","format":"decimal","description":"Total initial margin requirement of all positions and collaterals.Trades will be rejected if this value falls below zero after the trade."},"maintenance_margin":{"title":"maintenance_margin","type":"string","format":"decimal","description":"Total maintenance margin requirement of all positions and collaterals.If this value falls below zero, the subaccount will be flagged for liquidation."},"margin_type":{"title":"margin_type","type":"string","enum":["PM","SM"],"description":"Margin type of subaccount (`PM` (Portfolio Margin) or `SM` (Standard Margin))\n\n`PM` `SM`"},"open_orders":{"title":"open_orders","type":"array","description":"All open orders of subaccount","items":{"required":["amount","average_price","cancel_reason","creation_timestamp","direction","filled_amount","instrument_name","is_transfer","label","last_update_timestamp","limit_price","max_fee","mmp","nonce","order_fee","order_id","order_status","order_type","signature","signature_expiry_sec","signer","subaccount_id","time_in_force"],"properties":{"amount":{"title":"amount","type":"string","format":"decimal","description":"Order amount in units of the base"},"average_price":{"title":"average_price","type":"string","format":"decimal","description":"Average fill price"},"cancel_reason":{"title":"cancel_reason","type":"string","enum":["","user_request","mmp_trigger","insufficient_margin","signed_max_fee_too_low","cancel_on_disconnect","ioc_or_market_partial_fill","session_key_deregistered","subaccount_withdrawn","compliance"],"description":"If cancelled, reason behind order cancellation\n\n`user_request` `mmp_trigger` `insufficient_margin` `signed_max_fee_too_low` `cancel_on_disconnect` `ioc_or_market_partial_fill` `session_key_deregistered` `subaccount_withdrawn` `compliance`"},"creation_timestamp":{"title":"creation_timestamp","type":"integer","description":"Creation timestamp (in ms since Unix epoch)"},"direction":{"title":"direction","type":"string","enum":["buy","sell"],"description":"Order direction\n\n`buy` `sell`"},"filled_amount":{"title":"filled_amount","type":"string","format":"decimal","description":"Total filled amount for the order"},"instrument_name":{"title":"instrument_name","type":"string","description":"Instrument name"},"is_transfer":{"title":"is_transfer","type":"boolean","description":"Whether the order was generated through `private/transfer_position`"},"label":{"title":"label","type":"string","description":"Optional user-defined label for the order"},"last_update_timestamp":{"title":"last_update_timestamp","type":"integer","description":"Last update timestamp (in ms since Unix epoch)"},"limit_price":{"title":"limit_price","type":"string","format":"decimal","description":"Limit price in quote currency"},"max_fee":{"title":"max_fee","type":"string","format":"decimal","description":"Max fee in units of the quote currency"},"mmp":{"title":"mmp","type":"boolean","description":"Whether the order is tagged for market maker protections"},"nonce":{"title":"nonce","type":"integer","description":"Unique nonce defined as (e.g. 1695836058725001, where 001 is the random number)"},"order_fee":{"title":"order_fee","type":"string","format":"decimal","description":"Total order fee paid so far"},"order_id":{"title":"order_id","type":"string","description":"Order ID"},"order_status":{"title":"order_status","type":"string","enum":["open","filled","rejected","cancelled","expired"],"description":"Order status\n\n`open` `filled` `rejected` `cancelled` `expired`"},"order_type":{"title":"order_type","type":"string","enum":["limit","market"],"description":"Order type\n\n`limit` `market`"},"signature":{"title":"signature","type":"string","description":"Ethereum signature of the order"},"signature_expiry_sec":{"title":"signature_expiry_sec","type":"integer","description":"Signature expiry timestamp"},"signer":{"title":"signer","type":"string","description":"Owner wallet address or registered session key that signed order"},"subaccount_id":{"title":"subaccount_id","type":"integer","description":"Subaccount ID"},"time_in_force":{"title":"time_in_force","type":"string","enum":["gtc","post_only","fok","ioc"],"description":"Time in force\n\n`gtc` `post_only` `fok` `ioc`"}},"type":"object","additionalProperties":false}},"open_orders_margin":{"title":"open_orders_margin","type":"string","format":"decimal","description":"Total margin requirement of all open orders.Orders will be rejected if this value plus initial margin are below zero after the order."},"positions":{"title":"positions","type":"array","description":"All active positions of subaccount","items":{"required":["amount","average_price","cumulative_funding","delta","gamma","index_price","initial_margin","instrument_name","instrument_type","leverage","liquidation_price","maintenance_margin","mark_price","mark_value","net_settlements","open_orders_margin","pending_funding","realized_pnl","theta","unrealized_pnl","vega"],"properties":{"amount":{"title":"amount","type":"string","format":"decimal","description":"Position amount held by subaccount"},"average_price":{"title":"average_price","type":"string","format":"decimal","description":"Average price of whole position"},"cumulative_funding":{"title":"cumulative_funding","type":"string","format":"decimal","description":"Cumulative funding for the position (only for perpetuals)."},"delta":{"title":"delta","type":"string","format":"decimal","description":"Asset delta (w.r.t. forward price for options, `1.0` for perps)"},"gamma":{"title":"gamma","type":"string","format":"decimal","description":"Asset gamma (zero for non-options)"},"index_price":{"title":"index_price","type":"string","format":"decimal","description":"Current index (oracle) price for position's currency"},"initial_margin":{"title":"initial_margin","type":"string","format":"decimal","description":"USD initial margin requirement for this position"},"instrument_name":{"title":"instrument_name","type":"string","description":"Instrument name (same as the base Asset name)"},"instrument_type":{"title":"instrument_type","type":"string","enum":["erc20","option","perp"],"description":"`erc20`, `option`, or `perp`\n\n`erc20` `option` `perp`"},"leverage":{"title":"leverage","type":["string","null"],"format":"decimal","default":null,"description":"Only for perps. Leverage of the position, defined as `abs(notional) / collateral net of options margin`"},"liquidation_price":{"title":"liquidation_price","type":["string","null"],"format":"decimal","default":null,"description":"Index price at which position will be liquidated"},"maintenance_margin":{"title":"maintenance_margin","type":"string","format":"decimal","description":"USD maintenance margin requirement for this position"},"mark_price":{"title":"mark_price","type":"string","format":"decimal","description":"Current mark price for position's instrument"},"mark_value":{"title":"mark_value","type":"string","format":"decimal","description":"USD value of the position; this represents how much USD can be recieved by fully closing the position at the current oracle price"},"net_settlements":{"title":"net_settlements","type":"string","format":"decimal","description":"Net amount of USD from position settlements that has been paid to the user's subaccount. This number is subtracted from the portfolio value for margin calculations purposes.
Positive values mean the user has recieved USD from settlements, or is awaiting settlement of USD losses. Negative values mean the user has paid USD for settlements, or is awaiting settlement of USD gains."},"open_orders_margin":{"title":"open_orders_margin","type":"string","format":"decimal","description":"USD margin requirement for all open orders for this asset / instrument"},"pending_funding":{"title":"pending_funding","type":"string","format":"decimal","description":"A portion of funding payments that has not yet been settled into cash balance (only for perpetuals). This number is added to the portfolio value for margin calculations purposes."},"realized_pnl":{"title":"realized_pnl","type":"string","format":"decimal","description":"Realized trading profit or loss of the position."},"theta":{"title":"theta","type":"string","format":"decimal","description":"Asset theta (zero for non-options)"},"unrealized_pnl":{"title":"unrealized_pnl","type":"string","format":"decimal","description":"Unrealized trading profit or loss of the position."},"vega":{"title":"vega","type":"string","format":"decimal","description":"Asset vega (zero for non-options)"}},"type":"object","additionalProperties":false}},"positions_initial_margin":{"title":"positions_initial_margin","type":"string","format":"decimal","description":"Total initial margin requirement of all positions"},"positions_maintenance_margin":{"title":"positions_maintenance_margin","type":"string","format":"decimal","description":"Total maintenance margin requirement of all positions"},"positions_value":{"title":"positions_value","type":"string","format":"decimal","description":"Total mark-to-market value of all positions"},"subaccount_id":{"title":"subaccount_id","type":"integer","description":"Subaccount_id"},"subaccount_value":{"title":"subaccount_value","type":"string","format":"decimal","description":"Total mark-to-market value of all positions and collaterals"}},"type":"object","additionalProperties":false}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"}}} as const
+;
+const PostPrivateGetSubaccountValueHistory = {"body":{"required":["end_timestamp","period","start_timestamp","subaccount_id"],"properties":{"end_timestamp":{"title":"end_timestamp","type":"integer","description":"End timestamp"},"period":{"title":"period","type":"integer","description":"Period"},"start_timestamp":{"title":"start_timestamp","type":"integer","description":"Start timestamp"},"subaccount_id":{"title":"subaccount_id","type":"integer","description":"Subaccount_id"}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"},"response":{"200":{"required":["id","result"],"properties":{"id":{"anyOf":[{"title":"","type":"string"},{"title":"","type":"integer"}]},"result":{"required":["subaccount_id","subaccount_value_history"],"properties":{"subaccount_id":{"title":"subaccount_id","type":"integer","description":"Subaccount_id"},"subaccount_value_history":{"title":"subaccount_value_history","type":"array","description":"Subaccount value history","items":{"required":["subaccount_value","timestamp"],"properties":{"subaccount_value":{"title":"subaccount_value","type":"string","format":"decimal","description":"Total mark-to-market value of all positions and collaterals"},"timestamp":{"title":"timestamp","type":"integer","description":"Timestamp of when the subaccount value was recorded into the database"}},"type":"object","additionalProperties":false}}},"type":"object","additionalProperties":false}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"}}} as const
+;
+const PostPrivateGetSubaccounts = {"body":{"required":["wallet"],"properties":{"wallet":{"title":"wallet","type":"string","description":"Ethereum wallet address of account"}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"},"response":{"200":{"required":["id","result"],"properties":{"id":{"anyOf":[{"title":"","type":"string"},{"title":"","type":"integer"}]},"result":{"required":["subaccount_ids","wallet"],"properties":{"subaccount_ids":{"title":"subaccount_ids","type":"array","description":"List of subaccount_ids owned by the wallet in `SubAccounts.sol`","items":{"title":"subaccount_ids","type":"integer"}},"wallet":{"title":"wallet","type":"string","description":"Ethereum wallet address"}},"type":"object","additionalProperties":false}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"}}} as const
+;
+const PostPrivateGetTradeHistory = {"body":{"required":["subaccount_id"],"properties":{"from_timestamp":{"title":"from_timestamp","type":"integer","default":0,"description":"Earliest timestamp to filter by (in ms since Unix epoch). If not provied, defaults to 0."},"instrument_name":{"title":"instrument_name","type":["string","null"],"default":null,"description":"Instrument name to filter by"},"order_id":{"title":"order_id","type":["string","null"],"default":null,"description":"Order id to filter by"},"subaccount_id":{"title":"subaccount_id","type":"integer","description":"Subaccount_id for which to get trades"},"to_timestamp":{"title":"to_timestamp","type":"integer","default":18446744073709552000,"description":"Latest timestamp to filter by (in ms since Unix epoch). If not provied, defaults to returning all data up to current time."}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"},"response":{"200":{"required":["id","result"],"properties":{"id":{"anyOf":[{"title":"","type":"string"},{"title":"","type":"integer"}]},"result":{"required":["subaccount_id","trades"],"properties":{"subaccount_id":{"title":"subaccount_id","type":"integer","description":"Subaccount_id for which to get the trade history"},"trades":{"title":"trades","type":"array","description":"List of trades","items":{"required":["direction","index_price","instrument_name","is_transfer","label","liquidity_role","mark_price","order_id","realized_pnl","subaccount_id","timestamp","trade_amount","trade_fee","trade_id","trade_price","tx_hash","tx_status"],"properties":{"direction":{"title":"direction","type":"string","enum":["buy","sell"],"description":"Order direction\n\n`buy` `sell`"},"index_price":{"title":"index_price","type":"string","format":"decimal","description":"Index price of the underlying at the time of the trade"},"instrument_name":{"title":"instrument_name","type":"string","description":"Instrument name"},"is_transfer":{"title":"is_transfer","type":"boolean","description":"Whether the trade was generated through `private/transfer_position`"},"label":{"title":"label","type":"string","description":"Optional user-defined label for the order"},"liquidity_role":{"title":"liquidity_role","type":"string","enum":["maker","taker"],"description":"Role of the user in the trade\n\n`maker` `taker`"},"mark_price":{"title":"mark_price","type":"string","format":"decimal","description":"Mark price of the instrument at the time of the trade"},"order_id":{"title":"order_id","type":"string","description":"Order ID"},"realized_pnl":{"title":"realized_pnl","type":"string","format":"decimal","description":"Realized PnL for this trade"},"subaccount_id":{"title":"subaccount_id","type":"integer","description":"Subaccount ID"},"timestamp":{"title":"timestamp","type":"integer","description":"Trade timestamp (in ms since Unix epoch)"},"trade_amount":{"title":"trade_amount","type":"string","format":"decimal","description":"Amount filled in this trade"},"trade_fee":{"title":"trade_fee","type":"string","format":"decimal","description":"Fee for this trade"},"trade_id":{"title":"trade_id","type":"string","description":"Trade ID"},"trade_price":{"title":"trade_price","type":"string","format":"decimal","description":"Price at which the trade was filled"},"tx_hash":{"title":"tx_hash","type":["string","null"],"default":null,"description":"Blockchain transaction hash"},"tx_status":{"title":"tx_status","type":"string","enum":["requested","pending","settled","reverted","ignored"],"description":"Blockchain transaction status\n\n`requested` `pending` `settled` `reverted` `ignored`"}},"type":"object","additionalProperties":false}}},"type":"object","additionalProperties":false}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"}}} as const
+;
+const PostPrivateGetWithdrawalHistory = {"body":{"required":["subaccount_id"],"properties":{"end_timestamp":{"title":"end_timestamp","type":"integer","default":9223372036854776000,"description":"End timestamp of the event history (default current time)"},"start_timestamp":{"title":"start_timestamp","type":"integer","default":0,"description":"Start timestamp of the event history (default 0)"},"subaccount_id":{"title":"subaccount_id","type":"integer","description":"Subaccount id"}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"},"response":{"200":{"required":["id","result"],"properties":{"id":{"anyOf":[{"title":"","type":"string"},{"title":"","type":"integer"}]},"result":{"required":["events"],"properties":{"events":{"title":"events","type":"array","description":"List of withdrawals","items":{"required":["amount","asset","timestamp","tx_hash"],"properties":{"amount":{"title":"amount","type":"string","format":"decimal","description":"Amount withdrawn by the subaccount"},"asset":{"title":"asset","type":"string","description":"Asset withdrawn"},"timestamp":{"title":"timestamp","type":"integer","description":"Timestamp of the withdrawal (in ms since UNIX epoch)"},"tx_hash":{"title":"tx_hash","type":"string","description":"Hash of the transaction that withdrew the funds"}},"type":"object","additionalProperties":false}}},"type":"object","additionalProperties":false}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"}}} as const
+;
+const PostPrivateOrder = {"body":{"required":["amount","direction","instrument_name","limit_price","max_fee","nonce","signature","signature_expiry_sec","signer","subaccount_id"],"properties":{"amount":{"title":"amount","type":"string","format":"decimal","description":"Order amount in units of the base"},"direction":{"title":"direction","type":"string","enum":["buy","sell"],"description":"Order direction"},"instrument_name":{"title":"instrument_name","type":"string","description":"Instrument name"},"label":{"title":"label","type":"string","description":"Optional user-defined label for the order"},"limit_price":{"title":"limit_price","type":"string","format":"decimal","description":"Limit price in quote currency.
This field is still required for market orders because it is a component of the signature. However, market orders will not leave a resting order in the book in case of a partial fill."},"max_fee":{"title":"max_fee","type":"string","format":"decimal","description":"Max fee in units of the quote currency. Order will be rejected if the supplied max fee is below the estimated fee for this order."},"mmp":{"title":"mmp","type":"boolean","default":false,"description":"Whether the order is tagged for market maker protections (default false)"},"nonce":{"title":"nonce","type":"integer","description":"Unique nonce defined as (e.g. 1695836058725001, where 001 is the random number)"},"order_type":{"title":"order_type","type":"string","default":"limit","enum":["limit","market"],"description":"Order type:
- `limit`: limit order (default)
- `market`: market order, note that limit_price is still required for market orders, but unfilled order portion will be marked as cancelled\n\nDefault: `limit`"},"reduce_only":{"title":"reduce_only","type":"boolean","default":false,"description":"If true, the order will not be able to increase position's size (default false). If the order amount exceeds available position size, the order will be filled up to the position size and the remainder will be cancelled. This flag is only supported for market orders or non-resting limit orders (IOC or FOK)"},"referral_code":{"title":"referral_code","type":"string","description":"Optional referral code for the order"},"reject_timestamp":{"title":"reject_timestamp","type":"integer","default":9223372036854776000,"description":"UTC timestamp in ms, if provided the matching engine will reject the order with an error if `reject_timestamp` < `server_time`. Note that the timestamp must be consistent with the server time: use `public/get_time` method to obtain current server time."},"signature":{"title":"signature","type":"string","description":"Etherium signature of the order"},"signature_expiry_sec":{"title":"signature_expiry_sec","type":"integer","description":"Unix timestamp in seconds. Order signature becomes invalid after this time, and the system will cancel the order.Expiry MUST be at least 5 min from now."},"signer":{"title":"signer","type":"string","description":"Owner wallet address or registered session key that signed order"},"subaccount_id":{"title":"subaccount_id","type":"integer","description":"Subaccount ID"},"time_in_force":{"title":"time_in_force","type":"string","default":"gtc","enum":["gtc","post_only","fok","ioc"],"description":"Time in force behaviour:
- `gtc`: good til cancelled (default)
- `post_only`: a limit order that will be rejected if it crosses any order in the book, i.e. acts as a taker order
- `fok`: fill or kill, will be rejected if it is not fully filled
- `ioc`: immediate or cancel, fill at best bid/ask (market) or at limit price (limit), the unfilled portion is cancelled
Note that the order will still expire on the `signature_expiry_sec` timestamp.\n\nDefault: `gtc`"}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"},"response":{"200":{"required":["id","result"],"properties":{"id":{"anyOf":[{"title":"","type":"string"},{"title":"","type":"integer"}]},"result":{"required":["order","trades"],"properties":{"order":{"required":["amount","average_price","cancel_reason","creation_timestamp","direction","filled_amount","instrument_name","is_transfer","label","last_update_timestamp","limit_price","max_fee","mmp","nonce","order_fee","order_id","order_status","order_type","signature","signature_expiry_sec","signer","subaccount_id","time_in_force"],"properties":{"amount":{"title":"amount","type":"string","format":"decimal","description":"Order amount in units of the base"},"average_price":{"title":"average_price","type":"string","format":"decimal","description":"Average fill price"},"cancel_reason":{"title":"cancel_reason","type":"string","enum":["","user_request","mmp_trigger","insufficient_margin","signed_max_fee_too_low","cancel_on_disconnect","ioc_or_market_partial_fill","session_key_deregistered","subaccount_withdrawn","compliance"],"description":"If cancelled, reason behind order cancellation\n\n`user_request` `mmp_trigger` `insufficient_margin` `signed_max_fee_too_low` `cancel_on_disconnect` `ioc_or_market_partial_fill` `session_key_deregistered` `subaccount_withdrawn` `compliance`"},"creation_timestamp":{"title":"creation_timestamp","type":"integer","description":"Creation timestamp (in ms since Unix epoch)"},"direction":{"title":"direction","type":"string","enum":["buy","sell"],"description":"Order direction\n\n`buy` `sell`"},"filled_amount":{"title":"filled_amount","type":"string","format":"decimal","description":"Total filled amount for the order"},"instrument_name":{"title":"instrument_name","type":"string","description":"Instrument name"},"is_transfer":{"title":"is_transfer","type":"boolean","description":"Whether the order was generated through `private/transfer_position`"},"label":{"title":"label","type":"string","description":"Optional user-defined label for the order"},"last_update_timestamp":{"title":"last_update_timestamp","type":"integer","description":"Last update timestamp (in ms since Unix epoch)"},"limit_price":{"title":"limit_price","type":"string","format":"decimal","description":"Limit price in quote currency"},"max_fee":{"title":"max_fee","type":"string","format":"decimal","description":"Max fee in units of the quote currency"},"mmp":{"title":"mmp","type":"boolean","description":"Whether the order is tagged for market maker protections"},"nonce":{"title":"nonce","type":"integer","description":"Unique nonce defined as (e.g. 1695836058725001, where 001 is the random number)"},"order_fee":{"title":"order_fee","type":"string","format":"decimal","description":"Total order fee paid so far"},"order_id":{"title":"order_id","type":"string","description":"Order ID"},"order_status":{"title":"order_status","type":"string","enum":["open","filled","rejected","cancelled","expired"],"description":"Order status\n\n`open` `filled` `rejected` `cancelled` `expired`"},"order_type":{"title":"order_type","type":"string","enum":["limit","market"],"description":"Order type\n\n`limit` `market`"},"signature":{"title":"signature","type":"string","description":"Ethereum signature of the order"},"signature_expiry_sec":{"title":"signature_expiry_sec","type":"integer","description":"Signature expiry timestamp"},"signer":{"title":"signer","type":"string","description":"Owner wallet address or registered session key that signed order"},"subaccount_id":{"title":"subaccount_id","type":"integer","description":"Subaccount ID"},"time_in_force":{"title":"time_in_force","type":"string","enum":["gtc","post_only","fok","ioc"],"description":"Time in force\n\n`gtc` `post_only` `fok` `ioc`"}},"type":"object","additionalProperties":false},"trades":{"title":"trades","type":"array","items":{"required":["direction","index_price","instrument_name","is_transfer","label","liquidity_role","mark_price","order_id","realized_pnl","subaccount_id","timestamp","trade_amount","trade_fee","trade_id","trade_price","tx_hash","tx_status"],"properties":{"direction":{"title":"direction","type":"string","enum":["buy","sell"],"description":"Order direction\n\n`buy` `sell`"},"index_price":{"title":"index_price","type":"string","format":"decimal","description":"Index price of the underlying at the time of the trade"},"instrument_name":{"title":"instrument_name","type":"string","description":"Instrument name"},"is_transfer":{"title":"is_transfer","type":"boolean","description":"Whether the trade was generated through `private/transfer_position`"},"label":{"title":"label","type":"string","description":"Optional user-defined label for the order"},"liquidity_role":{"title":"liquidity_role","type":"string","enum":["maker","taker"],"description":"Role of the user in the trade\n\n`maker` `taker`"},"mark_price":{"title":"mark_price","type":"string","format":"decimal","description":"Mark price of the instrument at the time of the trade"},"order_id":{"title":"order_id","type":"string","description":"Order ID"},"realized_pnl":{"title":"realized_pnl","type":"string","format":"decimal","description":"Realized PnL for this trade"},"subaccount_id":{"title":"subaccount_id","type":"integer","description":"Subaccount ID"},"timestamp":{"title":"timestamp","type":"integer","description":"Trade timestamp (in ms since Unix epoch)"},"trade_amount":{"title":"trade_amount","type":"string","format":"decimal","description":"Amount filled in this trade"},"trade_fee":{"title":"trade_fee","type":"string","format":"decimal","description":"Fee for this trade"},"trade_id":{"title":"trade_id","type":"string","description":"Trade ID"},"trade_price":{"title":"trade_price","type":"string","format":"decimal","description":"Price at which the trade was filled"},"tx_hash":{"title":"tx_hash","type":["string","null"],"default":null,"description":"Blockchain transaction hash"},"tx_status":{"title":"tx_status","type":"string","enum":["requested","pending","settled","reverted","ignored"],"description":"Blockchain transaction status\n\n`requested` `pending` `settled` `reverted` `ignored`"}},"type":"object","additionalProperties":false}}},"type":"object","additionalProperties":false}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"}}} as const
+;
+const PostPrivateOrderDebug = {"body":{"required":["amount","direction","instrument_name","limit_price","max_fee","nonce","signature","signature_expiry_sec","signer","subaccount_id"],"properties":{"amount":{"title":"amount","type":"string","format":"decimal","description":"Order amount in units of the base"},"direction":{"title":"direction","type":"string","enum":["buy","sell"],"description":"Order direction"},"instrument_name":{"title":"instrument_name","type":"string","description":"Instrument name"},"label":{"title":"label","type":"string","description":"Optional user-defined label for the order"},"limit_price":{"title":"limit_price","type":"string","format":"decimal","description":"Limit price in quote currency.
This field is still required for market orders because it is a component of the signature. However, market orders will not leave a resting order in the book in case of a partial fill."},"max_fee":{"title":"max_fee","type":"string","format":"decimal","description":"Max fee in units of the quote currency. Order will be rejected if the supplied max fee is below the estimated fee for this order."},"mmp":{"title":"mmp","type":"boolean","default":false,"description":"Whether the order is tagged for market maker protections (default false)"},"nonce":{"title":"nonce","type":"integer","description":"Unique nonce defined as (e.g. 1695836058725001, where 001 is the random number)"},"order_type":{"title":"order_type","type":"string","default":"limit","enum":["limit","market"],"description":"Order type:
- `limit`: limit order (default)
- `market`: market order, note that limit_price is still required for market orders, but unfilled order portion will be marked as cancelled\n\nDefault: `limit`"},"reduce_only":{"title":"reduce_only","type":"boolean","default":false,"description":"If true, the order will not be able to increase position's size (default false). If the order amount exceeds available position size, the order will be filled up to the position size and the remainder will be cancelled. This flag is only supported for market orders or non-resting limit orders (IOC or FOK)"},"referral_code":{"title":"referral_code","type":"string","description":"Optional referral code for the order"},"reject_timestamp":{"title":"reject_timestamp","type":"integer","default":9223372036854776000,"description":"UTC timestamp in ms, if provided the matching engine will reject the order with an error if `reject_timestamp` < `server_time`. Note that the timestamp must be consistent with the server time: use `public/get_time` method to obtain current server time."},"signature":{"title":"signature","type":"string","description":"Etherium signature of the order"},"signature_expiry_sec":{"title":"signature_expiry_sec","type":"integer","description":"Unix timestamp in seconds. Order signature becomes invalid after this time, and the system will cancel the order.Expiry MUST be at least 5 min from now."},"signer":{"title":"signer","type":"string","description":"Owner wallet address or registered session key that signed order"},"subaccount_id":{"title":"subaccount_id","type":"integer","description":"Subaccount ID"},"time_in_force":{"title":"time_in_force","type":"string","default":"gtc","enum":["gtc","post_only","fok","ioc"],"description":"Time in force behaviour:
- `gtc`: good til cancelled (default)
- `post_only`: a limit order that will be rejected if it crosses any order in the book, i.e. acts as a taker order
- `fok`: fill or kill, will be rejected if it is not fully filled
- `ioc`: immediate or cancel, fill at best bid/ask (market) or at limit price (limit), the unfilled portion is cancelled
Note that the order will still expire on the `signature_expiry_sec` timestamp.\n\nDefault: `gtc`"}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"},"response":{"200":{"required":["id","result"],"properties":{"id":{"anyOf":[{"title":"","type":"string"},{"title":"","type":"integer"}]},"result":{"required":["action_hash","encoded_data","encoded_data_hashed","raw_data","typed_data_hash"],"properties":{"action_hash":{"title":"action_hash","type":"string","description":"Keccak hashed action data"},"encoded_data":{"title":"encoded_data","type":"string","description":"ABI encoded order data"},"encoded_data_hashed":{"title":"encoded_data_hashed","type":"string","description":"Keccak hashed encoded_data"},"raw_data":{"required":["data","expiry","module","nonce","owner","signature","signer","subaccount_id"],"properties":{"data":{"required":["asset","desired_amount","is_bid","limit_price","recipient_id","sub_id","trade_id","worst_fee"],"properties":{"asset":{"title":"asset","type":"string"},"desired_amount":{"title":"desired_amount","type":"string","format":"decimal"},"is_bid":{"title":"is_bid","type":"boolean"},"limit_price":{"title":"limit_price","type":"string","format":"decimal"},"recipient_id":{"title":"recipient_id","type":"integer"},"sub_id":{"title":"sub_id","type":"integer"},"trade_id":{"title":"trade_id","type":"string"},"worst_fee":{"title":"worst_fee","type":"string","format":"decimal"}},"type":"object","additionalProperties":false},"expiry":{"title":"expiry","type":"integer"},"module":{"title":"module","type":"string"},"nonce":{"title":"nonce","type":"integer"},"owner":{"title":"owner","type":"string"},"signature":{"title":"signature","type":"string"},"signer":{"title":"signer","type":"string"},"subaccount_id":{"title":"subaccount_id","type":"integer"}},"type":"object","additionalProperties":false},"typed_data_hash":{"title":"typed_data_hash","type":"string","description":"EIP 712 typed data hash"}},"type":"object","additionalProperties":false}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"}}} as const
+;
+const PostPrivateResetMmp = {"body":{"required":["subaccount_id"],"properties":{"currency":{"title":"currency","type":["string","null"],"default":null,"description":"Currency to reset the mmp for. If not provided, resets all configs for the subaccount"},"subaccount_id":{"title":"subaccount_id","type":"integer","description":"Subaccount_id for which to reset the mmp state"}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"},"response":{"200":{"required":["id","result"],"properties":{"id":{"anyOf":[{"title":"","type":"string"},{"title":"","type":"integer"}]},"result":{"title":"result","type":"string","enum":["ok"],"description":"The result of this method call, `ok` if successful\n\n`ok`"}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"}}} as const
+;
+const PostPrivateSessionKeys = {"body":{"required":["wallet"],"properties":{"wallet":{"title":"wallet","type":"string","description":"Ethereum wallet address of account"}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"},"response":{"200":{"required":["id","result"],"properties":{"id":{"anyOf":[{"title":"","type":"string"},{"title":"","type":"integer"}]},"result":{"required":["public_session_keys"],"properties":{"public_session_keys":{"title":"public_session_keys","type":"array","description":"List of session keys (includes unactivated and expired keys)","items":{"required":["expiry_sec","public_session_key"],"properties":{"expiry_sec":{"title":"expiry_sec","type":"integer","description":"Session key expiry timestamp in sec"},"label":{"title":"label","type":"string","description":"User-defined session key label"},"public_session_key":{"title":"public_session_key","type":"string","description":"Public session key address (Ethereum EOA)"}},"type":"object","additionalProperties":false}}},"type":"object","additionalProperties":false}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"}}} as const
+;
+const PostPrivateSetCancelOnDisconnect = {"body":{"required":["enabled","wallet"],"properties":{"enabled":{"title":"enabled","type":"boolean","description":"Whether to enable or disable cancel on disconnect"},"wallet":{"title":"wallet","type":"string","description":"Public key (wallet) of the account"}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"},"response":{"200":{"required":["id","result"],"properties":{"id":{"anyOf":[{"title":"","type":"string"},{"title":"","type":"integer"}]},"result":{"title":"result","type":"string","enum":["ok"],"description":"\n\n`ok`"}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"}}} as const
+;
+const PostPrivateSetMmpConfig = {"body":{"required":["currency","mmp_frozen_time","mmp_interval","subaccount_id"],"properties":{"currency":{"title":"currency","type":"string","description":"Currency of this mmp config"},"mmp_amount_limit":{"title":"mmp_amount_limit","type":"string","format":"decimal","default":"0","description":"Maximum total order amount that can be traded within the mmp_interval across all instruments of the provided currency. The amounts are not netted, so a filled bid of 1 and a filled ask of 2 would count as 3.
Default: 0 (no limit)"},"mmp_delta_limit":{"title":"mmp_delta_limit","type":"string","format":"decimal","default":"0","description":"Maximum total delta that can be traded within the mmp_interval across all instruments of the provided currency. This quantity is netted, so a filled order with +1 delta and a filled order with -2 delta would count as -1
Default: 0 (no limit)"},"mmp_frozen_time":{"title":"mmp_frozen_time","type":"integer","description":"Time interval in ms setting how long the subaccount is frozen after an mmp trigger, if 0 then a manual reset would be required via private/reset_mmp"},"mmp_interval":{"title":"mmp_interval","type":"integer","description":"Time interval in ms over which the limits are monotored, if 0 then mmp is disabled"},"subaccount_id":{"title":"subaccount_id","type":"integer","description":"Subaccount_id for which to set the config"}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"},"response":{"200":{"required":["id","result"],"properties":{"id":{"anyOf":[{"title":"","type":"string"},{"title":"","type":"integer"}]},"result":{"required":["currency","mmp_frozen_time","mmp_interval","subaccount_id"],"properties":{"currency":{"title":"currency","type":"string","description":"Currency of this mmp config"},"mmp_amount_limit":{"title":"mmp_amount_limit","type":"string","format":"decimal","default":"0","description":"Maximum total order amount that can be traded within the mmp_interval across all instruments of the provided currency. The amounts are not netted, so a filled bid of 1 and a filled ask of 2 would count as 3.
Default: 0 (no limit)"},"mmp_delta_limit":{"title":"mmp_delta_limit","type":"string","format":"decimal","default":"0","description":"Maximum total delta that can be traded within the mmp_interval across all instruments of the provided currency. This quantity is netted, so a filled order with +1 delta and a filled order with -2 delta would count as -1
Default: 0 (no limit)"},"mmp_frozen_time":{"title":"mmp_frozen_time","type":"integer","description":"Time interval in ms setting how long the subaccount is frozen after an mmp trigger, if 0 then a manual reset would be required via private/reset_mmp"},"mmp_interval":{"title":"mmp_interval","type":"integer","description":"Time interval in ms over which the limits are monotored, if 0 then mmp is disabled"},"subaccount_id":{"title":"subaccount_id","type":"integer","description":"Subaccount_id for which to set the config"}},"type":"object","additionalProperties":false}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"}}} as const
+;
+const PostPrivateTransferErc20 = {"body":{"required":["recipient_details","recipient_subaccount_id","sender_details","subaccount_id","transfer"],"properties":{"recipient_details":{"required":["nonce","signature","signature_expiry_sec","signer"],"properties":{"nonce":{"title":"nonce","type":"integer","description":"Unique nonce defined as (e.g. 1695836058725001, where 001 is the random number)"},"signature":{"title":"signature","type":"string","description":"Ethereum signature of the transfer"},"signature_expiry_sec":{"title":"signature_expiry_sec","type":"integer","description":"Unix timestamp in seconds. Expiry MUST be >5min from now"},"signer":{"title":"signer","type":"string","description":"Ethereum wallet address that is signing the transfer"}},"type":"object","additionalProperties":false},"recipient_subaccount_id":{"title":"recipient_subaccount_id","type":"integer","description":"Subaccount_id of the recipient"},"sender_details":{"required":["nonce","signature","signature_expiry_sec","signer"],"properties":{"nonce":{"title":"nonce","type":"integer","description":"Unique nonce defined as (e.g. 1695836058725001, where 001 is the random number)"},"signature":{"title":"signature","type":"string","description":"Ethereum signature of the transfer"},"signature_expiry_sec":{"title":"signature_expiry_sec","type":"integer","description":"Unix timestamp in seconds. Expiry MUST be >5min from now"},"signer":{"title":"signer","type":"string","description":"Ethereum wallet address that is signing the transfer"}},"type":"object","additionalProperties":false},"subaccount_id":{"title":"subaccount_id","type":"integer","description":"Subaccount_id"},"transfer":{"required":["address","amount","sub_id"],"properties":{"address":{"title":"address","type":"string","description":"Ethereum address of the asset being transferred"},"amount":{"title":"amount","type":"string","format":"decimal","description":"Amount to transfer"},"sub_id":{"title":"sub_id","type":"integer","description":"Sub ID of the asset being transferred"}},"type":"object","additionalProperties":false}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"},"response":{"200":{"required":["id","result"],"properties":{"id":{"anyOf":[{"title":"","type":"string"},{"title":"","type":"integer"}]},"result":{"required":["status","transaction_id"],"properties":{"status":{"title":"status","type":"string","description":"`requested`"},"transaction_id":{"title":"transaction_id","type":"string","format":"uuid","description":"Transaction id of the transfer"}},"type":"object","additionalProperties":false}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"}}} as const
+;
+const PostPrivateTransferPosition = {"body":{"required":["maker_params","taker_params","wallet"],"properties":{"maker_params":{"required":["amount","direction","instrument_name","limit_price","max_fee","nonce","signature","signature_expiry_sec","signer","subaccount_id"],"properties":{"amount":{"title":"amount","type":"string","format":"decimal","description":"Order amount in units of the base"},"direction":{"title":"direction","type":"string","enum":["buy","sell"],"description":"Order direction"},"instrument_name":{"title":"instrument_name","type":"string","description":"Instrument name"},"limit_price":{"title":"limit_price","type":"string","format":"decimal","description":"Limit price in quote currency.
This field is still required for market orders because it is a component of the signature. However, market orders will not leave a resting order in the book in case of a partial fill."},"max_fee":{"title":"max_fee","type":"string","format":"decimal","description":"Max fee in units of the quote currency. Order will be rejected if the supplied max fee is below the estimated fee for this order."},"nonce":{"title":"nonce","type":"integer","description":"Unique nonce defined as (e.g. 1695836058725001, where 001 is the random number)"},"signature":{"title":"signature","type":"string","description":"Etherium signature of the order"},"signature_expiry_sec":{"title":"signature_expiry_sec","type":"integer","description":"Unix timestamp in seconds. Order signature becomes invalid after this time, and the system will cancel the order.Expiry MUST be at least 5 min from now."},"signer":{"title":"signer","type":"string","description":"Owner wallet address or registered session key that signed order"},"subaccount_id":{"title":"subaccount_id","type":"integer","description":"Subaccount ID"}},"type":"object","additionalProperties":false},"taker_params":{"required":["amount","direction","instrument_name","limit_price","max_fee","nonce","signature","signature_expiry_sec","signer","subaccount_id"],"properties":{"amount":{"title":"amount","type":"string","format":"decimal","description":"Order amount in units of the base"},"direction":{"title":"direction","type":"string","enum":["buy","sell"],"description":"Order direction"},"instrument_name":{"title":"instrument_name","type":"string","description":"Instrument name"},"limit_price":{"title":"limit_price","type":"string","format":"decimal","description":"Limit price in quote currency.
This field is still required for market orders because it is a component of the signature. However, market orders will not leave a resting order in the book in case of a partial fill."},"max_fee":{"title":"max_fee","type":"string","format":"decimal","description":"Max fee in units of the quote currency. Order will be rejected if the supplied max fee is below the estimated fee for this order."},"nonce":{"title":"nonce","type":"integer","description":"Unique nonce defined as (e.g. 1695836058725001, where 001 is the random number)"},"signature":{"title":"signature","type":"string","description":"Etherium signature of the order"},"signature_expiry_sec":{"title":"signature_expiry_sec","type":"integer","description":"Unix timestamp in seconds. Order signature becomes invalid after this time, and the system will cancel the order.Expiry MUST be at least 5 min from now."},"signer":{"title":"signer","type":"string","description":"Owner wallet address or registered session key that signed order"},"subaccount_id":{"title":"subaccount_id","type":"integer","description":"Subaccount ID"}},"type":"object","additionalProperties":false},"wallet":{"title":"wallet","type":"string","description":"Public key (wallet) of the account"}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"},"response":{"200":{"required":["id","result"],"properties":{"id":{"anyOf":[{"title":"","type":"string"},{"title":"","type":"integer"}]},"result":{"required":["maker_order","maker_trade","taker_order","taker_trade"],"properties":{"maker_order":{"required":["amount","average_price","cancel_reason","creation_timestamp","direction","filled_amount","instrument_name","is_transfer","label","last_update_timestamp","limit_price","max_fee","mmp","nonce","order_fee","order_id","order_status","order_type","signature","signature_expiry_sec","signer","subaccount_id","time_in_force"],"properties":{"amount":{"title":"amount","type":"string","format":"decimal","description":"Order amount in units of the base"},"average_price":{"title":"average_price","type":"string","format":"decimal","description":"Average fill price"},"cancel_reason":{"title":"cancel_reason","type":"string","enum":["","user_request","mmp_trigger","insufficient_margin","signed_max_fee_too_low","cancel_on_disconnect","ioc_or_market_partial_fill","session_key_deregistered","subaccount_withdrawn","compliance"],"description":"If cancelled, reason behind order cancellation\n\n`user_request` `mmp_trigger` `insufficient_margin` `signed_max_fee_too_low` `cancel_on_disconnect` `ioc_or_market_partial_fill` `session_key_deregistered` `subaccount_withdrawn` `compliance`"},"creation_timestamp":{"title":"creation_timestamp","type":"integer","description":"Creation timestamp (in ms since Unix epoch)"},"direction":{"title":"direction","type":"string","enum":["buy","sell"],"description":"Order direction\n\n`buy` `sell`"},"filled_amount":{"title":"filled_amount","type":"string","format":"decimal","description":"Total filled amount for the order"},"instrument_name":{"title":"instrument_name","type":"string","description":"Instrument name"},"is_transfer":{"title":"is_transfer","type":"boolean","description":"Whether the order was generated through `private/transfer_position`"},"label":{"title":"label","type":"string","description":"Optional user-defined label for the order"},"last_update_timestamp":{"title":"last_update_timestamp","type":"integer","description":"Last update timestamp (in ms since Unix epoch)"},"limit_price":{"title":"limit_price","type":"string","format":"decimal","description":"Limit price in quote currency"},"max_fee":{"title":"max_fee","type":"string","format":"decimal","description":"Max fee in units of the quote currency"},"mmp":{"title":"mmp","type":"boolean","description":"Whether the order is tagged for market maker protections"},"nonce":{"title":"nonce","type":"integer","description":"Unique nonce defined as (e.g. 1695836058725001, where 001 is the random number)"},"order_fee":{"title":"order_fee","type":"string","format":"decimal","description":"Total order fee paid so far"},"order_id":{"title":"order_id","type":"string","description":"Order ID"},"order_status":{"title":"order_status","type":"string","enum":["open","filled","rejected","cancelled","expired"],"description":"Order status\n\n`open` `filled` `rejected` `cancelled` `expired`"},"order_type":{"title":"order_type","type":"string","enum":["limit","market"],"description":"Order type\n\n`limit` `market`"},"signature":{"title":"signature","type":"string","description":"Ethereum signature of the order"},"signature_expiry_sec":{"title":"signature_expiry_sec","type":"integer","description":"Signature expiry timestamp"},"signer":{"title":"signer","type":"string","description":"Owner wallet address or registered session key that signed order"},"subaccount_id":{"title":"subaccount_id","type":"integer","description":"Subaccount ID"},"time_in_force":{"title":"time_in_force","type":"string","enum":["gtc","post_only","fok","ioc"],"description":"Time in force\n\n`gtc` `post_only` `fok` `ioc`"}},"type":"object","additionalProperties":false},"maker_trade":{"required":["direction","index_price","instrument_name","is_transfer","label","liquidity_role","mark_price","order_id","realized_pnl","subaccount_id","timestamp","trade_amount","trade_fee","trade_id","trade_price","tx_hash","tx_status"],"properties":{"direction":{"title":"direction","type":"string","enum":["buy","sell"],"description":"Order direction\n\n`buy` `sell`"},"index_price":{"title":"index_price","type":"string","format":"decimal","description":"Index price of the underlying at the time of the trade"},"instrument_name":{"title":"instrument_name","type":"string","description":"Instrument name"},"is_transfer":{"title":"is_transfer","type":"boolean","description":"Whether the trade was generated through `private/transfer_position`"},"label":{"title":"label","type":"string","description":"Optional user-defined label for the order"},"liquidity_role":{"title":"liquidity_role","type":"string","enum":["maker","taker"],"description":"Role of the user in the trade\n\n`maker` `taker`"},"mark_price":{"title":"mark_price","type":"string","format":"decimal","description":"Mark price of the instrument at the time of the trade"},"order_id":{"title":"order_id","type":"string","description":"Order ID"},"realized_pnl":{"title":"realized_pnl","type":"string","format":"decimal","description":"Realized PnL for this trade"},"subaccount_id":{"title":"subaccount_id","type":"integer","description":"Subaccount ID"},"timestamp":{"title":"timestamp","type":"integer","description":"Trade timestamp (in ms since Unix epoch)"},"trade_amount":{"title":"trade_amount","type":"string","format":"decimal","description":"Amount filled in this trade"},"trade_fee":{"title":"trade_fee","type":"string","format":"decimal","description":"Fee for this trade"},"trade_id":{"title":"trade_id","type":"string","description":"Trade ID"},"trade_price":{"title":"trade_price","type":"string","format":"decimal","description":"Price at which the trade was filled"},"tx_hash":{"title":"tx_hash","type":["string","null"],"default":null,"description":"Blockchain transaction hash"},"tx_status":{"title":"tx_status","type":"string","enum":["requested","pending","settled","reverted","ignored"],"description":"Blockchain transaction status\n\n`requested` `pending` `settled` `reverted` `ignored`"}},"type":"object","additionalProperties":false},"taker_order":{"required":["amount","average_price","cancel_reason","creation_timestamp","direction","filled_amount","instrument_name","is_transfer","label","last_update_timestamp","limit_price","max_fee","mmp","nonce","order_fee","order_id","order_status","order_type","signature","signature_expiry_sec","signer","subaccount_id","time_in_force"],"properties":{"amount":{"title":"amount","type":"string","format":"decimal","description":"Order amount in units of the base"},"average_price":{"title":"average_price","type":"string","format":"decimal","description":"Average fill price"},"cancel_reason":{"title":"cancel_reason","type":"string","enum":["","user_request","mmp_trigger","insufficient_margin","signed_max_fee_too_low","cancel_on_disconnect","ioc_or_market_partial_fill","session_key_deregistered","subaccount_withdrawn","compliance"],"description":"If cancelled, reason behind order cancellation\n\n`user_request` `mmp_trigger` `insufficient_margin` `signed_max_fee_too_low` `cancel_on_disconnect` `ioc_or_market_partial_fill` `session_key_deregistered` `subaccount_withdrawn` `compliance`"},"creation_timestamp":{"title":"creation_timestamp","type":"integer","description":"Creation timestamp (in ms since Unix epoch)"},"direction":{"title":"direction","type":"string","enum":["buy","sell"],"description":"Order direction\n\n`buy` `sell`"},"filled_amount":{"title":"filled_amount","type":"string","format":"decimal","description":"Total filled amount for the order"},"instrument_name":{"title":"instrument_name","type":"string","description":"Instrument name"},"is_transfer":{"title":"is_transfer","type":"boolean","description":"Whether the order was generated through `private/transfer_position`"},"label":{"title":"label","type":"string","description":"Optional user-defined label for the order"},"last_update_timestamp":{"title":"last_update_timestamp","type":"integer","description":"Last update timestamp (in ms since Unix epoch)"},"limit_price":{"title":"limit_price","type":"string","format":"decimal","description":"Limit price in quote currency"},"max_fee":{"title":"max_fee","type":"string","format":"decimal","description":"Max fee in units of the quote currency"},"mmp":{"title":"mmp","type":"boolean","description":"Whether the order is tagged for market maker protections"},"nonce":{"title":"nonce","type":"integer","description":"Unique nonce defined as (e.g. 1695836058725001, where 001 is the random number)"},"order_fee":{"title":"order_fee","type":"string","format":"decimal","description":"Total order fee paid so far"},"order_id":{"title":"order_id","type":"string","description":"Order ID"},"order_status":{"title":"order_status","type":"string","enum":["open","filled","rejected","cancelled","expired"],"description":"Order status\n\n`open` `filled` `rejected` `cancelled` `expired`"},"order_type":{"title":"order_type","type":"string","enum":["limit","market"],"description":"Order type\n\n`limit` `market`"},"signature":{"title":"signature","type":"string","description":"Ethereum signature of the order"},"signature_expiry_sec":{"title":"signature_expiry_sec","type":"integer","description":"Signature expiry timestamp"},"signer":{"title":"signer","type":"string","description":"Owner wallet address or registered session key that signed order"},"subaccount_id":{"title":"subaccount_id","type":"integer","description":"Subaccount ID"},"time_in_force":{"title":"time_in_force","type":"string","enum":["gtc","post_only","fok","ioc"],"description":"Time in force\n\n`gtc` `post_only` `fok` `ioc`"}},"type":"object","additionalProperties":false},"taker_trade":{"required":["direction","index_price","instrument_name","is_transfer","label","liquidity_role","mark_price","order_id","realized_pnl","subaccount_id","timestamp","trade_amount","trade_fee","trade_id","trade_price","tx_hash","tx_status"],"properties":{"direction":{"title":"direction","type":"string","enum":["buy","sell"],"description":"Order direction\n\n`buy` `sell`"},"index_price":{"title":"index_price","type":"string","format":"decimal","description":"Index price of the underlying at the time of the trade"},"instrument_name":{"title":"instrument_name","type":"string","description":"Instrument name"},"is_transfer":{"title":"is_transfer","type":"boolean","description":"Whether the trade was generated through `private/transfer_position`"},"label":{"title":"label","type":"string","description":"Optional user-defined label for the order"},"liquidity_role":{"title":"liquidity_role","type":"string","enum":["maker","taker"],"description":"Role of the user in the trade\n\n`maker` `taker`"},"mark_price":{"title":"mark_price","type":"string","format":"decimal","description":"Mark price of the instrument at the time of the trade"},"order_id":{"title":"order_id","type":"string","description":"Order ID"},"realized_pnl":{"title":"realized_pnl","type":"string","format":"decimal","description":"Realized PnL for this trade"},"subaccount_id":{"title":"subaccount_id","type":"integer","description":"Subaccount ID"},"timestamp":{"title":"timestamp","type":"integer","description":"Trade timestamp (in ms since Unix epoch)"},"trade_amount":{"title":"trade_amount","type":"string","format":"decimal","description":"Amount filled in this trade"},"trade_fee":{"title":"trade_fee","type":"string","format":"decimal","description":"Fee for this trade"},"trade_id":{"title":"trade_id","type":"string","description":"Trade ID"},"trade_price":{"title":"trade_price","type":"string","format":"decimal","description":"Price at which the trade was filled"},"tx_hash":{"title":"tx_hash","type":["string","null"],"default":null,"description":"Blockchain transaction hash"},"tx_status":{"title":"tx_status","type":"string","enum":["requested","pending","settled","reverted","ignored"],"description":"Blockchain transaction status\n\n`requested` `pending` `settled` `reverted` `ignored`"}},"type":"object","additionalProperties":false}},"type":"object","additionalProperties":false}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"}}} as const
+;
+const PostPrivateUpdateNotifications = {"body":{"required":["notification_ids","subaccount_id"],"properties":{"notification_ids":{"title":"notification_ids","type":"array","description":"List of notification IDs to be marked as seen","items":{"title":"notification_ids","type":"integer"}},"status":{"title":"status","type":"string","default":"seen","enum":["unseen","seen","hidden"],"description":"Status of the notification\n\nDefault: `seen`"},"subaccount_id":{"title":"subaccount_id","type":"integer","description":"Subaccount_id"}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"},"response":{"200":{"required":["id","result"],"properties":{"id":{"anyOf":[{"title":"","type":"string"},{"title":"","type":"integer"}]},"result":{"required":["updated_count"],"properties":{"updated_count":{"title":"updated_count","type":"integer","description":"Number of notifications marked as seen"}},"type":"object","additionalProperties":false}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"}}} as const
+;
+const PostPrivateWithdraw = {"body":{"required":["amount","asset_name","nonce","signature","signature_expiry_sec","signer","subaccount_id"],"properties":{"amount":{"title":"amount","type":"string","format":"decimal","description":"Amount of the asset to withdraw"},"asset_name":{"title":"asset_name","type":"string","description":"Name of asset to withdraw"},"nonce":{"title":"nonce","type":"integer","description":"Unique nonce defined as (e.g. 1695836058725001, where 001 is the random number)"},"signature":{"title":"signature","type":"string","description":"Ethereum signature of the withdraw"},"signature_expiry_sec":{"title":"signature_expiry_sec","type":"integer","description":"Unix timestamp in seconds. Expiry MUST be >5min from now"},"signer":{"title":"signer","type":"string","description":"Ethereum wallet address that is signing the withdraw"},"subaccount_id":{"title":"subaccount_id","type":"integer","description":"Subaccount_id"}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"},"response":{"200":{"required":["id","result"],"properties":{"id":{"anyOf":[{"title":"","type":"string"},{"title":"","type":"integer"}]},"result":{"required":["status","transaction_id"],"properties":{"status":{"title":"status","type":"string","description":"`requested`"},"transaction_id":{"title":"transaction_id","type":"string","format":"uuid","description":"Transaction id of the withdrawal"}},"type":"object","additionalProperties":false}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"}}} as const
+;
+const PostPublicBuildRegisterSessionKeyTx = {"body":{"required":["expiry_sec","gas","nonce","public_session_key","wallet"],"properties":{"expiry_sec":{"title":"expiry_sec","type":"integer","description":"Expiry of the session key"},"gas":{"title":"gas","type":["integer","null"],"default":null,"description":"Gas allowance for transaction. If none, will use estimateGas * 150%"},"nonce":{"title":"nonce","type":["integer","null"],"default":null,"description":"Wallet's transaction count, If none, will use eth.getTransactionCount()"},"public_session_key":{"title":"public_session_key","type":"string","description":"Session key in the form of an Ethereum EOA"},"wallet":{"title":"wallet","type":"string","description":"Ethereum wallet address of account"}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"},"response":{"200":{"required":["id","result"],"properties":{"id":{"anyOf":[{"title":"","type":"string"},{"title":"","type":"integer"}]},"result":{"required":["tx_params"],"properties":{"tx_params":{"title":"tx_params","type":"object","description":"Transaction params in dictionary form, same as `TxParams` in `web3.py`","additionalProperties":true}},"type":"object","additionalProperties":false}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"}}} as const
+;
+const PostPublicCreateAccount = {"body":{"required":["wallet"],"properties":{"wallet":{"title":"wallet","type":"string","description":"Ethereum wallet address"}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"},"response":{"200":{"required":["id","result"],"properties":{"id":{"anyOf":[{"title":"","type":"string"},{"title":"","type":"integer"}]},"result":{"required":["status","wallet"],"properties":{"status":{"title":"status","type":"string","description":"`created` or `exists`"},"wallet":{"title":"wallet","type":"string","description":"Ethereum wallet address"}},"type":"object","additionalProperties":false}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"}}} as const
+;
+const PostPublicCreateSubaccountDebug = {"body":{"required":["amount","asset_name","margin_type","nonce","signature_expiry_sec","signer","wallet"],"properties":{"amount":{"title":"amount","type":"string","format":"decimal","description":"Amount of the asset to deposit"},"asset_name":{"title":"asset_name","type":"string","description":"Name of asset to deposit"},"currency":{"title":"currency","type":["string","null"],"default":null,"description":"Base currency of the subaccount (only for `PM`)"},"margin_type":{"title":"margin_type","type":"string","enum":["PM","SM"],"description":"`PM` (Portfolio Margin) or `SM` (Standard Margin)"},"nonce":{"title":"nonce","type":"integer","description":"Unique nonce defined as (e.g. 1695836058725001, where 001 is the random number)"},"signature_expiry_sec":{"title":"signature_expiry_sec","type":"integer","description":"Unix timestamp in seconds. Expiry MUST be >5min from now"},"signer":{"title":"signer","type":"string","description":"Ethereum wallet address that is signing the deposit"},"wallet":{"title":"wallet","type":"string","description":"Ethereum wallet address"}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"},"response":{"200":{"required":["id","result"],"properties":{"id":{"anyOf":[{"title":"","type":"string"},{"title":"","type":"integer"}]},"result":{"required":["action_hash","encoded_data","encoded_data_hashed","typed_data_hash"],"properties":{"action_hash":{"title":"action_hash","type":"string","description":"Keccak hashed action data"},"encoded_data":{"title":"encoded_data","type":"string","description":"ABI encoded deposit data"},"encoded_data_hashed":{"title":"encoded_data_hashed","type":"string","description":"Keccak hashed encoded_data"},"typed_data_hash":{"title":"typed_data_hash","type":"string","description":"EIP 712 typed data hash"}},"type":"object","additionalProperties":false}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"}}} as const
+;
+const PostPublicDeregisterSessionKey = {"body":{"required":["public_session_key","signed_raw_tx","wallet"],"properties":{"public_session_key":{"title":"public_session_key","type":"string","description":"Session key in the form of an Ethereum EOA"},"signed_raw_tx":{"title":"signed_raw_tx","type":"string","description":"A signed RLP encoded ETH transaction in form of a hex string (same as `w3.eth.account.sign_transaction(unsigned_tx, private_key).rawTransaction.hex()`)"},"wallet":{"title":"wallet","type":"string","description":"Ethereum wallet address of account"}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"},"response":{"200":{"required":["id","result"],"properties":{"id":{"anyOf":[{"title":"","type":"string"},{"title":"","type":"integer"}]},"result":{"required":["public_session_key","transaction_id"],"properties":{"public_session_key":{"title":"public_session_key","type":"string","description":"Session key in the form of an Ethereum EOA"},"transaction_id":{"title":"transaction_id","type":"string","format":"uuid","description":"ID to lookup status of transaction"}},"type":"object","additionalProperties":false}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"}}} as const
+;
+const PostPublicGetInstrument = {"body":{"required":["instrument_name"],"properties":{"instrument_name":{"title":"instrument_name","type":"string","description":"Instrument name"}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"},"response":{"200":{"required":["id","result"],"properties":{"id":{"anyOf":[{"title":"","type":"string"},{"title":"","type":"integer"}]},"result":{"required":["amount_step","base_asset_address","base_asset_sub_id","base_currency","base_fee","instrument_name","instrument_type","is_active","maker_fee_rate","maximum_amount","minimum_amount","option_details","perp_details","quote_currency","scheduled_activation","scheduled_deactivation","taker_fee_rate","tick_size"],"properties":{"amount_step":{"title":"amount_step","type":"string","format":"decimal","description":"Minimum valid increment of order amount"},"base_asset_address":{"title":"base_asset_address","type":"string","description":"Blockchain address of the base asset"},"base_asset_sub_id":{"title":"base_asset_sub_id","type":"string","description":"Sub ID of the specific base asset as defined in Asset.sol"},"base_currency":{"title":"base_currency","type":"string","description":"Underlying currency of base asset (`ETH`, `BTC`, etc)"},"base_fee":{"title":"base_fee","type":"string","format":"decimal","description":"$ base fee added to every taker order"},"instrument_name":{"title":"instrument_name","type":"string","description":"Instrument name"},"instrument_type":{"title":"instrument_type","type":"string","enum":["erc20","option","perp"],"description":"`erc20`, `option`, or `perp`\n\n`erc20` `option` `perp`"},"is_active":{"title":"is_active","type":"boolean","description":"If `True`: instrument is tradeable within `activation` and `deactivation` timestamps"},"maker_fee_rate":{"title":"maker_fee_rate","type":"string","format":"decimal","description":"Percent of spot price fee rate for makers"},"mark_price_fee_rate_cap":{"title":"mark_price_fee_rate_cap","type":["string","null"],"format":"decimal","default":null,"description":"Percent of option price fee cap, e.g. 12.5%, null if not applicable"},"maximum_amount":{"title":"maximum_amount","type":"string","format":"decimal","description":"Maximum valid amount of contracts / tokens per trade"},"minimum_amount":{"title":"minimum_amount","type":"string","format":"decimal","description":"Minimum valid amount of contracts / tokens per trade"},"option_details":{"required":["expiry","index","option_type","strike"],"properties":{"expiry":{"title":"expiry","type":"integer","description":"Unix timestamp of expiry date (in seconds)"},"index":{"title":"index","type":"string","description":"Underlying settlement price index"},"option_type":{"title":"option_type","type":"string","enum":["C","P"],"description":"`C` `P`"},"settlement_price":{"title":"settlement_price","type":["string","null"],"format":"decimal","default":null,"description":"Settlement price of the option"},"strike":{"title":"strike","type":"string","format":"decimal"}},"type":"object","additionalProperties":false},"perp_details":{"required":["aggregate_funding","funding_rate","index","max_rate_per_hour","min_rate_per_hour","static_interest_rate"],"properties":{"aggregate_funding":{"title":"aggregate_funding","type":"string","format":"decimal","description":"Latest aggregated funding as per `PerpAsset.sol`"},"funding_rate":{"title":"funding_rate","type":"string","format":"decimal","description":"Current hourly funding rate as per `PerpAsset.sol`"},"index":{"title":"index","type":"string","description":"Underlying spot price index for funding rate"},"max_rate_per_hour":{"title":"max_rate_per_hour","type":"string","format":"decimal","description":"Max rate per hour as per `PerpAsset.sol`"},"min_rate_per_hour":{"title":"min_rate_per_hour","type":"string","format":"decimal","description":"Min rate per hour as per `PerpAsset.sol`"},"static_interest_rate":{"title":"static_interest_rate","type":"string","format":"decimal","description":"Static interest rate as per `PerpAsset.sol`"}},"type":"object","additionalProperties":false},"quote_currency":{"title":"quote_currency","type":"string","description":"Quote currency (`USD` for perps, `USDC` for options)"},"scheduled_activation":{"title":"scheduled_activation","type":"integer","description":"Timestamp at which became or will become active (if applicable)"},"scheduled_deactivation":{"title":"scheduled_deactivation","type":"integer","description":"Scheduled deactivation time for instrument (if applicable)"},"taker_fee_rate":{"title":"taker_fee_rate","type":"string","format":"decimal","description":"Percent of spot price fee rate for takers"},"tick_size":{"title":"tick_size","type":"string","format":"decimal","description":"Tick size of the instrument, i.e. minimum price increment"}},"type":"object","additionalProperties":false}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"}}} as const
+;
+const PostPublicGetInstruments = {"body":{"required":["currency","expired","instrument_type"],"properties":{"currency":{"title":"currency","type":"string","description":"Underlying currency of asset (`ETH`, `BTC`, etc)"},"expired":{"title":"expired","type":"boolean","description":"If `True`: include expired assets"},"instrument_type":{"title":"instrument_type","type":"string","enum":["erc20","option","perp"],"description":"`erc20`, `option`, or `perp`"}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"},"response":{"200":{"required":["id","result"],"properties":{"id":{"anyOf":[{"title":"","type":"string"},{"title":"","type":"integer"}]},"result":{"title":"result","type":"array","description":"","items":{"required":["amount_step","base_asset_address","base_asset_sub_id","base_currency","base_fee","instrument_name","instrument_type","is_active","maker_fee_rate","maximum_amount","minimum_amount","option_details","perp_details","quote_currency","scheduled_activation","scheduled_deactivation","taker_fee_rate","tick_size"],"properties":{"amount_step":{"title":"amount_step","type":"string","format":"decimal","description":"Minimum valid increment of order amount"},"base_asset_address":{"title":"base_asset_address","type":"string","description":"Blockchain address of the base asset"},"base_asset_sub_id":{"title":"base_asset_sub_id","type":"string","description":"Sub ID of the specific base asset as defined in Asset.sol"},"base_currency":{"title":"base_currency","type":"string","description":"Underlying currency of base asset (`ETH`, `BTC`, etc)"},"base_fee":{"title":"base_fee","type":"string","format":"decimal","description":"$ base fee added to every taker order"},"instrument_name":{"title":"instrument_name","type":"string","description":"Instrument name"},"instrument_type":{"title":"instrument_type","type":"string","enum":["erc20","option","perp"],"description":"`erc20`, `option`, or `perp`\n\n`erc20` `option` `perp`"},"is_active":{"title":"is_active","type":"boolean","description":"If `True`: instrument is tradeable within `activation` and `deactivation` timestamps"},"maker_fee_rate":{"title":"maker_fee_rate","type":"string","format":"decimal","description":"Percent of spot price fee rate for makers"},"mark_price_fee_rate_cap":{"title":"mark_price_fee_rate_cap","type":["string","null"],"format":"decimal","default":null,"description":"Percent of option price fee cap, e.g. 12.5%, null if not applicable"},"maximum_amount":{"title":"maximum_amount","type":"string","format":"decimal","description":"Maximum valid amount of contracts / tokens per trade"},"minimum_amount":{"title":"minimum_amount","type":"string","format":"decimal","description":"Minimum valid amount of contracts / tokens per trade"},"option_details":{"required":["expiry","index","option_type","strike"],"properties":{"expiry":{"title":"expiry","type":"integer","description":"Unix timestamp of expiry date (in seconds)"},"index":{"title":"index","type":"string","description":"Underlying settlement price index"},"option_type":{"title":"option_type","type":"string","enum":["C","P"],"description":"`C` `P`"},"settlement_price":{"title":"settlement_price","type":["string","null"],"format":"decimal","default":null,"description":"Settlement price of the option"},"strike":{"title":"strike","type":"string","format":"decimal"}},"type":"object","additionalProperties":false},"perp_details":{"required":["aggregate_funding","funding_rate","index","max_rate_per_hour","min_rate_per_hour","static_interest_rate"],"properties":{"aggregate_funding":{"title":"aggregate_funding","type":"string","format":"decimal","description":"Latest aggregated funding as per `PerpAsset.sol`"},"funding_rate":{"title":"funding_rate","type":"string","format":"decimal","description":"Current hourly funding rate as per `PerpAsset.sol`"},"index":{"title":"index","type":"string","description":"Underlying spot price index for funding rate"},"max_rate_per_hour":{"title":"max_rate_per_hour","type":"string","format":"decimal","description":"Max rate per hour as per `PerpAsset.sol`"},"min_rate_per_hour":{"title":"min_rate_per_hour","type":"string","format":"decimal","description":"Min rate per hour as per `PerpAsset.sol`"},"static_interest_rate":{"title":"static_interest_rate","type":"string","format":"decimal","description":"Static interest rate as per `PerpAsset.sol`"}},"type":"object","additionalProperties":false},"quote_currency":{"title":"quote_currency","type":"string","description":"Quote currency (`USD` for perps, `USDC` for options)"},"scheduled_activation":{"title":"scheduled_activation","type":"integer","description":"Timestamp at which became or will become active (if applicable)"},"scheduled_deactivation":{"title":"scheduled_deactivation","type":"integer","description":"Scheduled deactivation time for instrument (if applicable)"},"taker_fee_rate":{"title":"taker_fee_rate","type":"string","format":"decimal","description":"Percent of spot price fee rate for takers"},"tick_size":{"title":"tick_size","type":"string","format":"decimal","description":"Tick size of the instrument, i.e. minimum price increment"}},"type":"object","additionalProperties":false}}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"}}} as const
+;
+const PostPublicGetLatestSignedFeeds = {"body":{"properties":{"currency":{"title":"currency","type":["string","null"],"default":null,"description":"Currency filter, (defaults to all currencies)"},"expiry":{"title":"expiry","type":["integer","null"],"default":null,"description":"Expiry filter for options and forward data (defaults to all expiries). Use `0` to get data only for spot and perpetuals"}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"},"response":{"200":{"required":["id","result"],"properties":{"id":{"anyOf":[{"title":"","type":"string"},{"title":"","type":"integer"}]},"result":{"required":["fwd_data","perp_data","spot_data","vol_data"],"properties":{"fwd_data":{"title":"fwd_data","type":"object","description":"currency -> expiry -> latest forward feed data","additionalProperties":{"title":"fwd_data","type":"object","additionalProperties":{"required":["confidence","currency","deadline","expiry","fwd_diff","signatures","spot_aggregate_latest","spot_aggregate_start","timestamp"],"properties":{"confidence":{"title":"confidence","type":"string","format":"decimal","description":"The confidence score of the price"},"currency":{"title":"currency","type":"string","description":"The currency for which the spot feed represents"},"deadline":{"title":"deadline","type":"integer","description":"The latest time the data can be submitted on chain"},"expiry":{"title":"expiry","type":"integer","description":"The expiry for the forward feed"},"fwd_diff":{"title":"fwd_diff","type":"string","format":"decimal","description":"difference of forward price from current spot price"},"signatures":{"properties":{"signatures":{"title":"signatures","type":"array","description":"The signatures of the given signers","items":{"title":"signatures","type":"string"}},"signers":{"title":"signers","type":"array","description":"The signers who verify the data integrity","items":{"title":"signers","type":"string"}}},"type":"object","additionalProperties":false},"spot_aggregate_latest":{"title":"spot_aggregate_latest","type":"string","format":"decimal","description":"expiry -> spot * time value at the latest timestamp"},"spot_aggregate_start":{"title":"spot_aggregate_start","type":"string","format":"decimal","description":"spot * time value at the start of the settlement period"},"timestamp":{"title":"timestamp","type":"integer","description":"The timestamp for which the data was created"}},"type":"object","additionalProperties":false}}},"perp_data":{"title":"perp_data","type":"object","description":"currency -> feed type -> latest perp feed data","additionalProperties":{"title":"perp_data","type":"object","additionalProperties":{"required":["confidence","currency","deadline","signatures","spot_diff_value","timestamp","type"],"properties":{"confidence":{"title":"confidence","type":"string","format":"decimal","description":"The confidence score of the price"},"currency":{"title":"currency","type":"string","description":"The currency for which the spot feed represents"},"deadline":{"title":"deadline","type":"integer","description":"The latest time the data can be submitted on chain"},"signatures":{"properties":{"signatures":{"title":"signatures","type":"array","description":"The signatures of the given signers","items":{"title":"signatures","type":"string"}},"signers":{"title":"signers","type":"array","description":"The signers who verify the data integrity","items":{"title":"signers","type":"string"}}},"type":"object","additionalProperties":false},"spot_diff_value":{"title":"spot_diff_value","type":"string","format":"decimal","description":"The difference between the spot price and the perp price"},"timestamp":{"title":"timestamp","type":"integer","description":"The timestamp for which the data was created"},"type":{"title":"type","type":"string","enum":["P","A","B"],"description":"The type of perp feed; mid price, ask impact or bid impact\n\n`P` `A` `B`"}},"type":"object","additionalProperties":false}}},"spot_data":{"title":"spot_data","type":"object","description":"currency -> latest spot feed data","additionalProperties":{"required":["confidence","currency","deadline","price","signatures","timestamp"],"properties":{"confidence":{"title":"confidence","type":"string","format":"decimal","description":"The confidence score of the price"},"currency":{"title":"currency","type":"string","description":"The currency for which the spot feed represents"},"deadline":{"title":"deadline","type":"integer","description":"The latest time the data can be submitted on chain"},"price":{"title":"price","type":"string","format":"decimal","description":"The price of the currency in USD"},"signatures":{"properties":{"signatures":{"title":"signatures","type":"array","description":"The signatures of the given signers","items":{"title":"signatures","type":"string"}},"signers":{"title":"signers","type":"array","description":"The signers who verify the data integrity","items":{"title":"signers","type":"string"}}},"type":"object","additionalProperties":false},"timestamp":{"title":"timestamp","type":"integer","description":"The timestamp for which the data was created"}},"type":"object","additionalProperties":false}},"vol_data":{"title":"vol_data","type":"object","description":"currency -> expiry -> latest vol feed data","additionalProperties":{"title":"vol_data","type":"object","additionalProperties":{"required":["confidence","currency","deadline","expiry","signatures","timestamp","vol_data"],"properties":{"confidence":{"title":"confidence","type":"string","format":"decimal","description":"The confidence score of the price"},"currency":{"title":"currency","type":"string","description":"The currency for which the spot feed represents"},"deadline":{"title":"deadline","type":"integer","description":"The latest time the data can be submitted on chain"},"expiry":{"title":"expiry","type":"integer","description":"The expiry for the options for the vol feed"},"signatures":{"properties":{"signatures":{"title":"signatures","type":"array","description":"The signatures of the given signers","items":{"title":"signatures","type":"string"}},"signers":{"title":"signers","type":"array","description":"The signers who verify the data integrity","items":{"title":"signers","type":"string"}}},"type":"object","additionalProperties":false},"timestamp":{"title":"timestamp","type":"integer","description":"The timestamp for which the data was created"},"vol_data":{"required":["SVI_a","SVI_b","SVI_fwd","SVI_m","SVI_refTau","SVI_rho","SVI_sigma"],"properties":{"SVI_a":{"title":"SVI_a","type":"string","format":"decimal"},"SVI_b":{"title":"SVI_b","type":"string","format":"decimal"},"SVI_fwd":{"title":"SVI_fwd","type":"string","format":"decimal"},"SVI_m":{"title":"SVI_m","type":"string","format":"decimal"},"SVI_refTau":{"title":"SVI_refTau","type":"string","format":"decimal"},"SVI_rho":{"title":"SVI_rho","type":"string","format":"decimal"},"SVI_sigma":{"title":"SVI_sigma","type":"string","format":"decimal"}},"type":"object","additionalProperties":false}},"type":"object","additionalProperties":false}}}},"type":"object","additionalProperties":false}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"}}} as const
+;
+const PostPublicGetMargin = {"body":{"required":["margin_type","simulated_positions"],"properties":{"margin_type":{"title":"margin_type","type":"string","enum":["PM","SM"],"description":"`PM` (Portfolio Margin) or `SM` (Standard Margin)"},"simulated_position_changes":{"title":"simulated_position_changes","type":["array","null"],"default":null,"description":"Optional, add positions to simulate a trade","items":{"required":["amount","instrument_name"],"properties":{"amount":{"title":"amount","type":"string","format":"decimal","description":"Position amount to simulate"},"entry_price":{"title":"entry_price","type":["string","null"],"format":"decimal","default":null,"description":"Only for perps. Entry price to use in the simulation. Mark price is used if not provided."},"instrument_name":{"title":"instrument_name","type":"string","description":"Instrument name"}},"type":"object","additionalProperties":false}},"simulated_positions":{"title":"simulated_positions","type":"array","description":"List of positions in a simulated portfolio","items":{"required":["amount","instrument_name"],"properties":{"amount":{"title":"amount","type":"string","format":"decimal","description":"Position amount to simulate"},"entry_price":{"title":"entry_price","type":["string","null"],"format":"decimal","default":null,"description":"Only for perps. Entry price to use in the simulation. Mark price is used if not provided."},"instrument_name":{"title":"instrument_name","type":"string","description":"Instrument name"}},"type":"object","additionalProperties":false}}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"},"response":{"200":{"required":["id","result"],"properties":{"id":{"anyOf":[{"title":"","type":"string"},{"title":"","type":"integer"}]},"result":{"required":["is_valid_trade","post_initial_margin","post_maintenance_margin","pre_initial_margin","pre_maintenance_margin","subaccount_id"],"properties":{"is_valid_trade":{"title":"is_valid_trade","type":"boolean","description":"True if trade passes margin requirement"},"post_initial_margin":{"title":"post_initial_margin","type":"string","format":"decimal","description":"Initial margin requirement post trade"},"post_maintenance_margin":{"title":"post_maintenance_margin","type":"string","format":"decimal","description":"Maintenance margin requirement post trade"},"pre_initial_margin":{"title":"pre_initial_margin","type":"string","format":"decimal","description":"Initial margin requirement before trade"},"pre_maintenance_margin":{"title":"pre_maintenance_margin","type":"string","format":"decimal","description":"Maintenance margin requirement before trade"},"subaccount_id":{"title":"subaccount_id","type":"integer","description":"Subaccount_id"}},"type":"object","additionalProperties":false}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"}}} as const
+;
+const PostPublicGetSpotFeedHistory = {"body":{"required":["currency","end_timestamp","period","start_timestamp"],"properties":{"currency":{"title":"currency","type":"string","description":"Currency"},"end_timestamp":{"title":"end_timestamp","type":"integer","description":"End timestamp"},"period":{"title":"period","type":"integer","description":"Period"},"start_timestamp":{"title":"start_timestamp","type":"integer","description":"Start timestamp"}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"},"response":{"200":{"required":["id","result"],"properties":{"id":{"anyOf":[{"title":"","type":"string"},{"title":"","type":"integer"}]},"result":{"required":["currency","spot_feed_history"],"properties":{"currency":{"title":"currency","type":"string","description":"Currency"},"spot_feed_history":{"title":"spot_feed_history","type":"array","description":"Spot feed history","items":{"required":["confidence","price","timestamp","timestamp_bucket"],"properties":{"confidence":{"title":"confidence","type":"string","format":"decimal","description":"Confidence score of the spot price"},"price":{"title":"price","type":"string","format":"decimal","description":"Spot price"},"timestamp":{"title":"timestamp","type":"integer","description":"Timestamp of when the spot price was recored into the database"},"timestamp_bucket":{"title":"timestamp_bucket","type":"integer","description":"Timestamp bucket; this value is regularly spaced out with `period` seconds between data points, missing values are forward-filled from earlier data where possible, if no earlier data is available, values are back-filled from the first observed data point"}},"type":"object","additionalProperties":false}}},"type":"object","additionalProperties":false}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"}}} as const
+;
+const PostPublicGetTicker = {"body":{"required":["instrument_name"],"properties":{"instrument_name":{"title":"instrument_name","type":"string","description":"Instrument name"}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"},"response":{"200":{"required":["id","result"],"properties":{"id":{"anyOf":[{"title":"","type":"string"},{"title":"","type":"integer"}]},"result":{"required":["amount_step","base_asset_address","base_asset_sub_id","base_currency","base_fee","best_ask_amount","best_ask_price","best_bid_amount","best_bid_price","index_price","instrument_name","instrument_type","is_active","maker_fee_rate","mark_price","max_price","maximum_amount","min_price","minimum_amount","option_details","option_pricing","perp_details","quote_currency","scheduled_activation","scheduled_deactivation","stats","taker_fee_rate","tick_size","timestamp"],"properties":{"amount_step":{"title":"amount_step","type":"string","format":"decimal","description":"Minimum valid increment of order amount"},"base_asset_address":{"title":"base_asset_address","type":"string","description":"Blockchain address of the base asset"},"base_asset_sub_id":{"title":"base_asset_sub_id","type":"string","description":"Sub ID of the specific base asset as defined in Asset.sol"},"base_currency":{"title":"base_currency","type":"string","description":"Underlying currency of base asset (`ETH`, `BTC`, etc)"},"base_fee":{"title":"base_fee","type":"string","format":"decimal","description":"$ base fee added to every taker order"},"best_ask_amount":{"title":"best_ask_amount","type":"string","format":"decimal","description":"Amount of contracts / tokens available at best ask price"},"best_ask_price":{"title":"best_ask_price","type":"string","format":"decimal","description":"Best ask price"},"best_bid_amount":{"title":"best_bid_amount","type":"string","format":"decimal","description":"Amount of contracts / tokens available at best bid price"},"best_bid_price":{"title":"best_bid_price","type":"string","format":"decimal","description":"Best bid price"},"index_price":{"title":"index_price","type":"string","format":"decimal","description":"Index price"},"instrument_name":{"title":"instrument_name","type":"string","description":"Instrument name"},"instrument_type":{"title":"instrument_type","type":"string","enum":["erc20","option","perp"],"description":"`erc20`, `option`, or `perp`\n\n`erc20` `option` `perp`"},"is_active":{"title":"is_active","type":"boolean","description":"If `True`: instrument is tradeable within `activation` and `deactivation` timestamps"},"maker_fee_rate":{"title":"maker_fee_rate","type":"string","format":"decimal","description":"Percent of spot price fee rate for makers"},"mark_price":{"title":"mark_price","type":"string","format":"decimal","description":"Mark price"},"mark_price_fee_rate_cap":{"title":"mark_price_fee_rate_cap","type":["string","null"],"format":"decimal","default":null,"description":"Percent of option price fee cap, e.g. 12.5%, null if not applicable"},"max_price":{"title":"max_price","type":"string","format":"decimal","description":"Maximum price at which an agressive buyer can be matched. Any portion of a market order that would execute above this price will be cancelled. A limit buy order with limit price above this value is treated as post only (i.e. it will be rejected if it would cross any existing resting order)."},"maximum_amount":{"title":"maximum_amount","type":"string","format":"decimal","description":"Maximum valid amount of contracts / tokens per trade"},"min_price":{"title":"min_price","type":"string","format":"decimal","description":"Minimum price at which an agressive seller can be matched. Any portion of a market order that would execute below this price will be cancelled. A limit sell order with limit price below this value is treated as post only (i.e. it will be rejected if it would cross any existing resting order)."},"minimum_amount":{"title":"minimum_amount","type":"string","format":"decimal","description":"Minimum valid amount of contracts / tokens per trade"},"option_details":{"required":["expiry","index","option_type","strike"],"properties":{"expiry":{"title":"expiry","type":"integer","description":"Unix timestamp of expiry date (in seconds)"},"index":{"title":"index","type":"string","description":"Underlying settlement price index"},"option_type":{"title":"option_type","type":"string","enum":["C","P"],"description":"`C` `P`"},"settlement_price":{"title":"settlement_price","type":["string","null"],"format":"decimal","default":null,"description":"Settlement price of the option"},"strike":{"title":"strike","type":"string","format":"decimal"}},"type":"object","additionalProperties":false},"option_pricing":{"required":["ask_iv","bid_iv","delta","forward_price","gamma","iv","mark_price","rho","theta","vega"],"properties":{"ask_iv":{"title":"ask_iv","type":"string","format":"decimal","description":"Implied volatility of the current best ask"},"bid_iv":{"title":"bid_iv","type":"string","format":"decimal","description":"Implied volatility of the current best bid"},"delta":{"title":"delta","type":"string","format":"decimal","description":"Delta of the option"},"forward_price":{"title":"forward_price","type":"string","format":"decimal","description":"Forward price used to calculate option premium"},"gamma":{"title":"gamma","type":"string","format":"decimal","description":"Gamma of the option"},"iv":{"title":"iv","type":"string","format":"decimal","description":"Implied volatility of the option"},"mark_price":{"title":"mark_price","type":"string","format":"decimal","description":"Mark price of the option"},"rho":{"title":"rho","type":"string","format":"decimal","description":"Rho of the option"},"theta":{"title":"theta","type":"string","format":"decimal","description":"Theta of the option"},"vega":{"title":"vega","type":"string","format":"decimal","description":"Vega of the option"}},"type":"object","additionalProperties":false},"perp_details":{"required":["aggregate_funding","funding_rate","index","max_rate_per_hour","min_rate_per_hour","static_interest_rate"],"properties":{"aggregate_funding":{"title":"aggregate_funding","type":"string","format":"decimal","description":"Latest aggregated funding as per `PerpAsset.sol`"},"funding_rate":{"title":"funding_rate","type":"string","format":"decimal","description":"Current hourly funding rate as per `PerpAsset.sol`"},"index":{"title":"index","type":"string","description":"Underlying spot price index for funding rate"},"max_rate_per_hour":{"title":"max_rate_per_hour","type":"string","format":"decimal","description":"Max rate per hour as per `PerpAsset.sol`"},"min_rate_per_hour":{"title":"min_rate_per_hour","type":"string","format":"decimal","description":"Min rate per hour as per `PerpAsset.sol`"},"static_interest_rate":{"title":"static_interest_rate","type":"string","format":"decimal","description":"Static interest rate as per `PerpAsset.sol`"}},"type":"object","additionalProperties":false},"quote_currency":{"title":"quote_currency","type":"string","description":"Quote currency (`USD` for perps, `USDC` for options)"},"scheduled_activation":{"title":"scheduled_activation","type":"integer","description":"Timestamp at which became or will become active (if applicable)"},"scheduled_deactivation":{"title":"scheduled_deactivation","type":"integer","description":"Scheduled deactivation time for instrument (if applicable)"},"stats":{"required":["contract_volume","high","low","num_trades","open_interest","percent_change","usd_change"],"properties":{"contract_volume":{"title":"contract_volume","type":"string","format":"decimal","description":"Number of contracts traded during last 24 hours"},"high":{"title":"high","type":"string","format":"decimal","description":"Highest trade price during last 24h"},"low":{"title":"low","type":"string","format":"decimal","description":"Lowest trade price during last 24h"},"num_trades":{"title":"num_trades","type":"string","format":"decimal","description":"Number of trades during last 24h "},"open_interest":{"title":"open_interest","type":"string","format":"decimal","description":"Current total open interest"},"percent_change":{"title":"percent_change","type":"string","format":"decimal","description":"24-hour price change expressed as a percentage. Options: percent change in vol; Perps: percent change in mark price"},"usd_change":{"title":"usd_change","type":"string","format":"decimal","description":"24-hour price change in USD."}},"type":"object","additionalProperties":false},"taker_fee_rate":{"title":"taker_fee_rate","type":"string","format":"decimal","description":"Percent of spot price fee rate for takers"},"tick_size":{"title":"tick_size","type":"string","format":"decimal","description":"Tick size of the instrument, i.e. minimum price increment"},"timestamp":{"title":"timestamp","type":"integer","description":"Timestamp of the ticker feed snapshot"}},"type":"object","additionalProperties":false}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"}}} as const
+;
+const PostPublicGetTime = {"body":{"properties":{},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"},"response":{"200":{"required":["id","result"],"properties":{"id":{"anyOf":[{"title":"","type":"string"},{"title":"","type":"integer"}]},"result":{"title":"result","type":"integer","description":"Current time in milliseconds since UNIX epoch"}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"}}} as const
+;
+const PostPublicGetTradeHistory = {"body":{"properties":{"currency":{"title":"currency","type":["string","null"],"default":null,"description":"Currency to filter by (defaults to all)"},"from_timestamp":{"title":"from_timestamp","type":"integer","default":0,"description":"Earliest timestamp to filter by (in ms since Unix epoch). If not provied, defaults to 0."},"instrument_name":{"title":"instrument_name","type":["string","null"],"default":null,"description":"Instrument name to filter by (defaults to all)"},"instrument_type":{"title":"instrument_type","type":["string","null"],"default":null,"enum":["erc20","option","perp"],"description":"Instrument type to filter by (defaults to all)\n\nDefault: `null`"},"page":{"title":"page","type":"integer","default":1,"description":"Page number of results to return (default 1, returns last if above `num_pages`)"},"page_size":{"title":"page_size","type":"integer","default":100,"description":"Number of results per page (default 100, max 1000)"},"to_timestamp":{"title":"to_timestamp","type":"integer","default":18446744073709552000,"description":"Latest timestamp to filter by (in ms since Unix epoch). If not provied, defaults to returning all data up to current time."},"tx_status":{"title":"tx_status","type":"string","default":"settled","enum":["settled","reverted"],"description":"Transaction status to filter by (default `settled`).\n\nDefault: `settled`"}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"},"response":{"200":{"required":["id","result"],"properties":{"id":{"anyOf":[{"title":"","type":"string"},{"title":"","type":"integer"}]},"result":{"required":["pagination","trades"],"properties":{"pagination":{"required":["count","num_pages"],"properties":{"count":{"title":"count","type":"integer","description":"Total number of items, across all pages"},"num_pages":{"title":"num_pages","type":"integer","description":"Number of pages"}},"type":"object","additionalProperties":false},"trades":{"title":"trades","type":"array","description":"List of trades","items":{"required":["direction","index_price","instrument_name","liquidity_role","mark_price","subaccount_id","timestamp","trade_amount","trade_fee","trade_id","trade_price","tx_hash","tx_status","wallet"],"properties":{"direction":{"title":"direction","type":"string","enum":["buy","sell"],"description":"Order direction\n\n`buy` `sell`"},"index_price":{"title":"index_price","type":"string","format":"decimal","description":"Index price of the underlying at the time of the trade"},"instrument_name":{"title":"instrument_name","type":"string","description":"Instrument name"},"liquidity_role":{"title":"liquidity_role","type":"string","enum":["maker","taker"],"description":"Role of the user in the trade\n\n`maker` `taker`"},"mark_price":{"title":"mark_price","type":"string","format":"decimal","description":"Mark price of the instrument at the time of the trade"},"subaccount_id":{"title":"subaccount_id","type":"integer","description":"Subaccount ID"},"timestamp":{"title":"timestamp","type":"integer","description":"Trade timestamp (in ms since Unix epoch)"},"trade_amount":{"title":"trade_amount","type":"string","format":"decimal","description":"Amount filled in this trade"},"trade_fee":{"title":"trade_fee","type":"string","format":"decimal","description":"Fee for this trade"},"trade_id":{"title":"trade_id","type":"string","description":"Trade ID"},"trade_price":{"title":"trade_price","type":"string","format":"decimal","description":"Price at which the trade was filled"},"tx_hash":{"title":"tx_hash","type":"string","description":"Blockchain transaction hash"},"tx_status":{"title":"tx_status","type":"string","enum":["settled","reverted"],"description":"Blockchain transaction status\n\n`settled` `reverted`"},"wallet":{"title":"wallet","type":"string","description":"Wallet address (owner) of the subaccount"}},"type":"object","additionalProperties":false}}},"type":"object","additionalProperties":false}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"}}} as const
+;
+const PostPublicGetTransaction = {"body":{"required":["transaction_id"],"properties":{"transaction_id":{"title":"transaction_id","type":"string","format":"uuid","description":"transaction_id of the transaction to get"}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"},"response":{"200":{"required":["id","result"],"properties":{"id":{"anyOf":[{"title":"","type":"string"},{"title":"","type":"integer"}]},"result":{"required":["status","transaction_hash"],"properties":{"status":{"title":"status","type":"string","enum":["requested","pending","settled","reverted","ignored"],"description":"Status of the transaction\n\n`requested` `pending` `settled` `reverted` `ignored`"},"transaction_hash":{"title":"transaction_hash","type":["string","null"],"default":null,"description":"Transaction hash of a pending tx"}},"type":"object","additionalProperties":false}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"}}} as const
+;
+const PostPublicLogin = {"body":{"required":["signature","timestamp","wallet"],"properties":{"signature":{"title":"signature","type":"string","description":"Signature of the timestamp, signed with the wallet's private key or a session key"},"timestamp":{"title":"timestamp","type":"string","description":"Message that was signed, in the form of a timestamp in ms since Unix epoch"},"wallet":{"title":"wallet","type":"string","description":"Public key (wallet) of the account"}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"},"response":{"200":{"required":["id","result"],"properties":{"id":{"anyOf":[{"title":"","type":"string"},{"title":"","type":"integer"}]},"result":{"title":"result","type":"array","description":"List of subaccount IDs that have been authenticated","items":{"title":"result","type":"integer"}}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"}}} as const
+;
+const PostPublicMarginWatch = {"body":{"required":["subaccount_id"],"properties":{"subaccount_id":{"title":"subaccount_id","type":"integer","description":"Subaccount ID to get margin for."}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"},"response":{"200":{"required":["id","result"],"properties":{"id":{"anyOf":[{"title":"","type":"string"},{"title":"","type":"integer"}]},"result":{"required":["currency","maintenance_margin","margin_type","subaccount_id","subaccount_value","valuation_timestamp"],"properties":{"currency":{"title":"currency","type":"string","description":"Currency of subaccount"},"maintenance_margin":{"title":"maintenance_margin","type":"string","format":"decimal","description":"Total maintenance margin requirement of all positions and collaterals.If this value falls below zero, the subaccount will be flagged for liquidation."},"margin_type":{"title":"margin_type","type":"string","enum":["PM","SM"],"description":"Margin type of subaccount (`PM` (Portfolio Margin) or `SM` (Standard Margin))\n\n`PM` `SM`"},"subaccount_id":{"title":"subaccount_id","type":"integer","description":"Subaccount_id"},"subaccount_value":{"title":"subaccount_value","type":"string","format":"decimal","description":"Total mark-to-market value of all positions and collaterals"},"valuation_timestamp":{"title":"valuation_timestamp","type":"integer","description":"Timestamp (in seconds since epoch) of when margin and MtM were computed."}},"type":"object","additionalProperties":false}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"}}} as const
+;
+const PostPublicRegisterSessionKey = {"body":{"required":["expiry_sec","label","public_session_key","signed_raw_tx","wallet"],"properties":{"expiry_sec":{"title":"expiry_sec","type":"integer","description":"Expiry of the session key"},"label":{"title":"label","type":"string","description":"Ethereum wallet address"},"public_session_key":{"title":"public_session_key","type":"string","description":"Session key in the form of an Ethereum EOA"},"signed_raw_tx":{"title":"signed_raw_tx","type":"string","description":"A signed RLP encoded ETH transaction in form of a hex string (same as `w3.eth.account.sign_transaction(unsigned_tx, private_key).rawTransaction.hex()`)"},"wallet":{"title":"wallet","type":"string","description":"Ethereum wallet address of account"}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"},"response":{"200":{"required":["id","result"],"properties":{"id":{"anyOf":[{"title":"","type":"string"},{"title":"","type":"integer"}]},"result":{"required":["label","public_session_key","transaction_id"],"properties":{"label":{"title":"label","type":"string","description":"User-defined session key label"},"public_session_key":{"title":"public_session_key","type":"string","description":"Session key in the form of an Ethereum EOA"},"transaction_id":{"title":"transaction_id","type":"string","format":"uuid","description":"ID to lookup status of transaction"}},"type":"object","additionalProperties":false}},"type":"object","additionalProperties":false,"$schema":"http://json-schema.org/draft-04/schema#"}}} as const
+;
+export { PostPrivateCancel, PostPrivateCancelAll, PostPrivateCancelByInstrument, PostPrivateCancelByLabel, PostPrivateCancelByNonce, PostPrivateChangeSessionKeyLabel, PostPrivateChangeSubaccountLabel, PostPrivateCreateSubaccount, PostPrivateDeposit, PostPrivateExpiredAndCancelledHistory, PostPrivateGetAccount, PostPrivateGetCollaterals, PostPrivateGetDepositHistory, PostPrivateGetErc20TransferHistory, PostPrivateGetFundingHistory, PostPrivateGetInterestHistory, PostPrivateGetLiquidationHistory, PostPrivateGetMargin, PostPrivateGetMmpConfig, PostPrivateGetNotifications, PostPrivateGetOpenOrders, PostPrivateGetOptionSettlementHistory, PostPrivateGetOrder, PostPrivateGetOrderHistory, PostPrivateGetOrders, PostPrivateGetPositions, PostPrivateGetSubaccount, PostPrivateGetSubaccountValueHistory, PostPrivateGetSubaccounts, PostPrivateGetTradeHistory, PostPrivateGetWithdrawalHistory, PostPrivateOrder, PostPrivateOrderDebug, PostPrivateResetMmp, PostPrivateSessionKeys, PostPrivateSetCancelOnDisconnect, PostPrivateSetMmpConfig, PostPrivateTransferErc20, PostPrivateTransferPosition, PostPrivateUpdateNotifications, PostPrivateWithdraw, PostPublicBuildRegisterSessionKeyTx, PostPublicCreateAccount, PostPublicCreateSubaccountDebug, PostPublicDeregisterSessionKey, PostPublicGetInstrument, PostPublicGetInstruments, PostPublicGetLatestSignedFeeds, PostPublicGetMargin, PostPublicGetSpotFeedHistory, PostPublicGetTicker, PostPublicGetTime, PostPublicGetTradeHistory, PostPublicGetTransaction, PostPublicLogin, PostPublicMarginWatch, PostPublicRegisterSessionKey }
diff --git a/app/src/api/types.ts b/app/src/api/types.ts
new file mode 100644
index 0000000..6c650b4
--- /dev/null
+++ b/app/src/api/types.ts
@@ -0,0 +1,117 @@
+import type { FromSchema } from 'json-schema-to-ts';
+import * as schemas from './schemas';
+
+export type PostPrivateCancelAllBodyParam = FromSchema;
+export type PostPrivateCancelAllResponse200 = FromSchema;
+export type PostPrivateCancelBodyParam = FromSchema;
+export type PostPrivateCancelByInstrumentBodyParam = FromSchema;
+export type PostPrivateCancelByInstrumentResponse200 = FromSchema;
+export type PostPrivateCancelByLabelBodyParam = FromSchema;
+export type PostPrivateCancelByLabelResponse200 = FromSchema;
+export type PostPrivateCancelByNonceBodyParam = FromSchema;
+export type PostPrivateCancelByNonceResponse200 = FromSchema;
+export type PostPrivateCancelResponse200 = FromSchema;
+export type PostPrivateChangeSessionKeyLabelBodyParam = FromSchema;
+export type PostPrivateChangeSessionKeyLabelResponse200 = FromSchema;
+export type PostPrivateChangeSubaccountLabelBodyParam = FromSchema;
+export type PostPrivateChangeSubaccountLabelResponse200 = FromSchema;
+export type PostPrivateCreateSubaccountBodyParam = FromSchema;
+export type PostPrivateCreateSubaccountResponse200 = FromSchema;
+export type PostPrivateDepositBodyParam = FromSchema;
+export type PostPrivateDepositResponse200 = FromSchema;
+export type PostPrivateExpiredAndCancelledHistoryBodyParam = FromSchema;
+export type PostPrivateExpiredAndCancelledHistoryResponse200 = FromSchema;
+export type PostPrivateGetAccountBodyParam = FromSchema;
+export type PostPrivateGetAccountResponse200 = FromSchema;
+export type PostPrivateGetCollateralsBodyParam = FromSchema;
+export type PostPrivateGetCollateralsResponse200 = FromSchema;
+export type PostPrivateGetDepositHistoryBodyParam = FromSchema;
+export type PostPrivateGetDepositHistoryResponse200 = FromSchema;
+export type PostPrivateGetErc20TransferHistoryBodyParam = FromSchema;
+export type PostPrivateGetErc20TransferHistoryResponse200 = FromSchema;
+export type PostPrivateGetFundingHistoryBodyParam = FromSchema;
+export type PostPrivateGetFundingHistoryResponse200 = FromSchema;
+export type PostPrivateGetInterestHistoryBodyParam = FromSchema;
+export type PostPrivateGetInterestHistoryResponse200 = FromSchema;
+export type PostPrivateGetLiquidationHistoryBodyParam = FromSchema;
+export type PostPrivateGetLiquidationHistoryResponse200 = FromSchema;
+export type PostPrivateGetMarginBodyParam = FromSchema;
+export type PostPrivateGetMarginResponse200 = FromSchema;
+export type PostPrivateGetMmpConfigBodyParam = FromSchema;
+export type PostPrivateGetMmpConfigResponse200 = FromSchema;
+export type PostPrivateGetNotificationsBodyParam = FromSchema;
+export type PostPrivateGetNotificationsResponse200 = FromSchema;
+export type PostPrivateGetOpenOrdersBodyParam = FromSchema;
+export type PostPrivateGetOpenOrdersResponse200 = FromSchema;
+export type PostPrivateGetOptionSettlementHistoryBodyParam = FromSchema;
+export type PostPrivateGetOptionSettlementHistoryResponse200 = FromSchema;
+export type PostPrivateGetOrderBodyParam = FromSchema;
+export type PostPrivateGetOrderHistoryBodyParam = FromSchema;
+export type PostPrivateGetOrderHistoryResponse200 = FromSchema;
+export type PostPrivateGetOrderResponse200 = FromSchema;
+export type PostPrivateGetOrdersBodyParam = FromSchema;
+export type PostPrivateGetOrdersResponse200 = FromSchema;
+export type PostPrivateGetPositionsBodyParam = FromSchema;
+export type PostPrivateGetPositionsResponse200 = FromSchema;
+export type PostPrivateGetSubaccountBodyParam = FromSchema;
+export type PostPrivateGetSubaccountResponse200 = FromSchema;
+export type PostPrivateGetSubaccountValueHistoryBodyParam = FromSchema;
+export type PostPrivateGetSubaccountValueHistoryResponse200 = FromSchema;
+export type PostPrivateGetSubaccountsBodyParam = FromSchema;
+export type PostPrivateGetSubaccountsResponse200 = FromSchema;
+export type PostPrivateGetTradeHistoryBodyParam = FromSchema