Use the TypeScript V2 trading defaults and keep protocol fees, builder attribution, and application fees distinct.
Install only the dependencies for the execution model you use. The injected
wallet/user-owned flow needs only:For optional zero-builder attribution backed by the signing wallet, see User-owned execution. For an injected-wallet application, follow Connect Wallet to order.
npm install polynode-sdk@^0.15.0 viem
For a server-signer trader, add the CLOB client and SQLite only when that
process uses them:
The optional official Polymarket relayer client currently brings legacy
Axios/ethers audit advisories into a full trading install. Polynode SDK 0.14.2
does not bundle that dependency tree: its only direct runtime dependency is
viem. Pin the relayer client to the SDK’s declared peer version, keep relayer
destinations fixed, and review upstream updates before changing that pin.
This version also trades Polymarket Protocol V2 markets, a separate and newer change from the V2 exchange default below, with the same calls and no config change. See Polymarket Protocol V2 markets.
Polymarket V2 is the default. You do not need to set exchangeVersion, but setting it explicitly can make a migration easier to review:
import { PolyNodeTrader } from 'polynode-sdk';const apiKey = process.env.POLYNODE_API_KEY;const privateKey = process.env.POLYGON_PRIVATE_KEY;if (!apiKey || !privateKey) throw new Error('Set the required environment variables');const trader = new PolyNodeTrader({ polynodeKey: apiKey, exchangeVersion: 'v2', builderCode: process.env.POLYMARKET_BUILDER_CODE,});const ready = await trader.ensureReady(privateKey);console.log('funder address', ready.funderAddress);
ensureReady() can deploy or approve wallet contracts and is state-changing for a new wallet. After the returned funder address is funded, trader.order(...) places a real order.V2 fees are applied by Polymarket at match time. Do not add legacy feeRateBps, nonce, or taker fields to a V2 signed order. A builder code attributes eligible volume; it does not itself charge an application fee. feeConfig is a separate, optional application-fee feature and remains disabled unless you configure it.
Read Trading and fees before running state-changing examples. It covers funding, cancellations, builder overrides, current V2 fee behavior, position operations, and cleanup.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"PolyNode","colors":{"primary":"#3b82f6","light":"#60a5fa","dark":"#2563eb"},"logo":{"light":"https://mintcdn.com/polynode/zluszUOhqmSDk1RK/images/logo-light.png?fit=max\u0026auto=format\u0026n=zluszUOhqmSDk1RK\u0026q=85\u0026s=fc49b798da5a361cb76f4733f13230dd","dark":"https://mintcdn.com/polynode/zluszUOhqmSDk1RK/images/logo-dark.png?fit=max\u0026auto=format\u0026n=zluszUOhqmSDk1RK\u0026q=85\u0026s=6d316edd9113e88a6c4e2973cc12438d"},"favicon":"https://mintcdn.com/polynode/zluszUOhqmSDk1RK/images/favicon.png?fit=max\u0026auto=format\u0026n=zluszUOhqmSDk1RK\u0026q=85\u0026s=0bf4f722dd9d5dddb849158b764adad4","api":{"playground":{}},"navbar":{"links":[{"href":"https://api.polynode.dev/v1/status","label":"API Status"}],"primary":{"type":"button","label":"Get API Key","href":"https://polynode.dev"}},"styling":{"latex":true},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"polynode","hasAudioNarration":false,"actualSubdomain":"polynode","customDomains":["docs.polynode.dev"],"gitSource":{"type":"github","owner":"joinquantish","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"entitlements":{},"buildId":"6aec02b5baf429d562e676ed","clientVersion":"0.0.4094","searchFilterCounts":[{"language":"default","tag":"API Reference","count":245},{"language":"default","tag":"Query Catalog","count":67},{"language":"default","tag":"SDKs","count":51},{"language":"default","tag":"Guides","count":35},{"language":"default","tag":"Webhooks","count":26},{"language":"default","tag":"Changelog","count":23},{"language":"default","tag":"Archive","count":22},{"language":"default","tag":"WebSocket","count":21},{"language":"default","tag":"Perps Market Data","count":16},{"language":"default","tag":"Event Types","count":16}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"sdks/ts/trading","slug":"/sdks/ts/trading","pageMetadata":{"title":"TypeScript Trading and Fees","sidebarTitle":"Trading \u0026 Fees","description":"Use the TypeScript V2 trading defaults and keep protocol fees, builder attribution, and application fees distinct.","icon":"arrow-right-arrow-left","href":"/sdks/ts/trading"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Use the TypeScript V2 trading defaults and keep protocol fees, builder attribution, and application fees distinct.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,pre:`pre`,span:`span`,..._provideComponents(),...props.components},{CodeBlock,Note,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Note)_missingMdxReference(`Note`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`Install only the dependencies for the execution model you use. The injected\nwallet/user-owned flow needs only:`}),`\n`,_jsxs(_components.p,{children:[`For optional zero-builder attribution backed by the signing wallet, see `,_jsx(_components.a,{href:`/sdks/user-owned-execution`,children:`User-owned execution`}),`. For an injected-wallet application, follow `,_jsx(_components.a,{href:`/sdks/user-owned-web-app`,children:`Connect Wallet to order`}),`.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`npm`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` install`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` polynode-sdk@^0.15.0`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` viem`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`For a server-signer trader, add the CLOB client and SQLite only when that\nprocess uses them:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`npm`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` install`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` @polymarket/clob-client@^5.8.1`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` better-sqlite3`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Only a separate shared-builder relayer integration needs these peers:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`npm`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` install`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` @polymarket/builder-relayer-client@0.0.10`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` @polymarket/builder-signing-sdk@^1.0.0`})}),`\n`]})})}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`The optional official Polymarket relayer client currently brings legacy\nAxios/ethers audit advisories into a full trading install. Polynode SDK 0.14.2\ndoes not bundle that dependency tree: its only direct runtime dependency is\n`,_jsx(_components.code,{children:`viem`}),`. Pin the relayer client to the SDK’s declared peer version, keep relayer\ndestinations fixed, and review upstream updates before changing that pin.`]})}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[`This version also trades Polymarket Protocol V2 markets, a separate and newer change from the V2 exchange default below, with the same calls and no config change. See `,_jsx(_components.a,{href:`/guides/polymarket-protocol-v2`,children:`Polymarket Protocol V2 markets`}),`.`]})}),`\n`,_jsxs(_components.p,{children:[`Polymarket V2 is the default. You do not need to set `,_jsx(_components.code,{children:`exchangeVersion`}),`, but setting it explicitly can make a migration easier to review:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`14`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`14`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`PolyNodeTrader`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'polynode-sdk'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` apiKey`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` process`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`env`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`POLYNODE_API_KEY`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` privateKey`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` process`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`env`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`POLYGON_PRIVATE_KEY`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`!`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`apiKey`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ||`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` !`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`privateKey`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`throw`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` Error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'Set the required environment variables'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` trader`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` PolyNodeTrader`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` polynodeKey:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` apiKey`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` exchangeVersion:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'v2'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` builderCode:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` process`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`env`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`POLYMARKET_BUILDER_CODE`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` ready`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` trader`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`ensureReady`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`privateKey`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`log`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'funder address'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`ready`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`funderAddress`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`ensureReady()`}),` can deploy or approve wallet contracts and is state-changing for a new wallet. After the returned funder address is funded, `,_jsx(_components.code,{children:`trader.order(...)`}),` places a real order.`]}),`\n`,_jsxs(_components.p,{children:[`V2 fees are applied by Polymarket at match time. Do not add legacy `,_jsx(_components.code,{children:`feeRateBps`}),`, `,_jsx(_components.code,{children:`nonce`}),`, or `,_jsx(_components.code,{children:`taker`}),` fields to a V2 signed order. A builder code attributes eligible volume; it does not itself charge an application fee. `,_jsx(_components.code,{children:`feeConfig`}),` is a separate, optional application-fee feature and remains disabled unless you configure it.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`14`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`14`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`try`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` result`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` trader`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`order`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` tokenId:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` process`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`env`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`POLYMARKET_TOKEN_ID`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`!`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` side:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'BUY'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` price:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 0.55`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` size:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 10`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` type:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'GTC'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` postOnly:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` true`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`!`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`result`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`success`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`throw`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` Error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`result`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`error`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ??`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Order rejected'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`log`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`result`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`orderId`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`} `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`finally`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` trader`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`close`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Read `,_jsx(_components.a,{href:`/sdks/trading`,children:`Trading and fees`}),` before running state-changing examples. It covers funding, cancellations, builder overrides, current V2 fee behavior, position operations, and cleanup.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"TypeScript Trading and Fees","sidebarTitle":"Trading \u0026 Fees","description":"Use the TypeScript V2 trading defaults and keep protocol fees, builder attribution, and application fees distinct.","icon":"arrow-right-arrow-left","href":"/sdks/ts/trading"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":["/_mintlify/custom/polynode/0d40c5db9faacad8/slug-calculator.js"],"subdomain":"polynode","siteName":"PolyNode","title":"TypeScript Trading and Fees - PolyNode","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-11T04:26:46.069Z","originalFileLocation":"sdks/ts/trading.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Use the TypeScript V2 trading defaults and keep protocol fees, builder attribution, and application fees distinct.\">\u003cmeta data-mint-head name=\"application-name\" content=\"PolyNode\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/polynode/nh0EcUVk_uYhjcGA/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/polynode/nh0EcUVk_uYhjcGA/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/polynode/nh0EcUVk_uYhjcGA/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/polynode/nh0EcUVk_uYhjcGA/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/polynode/nh0EcUVk_uYhjcGA/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/polynode/nh0EcUVk_uYhjcGA/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/polynode/nh0EcUVk_uYhjcGA/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/polynode/nh0EcUVk_uYhjcGA/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/polynode/nh0EcUVk_uYhjcGA/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"TypeScript Trading and Fees - PolyNode\">\u003cmeta data-mint-head property=\"og:description\" content=\"Use the TypeScript V2 trading defaults and keep protocol fees, builder attribution, and application fees distinct.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"PolyNode\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.polynode.dev/sdks/ts/trading\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://polynode.mintlify.site/_mintlify/api/og/v2?division=TypeScript\u0026amp;title=TypeScript+Trading+and+Fees\u0026amp;description=Use+the+TypeScript+V2+trading+defaults+and+keep+protocol+fees%2C+builder+attribution%2C+and+application+fees+distinct.\u0026amp;theme=121c1386b08658be3ccff004\u0026amp;signature=ac14af18dc6ee0175365ac64e1a8ed04d67d848bd553622e9067d490d1a3058e\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"TypeScript Trading and Fees - PolyNode\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Use the TypeScript V2 trading defaults and keep protocol fees, builder attribution, and application fees distinct.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://polynode.mintlify.site/_mintlify/api/og/v2?division=TypeScript\u0026amp;title=TypeScript+Trading+and+Fees\u0026amp;description=Use+the+TypeScript+V2+trading+defaults+and+keep+protocol+fees%2C+builder+attribution%2C+and+application+fees+distinct.\u0026amp;theme=121c1386b08658be3ccff004\u0026amp;signature=ac14af18dc6ee0175365ac64e1a8ed04d67d848bd553622e9067d490d1a3058e\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/polynode/nh0EcUVk_uYhjcGA/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"PolyNode\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#3b82f6\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.polynode.dev/sdks/ts/trading\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/sdks/ts/trading.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.polynode.dev/#organization\",\"name\":\"PolyNode\",\"url\":\"https://docs.polynode.dev\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/polynode/zluszUOhqmSDk1RK/images/logo-light.png?fit=max\u0026auto=format\u0026n=zluszUOhqmSDk1RK\u0026q=85\u0026s=fc49b798da5a361cb76f4733f13230dd\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.polynode.dev#website\",\"name\":\"PolyNode\",\"url\":\"https://docs.polynode.dev\",\"publisher\":{\"@id\":\"https://docs.polynode.dev/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.polynode.dev/sdks/ts/trading#webpage\",\"url\":\"https://docs.polynode.dev/sdks/ts/trading\",\"name\":\"TypeScript Trading and Fees\",\"description\":\"Use the TypeScript V2 trading defaults and keep protocol fees, builder attribution, and application fees distinct.\",\"dateModified\":\"2026-10-11T04:26:46.069Z\",\"isPartOf\":{\"@id\":\"https://docs.polynode.dev#website\"},\"breadcrumb\":{\"@id\":\"https://docs.polynode.dev/sdks/ts/trading#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.polynode.dev/sdks/ts/trading#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"TypeScript\",\"item\":\"https://docs.polynode.dev/sdks/ts/overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"TypeScript Trading and Fees\",\"item\":\"https://docs.polynode.dev/sdks/ts/trading\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.polynode.dev/sdks/ts/trading#article\",\"headline\":\"TypeScript Trading and Fees\",\"name\":\"TypeScript Trading and Fees\",\"description\":\"Use the TypeScript V2 trading defaults and keep protocol fees, builder attribution, and application fees distinct.\",\"url\":\"https://docs.polynode.dev/sdks/ts/trading\",\"mainEntityOfPage\":{\"@id\":\"https://docs.polynode.dev/sdks/ts/trading#webpage\"},\"dateModified\":\"2026-10-11T04:26:46.069Z\",\"publisher\":{\"@id\":\"https://docs.polynode.dev/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.polynode.dev#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"PolyNode\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"PolyNode","nav":{"global":null,"tabs":[{"tab":"WebSocket","pages":[{"title":"WebSocket","href":"/websocket/overview"}]},{"tab":"Webhooks","pages":[{"title":"Webhooks","href":"/webhooks/overview"}]},{"tab":"API Reference","pages":[{"title":"API Reference","href":"/api-reference/overview"}]},{"tab":"Crypto Prices","pages":[{"title":"Crypto Prices","href":"/crypto/overview"}]},{"tab":"Orderbook","pages":[{"title":"Orderbook","href":"/orderbook/overview"}]},{"tab":"RPC","pages":[{"title":"RPC","href":"/rpc/overview"}]},{"tab":"CLI","pages":[{"title":"CLI","href":"/cli/overview"}]},{"tab":"Trading","pages":[{"title":"Trading","href":"/sdks/trading"}]},{"tab":"SDKs","groups":[{"group":"Getting Started","pages":[{"title":"Polynode SDKs","sidebarTitle":"Overview","icon":"code","href":"/sdks/overview"}]},{"group":"Core Guides","pages":[{"title":"Complete V3 API","sidebarTitle":"V3 API","icon":"database","href":"/sdks/v3-api"},{"title":"Settlement and Event Streams","sidebarTitle":"Settlement Stream","icon":"bolt","href":"/sdks/websocket-streaming"},{"title":"Short-Form Markets and Chainlink TWAP","sidebarTitle":"Short-Form and TWAP","icon":"clock","href":"/sdks/short-form"},{"title":"Orderbook Streaming and PN1","sidebarTitle":"Orderbook and PN1","icon":"layer-group","href":"/sdks/orderbook"},{"title":"Perps WebSocket","sidebarTitle":"Perps Stream","icon":"chart-line","href":"/sdks/perps"},{"title":"Trading and Fees","sidebarTitle":"Trading \u0026 Fees","icon":"arrow-right-arrow-left","href":"/sdks/trading"},{"title":"User-owned execution","sidebarTitle":"User-owned execution","icon":"user-shield","href":"/sdks/user-owned-execution"},{"title":"Web app: connect wallet to an order","sidebarTitle":"Connect wallet to an order","icon":"browser","href":"/sdks/user-owned-web-app"}]},{"group":"Optional Helpers","pages":[{"title":"REST Clients","sidebarTitle":"REST Clients","icon":"globe","href":"/sdks/rest-api"},{"title":"Local Cache","sidebarTitle":"Local Cache","icon":"database","href":"/sdks/local-cache"},{"title":"Redemption Watcher","sidebarTitle":"Redemption Watcher","icon":"bell","href":"/sdks/redemption-watcher"},{"title":"RPC Helper","sidebarTitle":"RPC","icon":"plug","href":"/sdks/rpc"}]},{"group":"TypeScript","pages":[{"title":"TypeScript SDK","sidebarTitle":"Overview","icon":"js","href":"/sdks/ts/overview"},{"title":"TypeScript V3 API","sidebarTitle":"V3 API","icon":"database","href":"/sdks/ts/v3-data"},{"title":"TypeScript Settlement Stream","sidebarTitle":"Settlement Stream","icon":"bolt","href":"/sdks/ts/websocket"},{"title":"TypeScript Short-Form and TWAP","sidebarTitle":"Short-Form \u0026 TWAP","icon":"clock","href":"/sdks/ts/short-form"},{"title":"TypeScript PN1 Orderbook","sidebarTitle":"Orderbook \u0026 PN1","icon":"book-open","href":"/sdks/ts/orderbook"},{"title":"TypeScript Perps Stream","sidebarTitle":"Perps Stream","description":"Subscribe to managed perps tickers, BBO, full books, trades, statistics, and klines.","icon":"chart-line","href":"/sdks/ts/perps"},{"title":"TypeScript Trading and Fees","sidebarTitle":"Trading \u0026 Fees","icon":"arrow-right-arrow-left","href":"/sdks/ts/trading"},{"title":"TypeScript Configuration","sidebarTitle":"Configuration","description":"Configure PolyNode TypeScript endpoints, timeouts, reconnects, replay buffers, and integrity behavior.","icon":"sliders","href":"/sdks/ts/config"},{"title":"TypeScript Errors","sidebarTitle":"Errors","icon":"triangle-exclamation","href":"/sdks/ts/errors"},{"title":"TypeScript Types","sidebarTitle":"Types","icon":"shapes","href":"/sdks/ts/types"},{"title":"TypeScript REST Compatibility","sidebarTitle":"REST Compatibility","icon":"arrows-left-right","href":"/sdks/ts/rest-api"}]},{"group":"Python","pages":[{"title":"Python SDK","sidebarTitle":"Overview","icon":"python","href":"/sdks/python/overview"},{"title":"Python V3 API","sidebarTitle":"V3 API","icon":"database","href":"/sdks/python/v3-api"},{"title":"Python Settlement Stream","sidebarTitle":"Settlement Stream","icon":"bolt","href":"/sdks/python/websocket"},{"title":"Python Short-Form and TWAP","sidebarTitle":"Short-Form \u0026 TWAP","icon":"clock","href":"/sdks/python/short-form"},{"title":"Python PN1 Orderbook","sidebarTitle":"Orderbook \u0026 PN1","icon":"book-open","href":"/sdks/python/orderbook"},{"title":"Python Perps Stream","sidebarTitle":"Perps Stream","icon":"chart-line","href":"/sdks/python/perps"},{"title":"Python Trading and Fees","sidebarTitle":"Trading \u0026 Fees","icon":"arrow-right-arrow-left","href":"/sdks/python/trading"},{"title":"Python Configuration","sidebarTitle":"Configuration","icon":"sliders","href":"/sdks/python/config"},{"title":"Python Errors","sidebarTitle":"Errors","icon":"triangle-exclamation","href":"/sdks/python/errors"},{"title":"Python Models","sidebarTitle":"Models","icon":"shapes","href":"/sdks/python/models"},{"title":"Python REST Compatibility","sidebarTitle":"REST Compatibility","icon":"arrows-left-right","href":"/sdks/python/rest-api"}]},{"group":"Rust","pages":[{"title":"Rust SDK","sidebarTitle":"Overview","icon":"rust","href":"/sdks/rust/overview"},{"title":"Rust V3 API","sidebarTitle":"V3 API","icon":"database","href":"/sdks/rust/v3-api"},{"title":"Rust Settlement Stream","sidebarTitle":"Settlement Stream","icon":"bolt","href":"/sdks/rust/websocket"},{"title":"Rust Short-Form and TWAP","sidebarTitle":"Short-Form \u0026 TWAP","icon":"clock","href":"/sdks/rust/short-form"},{"title":"Rust PN1 Orderbook","sidebarTitle":"Orderbook \u0026 PN1","icon":"book-open","href":"/sdks/rust/orderbook"},{"title":"Rust Perps Stream","sidebarTitle":"Perps Stream","icon":"chart-line","href":"/sdks/rust/perps"},{"title":"Rust Trading and Fees","sidebarTitle":"Trading \u0026 Fees","icon":"arrow-right-arrow-left","href":"/sdks/rust/trading"},{"title":"Rust Configuration","sidebarTitle":"Configuration","icon":"sliders","href":"/sdks/rust/config"},{"title":"Rust Errors","sidebarTitle":"Errors","icon":"triangle-exclamation","href":"/sdks/rust/errors"},{"title":"Rust REST Compatibility","sidebarTitle":"REST Compatibility","icon":"arrows-left-right","href":"/sdks/rust/rest-api"}]},{"group":"Charts (Browser)","pages":[{"title":"Charts SDK","sidebarTitle":"Overview","icon":"chart-line","href":"/charts/overview"},{"title":"Getting Started","href":"/charts/getting-started"},{"title":"API Reference","href":"/charts/api-reference"},{"title":"Data Providers","sidebarTitle":"Data Providers","href":"/charts/data-providers"},{"title":"Live Streaming","href":"/charts/live-streaming"},{"title":"Examples","sidebarTitle":"Examples","href":"/charts/examples"}]}]},{"tab":"Changelog","pages":[{"title":"Changelog","href":"/changelog"}]},{"tab":"Guides","pages":[{"title":"Guides","href":"/introduction"}]},{"tab":"Case Studies","pages":[{"title":"Case Studies","href":"/case-studies/overview"}]}]},"basePath":"","title":"TypeScript Trading and Fees - PolyNode","buildId":"dpl_42LwxxU1kGN114H4XzwGYXa9ZDah","deploymentId":"dpl_42LwxxU1kGN114H4XzwGYXa9ZDah","dynamics":[],"chunks":[]}