{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Orders Subscription & Events","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"orders-subscription--events","__idx":0},"children":["Orders Subscription & Events"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"subscribtion-method","__idx":1},"children":["Subscribtion Method"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"subscribe_orders_api","__idx":2},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["subscribe_orders_api"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Subscribe to real-time order updates using your API key."," ","It also returns all active orders at the time of subscription."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Request:"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"javascript","header":{"controls":{"copy":{}}},"source":"{\n  \"apiKey\": \"your-api-key-here\"\n}\n","lang":"javascript"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Response example:"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["It returns an array of all active orders"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"javascript","header":{"controls":{"copy":{}}},"source":"{\n   \"orders\": [\n      {\n         \"order\": {\n            \"autoSellSettings\": {\n               \"enabled\": true,\n               \"strategy\": {\n                  \"profitTargets\": [\n                     {\n                        \"multiplier\": 1.01,\n                        \"sellPercentage\": 50,\n                        \"trailingStopLossAfter\": 20\n                     },\n                     {\n                        \"multiplier\": 1.02,\n                        \"sellPercentage\": 30,\n                        \"trailingStopLossAfter\": 30\n                     },\n                     {\n                        \"multiplier\": 1.03,\n                        \"sellPercentage\": 20,\n                        \"trailingStopLossAfter\": 20\n                     },\n                     {\n                        \"multiplier\": 1.04,\n                        \"sellPercentage\": 0,\n                        \"trailingStopLossAfter\": 0\n                     }\n                  ],\n                  \"stopLossPercentage\": 25,\n                  \"stopLossType\": \"trailing\",\n                  \"strategyName\": \"grid\"\n               }\n            },\n            \"createdAt\": \"2025-07-25T22:00:47.064Z\",\n            \"errorType\": null,\n            \"executedAt\": null,\n            \"expiresAt\": \"2025-07-26T02:00:47.062Z\",\n            \"id\": 75950,\n            \"inputAmount\": \"0.0001\",\n            \"jitoTipInSolana\": \"0\",\n            \"logicalOperator\": \"AND\",\n            \"orderStatus\": \"pending\",\n            \"prioritizationFeeInSolana\": \"0\",\n            \"slippage\": 0,\n            \"solPriceInUSDAtTimeOfBuying\": null,\n            \"solPriceInUSDAtTimeOfPlacingOrder\": \"185.1539785\",\n            \"timeoutRetryCount\": 0,\n            \"tokenAddress\": \"5MWtJ6n3LmgGNTCo8sRpsJCcXgvD9TguWNAdqvkwbonk\",\n            \"tokenPriceInUSDAtTimeOfBuying\": null,\n            \"tokenPriceInUSDAtTimeOfPlacingOrder\": \"0.000009408065947372651\",\n            \"transactionId\": null,\n            \"userId\": 1235,\n            \"walletAddresses\": [\n               \"55qd4sXuD9sxNuB81zt774Yu1TmCXDRgJtcERtPkQWxt\"\n            ],\n            \"weirdErrorRetryCount\": 0\n         },\n         \"order_conditions\": [\n            {\n               \"conditionType\": \"price_change\",\n               \"id\": 75940,\n               \"maxValue\": \"0.000007056049460529488\",\n               \"minValue\": \"0.0000061152428657922234\",\n               \"orderId\": 75950,\n               \"referenceValue\": \"0.000009408065947372651\"\n            }\n         ],\n         \"tokenExtraInfo\": {\n            \"tokenDecimals\": 6,\n            \"tokenImage\": \"https://ipfs.launchblitz.ai/file/cce750e2-49be-47b2-8884-48c74edcef88.jpg\",\n            \"tokenName\": \"Rug\",\n            \"tokenSymbol\": \"RUG\",\n            \"totalSupply\": 999631926.011981\n         }\n      }\n   ],\n   \"timestamp\": 1753480850362\n}\n","lang":"javascript"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"order-events","__idx":3},"children":["Order Events"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Event"},"children":["Event"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["order_created"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["A new order was placed"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["order_executed"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["An order was filled/completed"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["order_cancelled"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["An order was cancelled"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["order_failed"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["An order failed to execute"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["order_expire"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["An order expired"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"event-data-structure","__idx":4},"children":["Event Data Structure"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/assets/interfaces.0041f78313d0b18b80c38f92ca1f886e06dafb3855649a1eea8ef3adc88293c0.b6def933.rar"},"children":["Download Typescript Interfaces"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"javascript","header":{"controls":{"copy":{}}},"source":"{\n  \"order\": SelectOrder,           // Basic order info\n  \"timestamp\": 1642694400000,\n  \"type\": \"create\" | \"execute\" | \"cancel\" | \"fail\" | \"expire\"\n}\n","lang":"javascript"},"children":[]}]},"headings":[{"value":"Orders Subscription & Events","id":"orders-subscription--events","depth":1},{"value":"Subscribtion Method","id":"subscribtion-method","depth":2},{"value":"subscribe_orders_api","id":"subscribe_orders_api","depth":4},{"value":"Order Events","id":"order-events","depth":2},{"value":"Event Data Structure","id":"event-data-structure","depth":4}],"frontmatter":{"seo":{"title":"Orders Subscription & Events"}},"lastModified":"2026-01-18T19:18:00.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/websockets/order-subscribtion","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}