POST /api/referrals/bindAttaches a referrer to a wallet from an EIP-712 signature.Only accepted while the wallet has never traded on a covered chain. Afterwards it returns 409 AlreadyTraded, permanently. Bind at onboarding, before the wallet reaches the exchange. See Referrals.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Gains Network","colors":{"primary":"#16A34A","light":"#07C983","dark":"#15803D"},"logo":{"light":"https://mintcdn.com/gains/FCyVOdVfN-_VqQ5X/logo/gains.png?fit=max\u0026auto=format\u0026n=FCyVOdVfN-_VqQ5X\u0026q=85\u0026s=576fad34f2d6042b81905e874db68f39","dark":"https://mintcdn.com/gains/FCyVOdVfN-_VqQ5X/logo/gains.png?fit=max\u0026auto=format\u0026n=FCyVOdVfN-_VqQ5X\u0026q=85\u0026s=576fad34f2d6042b81905e874db68f39"},"favicon":"https://mintcdn.com/gains/IoupFIThDEsTzJuI/favicon.png?fit=max\u0026auto=format\u0026n=IoupFIThDEsTzJuI\u0026q=85\u0026s=03b08ffe521c388d78506bdb3a3ed215","navbar":{"primary":{"type":"button","label":"Start Trading","href":"https://gains.trade/trading"}},"footer":{"socials":{"x":"https://x.com/gains_trade","github":"https://github.com/GainsNetwork","telegram":"https://t.me/GainsNetwork","discord":"https://discord.gg/CZzb5XQpYQ"}},"seo":{"metatags":{"og:image":"/images/og-image.png","twitter:image":"/images/og-image.png","twitter:card":"summary_large_image"}},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","mcp","cursor","vscode"],"display":"header"},"styling":{"latex":true},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"gains","hasAudioNarration":false,"actualSubdomain":"gains","customDomains":["docs.gains.trade"],"gitSource":{"type":"github","owner":"gainsnetwork-org","repo":"gains-misc-monorepo","deployBranch":"main","contentDirectory":"docs/mintlify-docs","isPrivate":true,"mountPath":"","label":""},"chroma":{"collectionId":"8622f6b2-e0a6-4836-8099-a2f450b43408","liveDeploymentHistoryId":"6ae3bde3cc4c151649ace2cb","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ae3bde3cc4c151649ace2cb"},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6ae3bde3cc4c151649ace2cb","clientVersion":"0.0.4064","searchFilterCounts":[{"language":"default","tag":"Developers","count":243},{"language":"default","tag":"Technical Reference","count":114},{"language":"default","tag":"Contracts","count":111},{"language":"default","tag":"API Reference","count":74},{"language":"default","tag":"Interfaces","count":50},{"language":"default","tag":"Libraries","count":40},{"language":"default","tag":"Trading API","count":37},{"language":"default","tag":"Reference","count":28},{"language":"default","tag":"Traders","count":27},{"language":"default","tag":"Trading Interface","count":20}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":"@media (max-width: 1023px){#navbar>div.absolute{background-color:rgb(var(--background-light))!important;-webkit-backdrop-filter:blur(8px)!important;backdrop-filter:blur(8px)!important;transition:none!important}.dark #navbar>div.absolute,html.dark #navbar>div.absolute{background-color:rgb(var(--background-dark))!important}}"}],"page":{"pagePath":"developer/api-reference/endpoint/referral-bind-code","slug":"/developer/api-reference/endpoint/referral-bind-code","pageMetadata":{"title":"Bind Code","openapi":"post /api/referrals/bind","description":"Attaches a referrer to a wallet from an EIP-712 signature.","href":"/developer/api-reference/endpoint/referral-bind-code"},"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: \"Attaches a referrer to a wallet from an EIP-712 signature.\"\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,Heading}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);return _jsxs(_Fragment,{children:[_jsx(Heading,{level:`3`,id:`endpoint`,children:`Endpoint`}),`\n`,_jsx(_components.p,{children:_jsx(_components.code,{children:`POST /api/referrals/bind`})}),`\n`,_jsx(_components.p,{children:`Attaches a referrer to a wallet from an EIP-712 signature.`}),`\n`,_jsxs(_components.p,{children:[`Only accepted while the wallet has never traded on a covered chain. Afterwards it returns `,_jsx(_components.code,{children:`409 AlreadyTraded`}),`, permanently. Bind at onboarding, before the wallet reaches the exchange. See `,_jsx(_components.a,{href:`/developer/integrators/referrals`,children:`Referrals`}),`.`]}),`\n`,_jsx(Heading,{level:`3`,id:`usage-example`,children:`Usage Example`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,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:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://backend-global.gains.trade/api/referrals/bind\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{\"message\":{...},\"signature\":\"0x...\"}'`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`response-structure`,children:`Response Structure`}),`\n`,_jsxs(_components.p,{children:[`The generated API panel lists the response schema for status codes: 201, 400, 401, 403, 409, 429, 503. Error responses return an `,_jsx(_components.code,{children:`error`}),` field.`]})]})}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":"Bind Code","openapi":"post /api/referrals/bind","description":"Attaches a referrer to a wallet from an EIP-712 signature.","href":"/developer/api-reference/endpoint/referral-bind-code"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Endpoint","slug":"endpoint","depth":3,"children":[]},{"title":"Usage Example","slug":"usage-example","depth":3,"children":[]},{"title":"Response Structure","slug":"response-structure","depth":3,"children":[]}],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"operationId":"post_referral-bind-code","summary":"Bind Code","description":"Attaches a referrer to a wallet from an EIP-712 signature.","tags":["Referrals"],"requestBody":"f37ca6f6-a502-41c7-82f8-1c7efec229ed","responses":{"201":"eb116ac2-4fad-4479-9af5-d7f32224d390","400":"20c354d3-5a51-4d67-9854-e5682378c3fc","401":"a81a0e13-852d-4429-8e6e-b7bfd3360ead","403":"24d32ad9-0dd4-4c22-9b1e-2566d4cd8d0f","409":"41edfe04-40d7-45ce-865f-ce17c20878b0","429":"0a68431f-d2bf-4fc5-874e-7ee4510451b6","503":"ffa39c5c-5c14-4374-98be-a47d991ea390"},"method":"post","type":"path","servers":["c21db40e-6f10-4ddb-8ef7-9db86f7b0bf8","3ba47293-e612-4958-82e4-5eb42449e01b","3543823f-fc76-4cb4-844f-573d8317d1fd","c5bc9446-5e2f-4f31-9958-61cede12ca0a","57ed1f08-ea5b-4a4c-bf55-14b29e0c973b","64a1237b-738a-4731-a081-4ad6ebf180df"],"security":[],"path":"/api/referrals/bind","baseUrlOptions":["https://backend-global.gains.trade","https://backend-arbitrum.gains.trade","https://backend-base.gains.trade","https://backend-polygon.gains.trade","https://backend-sepolia.gains.trade","http://localhost:3002"],"title":"Bind Code","codeSamples":[],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["message","signature"],"properties":{"message":{"type":"object","description":"The signed struct plus a `kind` discriminator. `kind` is transport metadata and is not part of the EIP-712 struct.","required":["kind","code","nonce","validUntil"],"properties":{"kind":{"type":"string","enum":["register_code","bind_code"],"isRequired":true,"uniqueKey":"message.kind","typeLabel":"enum\u003cstring>"},"code":{"type":"string","description":"Must match ^[a-z0-9_]{1,31}$. Normalize before signing; the server rejects rather than normalizing.","isRequired":true,"uniqueKey":"message.code","typeLabel":"string"},"nonce":{"type":"integer","format":"int64","description":"Strictly increasing per signer, shared across both kinds. Date.now() in milliseconds works.","isRequired":true,"uniqueKey":"message.nonce","typeLabel":"integer\u003cint64>"},"validUntil":{"type":"integer","format":"int64","description":"Unix seconds. Must be in the future and at most 900 seconds ahead.","isRequired":true,"uniqueKey":"message.validUntil","typeLabel":"integer\u003cint64>"},"owner":{"type":"string","description":"Subject for register_code. Must be the signer.","uniqueKey":"message.owner","typeLabel":"string"},"referee":{"type":"string","description":"Subject for bind_code. Must be the signer.","uniqueKey":"message.referee","typeLabel":"string"}},"isRequired":true,"uniqueKey":"message","typeLabel":"object"},"signature":{"type":"string","description":"65-byte ECDSA signature, 0x-prefixed hex. EIP-1271 is not supported.","isRequired":true,"uniqueKey":"signature","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"message":{"code":"\u003cstring>","nonce":123,"validUntil":123,"owner":"\u003cstring>","referee":"\u003cstring>"},"signature":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"},"responses":{"eb116ac2-4fad-4479-9af5-d7f32224d390":{"description":"Applied","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"signer":{"type":"string","uniqueKey":"result.signer","typeLabel":"string"}},"uniqueKey":"result","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"result":{"signer":"\u003cstring>"}}}},"exampleType":"generated"}},"exampleType":"generated"},"20c354d3-5a51-4d67-9854-e5682378c3fc":{"description":"Malformed message, or signature expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","uniqueKey":"error","typeLabel":"string"},"message":{"type":"string","uniqueKey":"message","typeLabel":"string"},"success":{"type":"boolean","uniqueKey":"success","typeLabel":"boolean"}},"additionalProperties":true,"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":"\u003cstring>","message":"\u003cstring>","success":true}}},"exampleType":"generated"}},"exampleType":"generated"},"a81a0e13-852d-4429-8e6e-b7bfd3360ead":{"description":"Recovered signer is not authorized for the subject","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","uniqueKey":"error","typeLabel":"string"},"message":{"type":"string","uniqueKey":"message","typeLabel":"string"},"success":{"type":"boolean","uniqueKey":"success","typeLabel":"boolean"}},"additionalProperties":true,"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":"\u003cstring>","message":"\u003cstring>","success":true}}},"exampleType":"generated"}},"exampleType":"generated"},"24d32ad9-0dd4-4c22-9b1e-2566d4cd8d0f":{"description":"Origin not allowed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","uniqueKey":"error","typeLabel":"string"},"message":{"type":"string","uniqueKey":"message","typeLabel":"string"},"success":{"type":"boolean","uniqueKey":"success","typeLabel":"boolean"}},"additionalProperties":true,"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":"\u003cstring>","message":"\u003cstring>","success":true}}},"exampleType":"generated"}},"exampleType":"generated"},"41edfe04-40d7-45ce-865f-ce17c20878b0":{"description":"AlreadyTraded, AlreadyBound, CodeUnknown, SelfReferral, Cycle or BadNonce","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","uniqueKey":"error","typeLabel":"string"},"message":{"type":"string","uniqueKey":"message","typeLabel":"string"},"success":{"type":"boolean","uniqueKey":"success","typeLabel":"boolean"}},"additionalProperties":true,"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":"\u003cstring>","message":"\u003cstring>","success":true}}},"exampleType":"generated"}},"exampleType":"generated"},"0a68431f-d2bf-4fc5-874e-7ee4510451b6":{"description":"Rate limited","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","uniqueKey":"error","typeLabel":"string"},"message":{"type":"string","uniqueKey":"message","typeLabel":"string"},"success":{"type":"boolean","uniqueKey":"success","typeLabel":"boolean"}},"additionalProperties":true,"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":"\u003cstring>","message":"\u003cstring>","success":true}}},"exampleType":"generated"}},"exampleType":"generated"},"ffa39c5c-5c14-4374-98be-a47d991ea390":{"description":"Signed referral writes are disabled, or trade history unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","uniqueKey":"error","typeLabel":"string"},"message":{"type":"string","uniqueKey":"message","typeLabel":"string"},"success":{"type":"boolean","uniqueKey":"success","typeLabel":"boolean"}},"additionalProperties":true,"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":"\u003cstring>","message":"\u003cstring>","success":true}}},"exampleType":"generated"}},"exampleType":"generated"}},"security":{},"servers":{"c21db40e-6f10-4ddb-8ef7-9db86f7b0bf8":{"url":"https://backend-global.gains.trade","description":"Backend Global API"},"3ba47293-e612-4958-82e4-5eb42449e01b":{"url":"https://backend-arbitrum.gains.trade","description":"Arbitrum trading backend"},"3543823f-fc76-4cb4-844f-573d8317d1fd":{"url":"https://backend-base.gains.trade","description":"Base trading backend"},"c5bc9446-5e2f-4f31-9958-61cede12ca0a":{"url":"https://backend-polygon.gains.trade","description":"Polygon trading backend"},"57ed1f08-ea5b-4a4c-bf55-14b29e0c973b":{"url":"https://backend-sepolia.gains.trade","description":"Arbitrum Sepolia trading backend"},"64a1237b-738a-4731-a081-4ad6ebf180df":{"url":"http://localhost:3002","description":"Local backend-global development server"}}},"originalFileLocation":"developer/api-reference/openapi.yaml"},"subdomain":"gains","siteName":"Gains Network","title":"Bind Code - Gains Network","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-08-06T15:37:37.587Z","originalFileLocation":"developer/api-reference/endpoint/referral-bind-code.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=\"Attaches a referrer to a wallet from an EIP-712 signature.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Gains Network\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/gains/jCqANtqofKPj1YVA/_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/gains/jCqANtqofKPj1YVA/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/gains/jCqANtqofKPj1YVA/_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/gains/jCqANtqofKPj1YVA/_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/gains/jCqANtqofKPj1YVA/_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/gains/jCqANtqofKPj1YVA/_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/gains/jCqANtqofKPj1YVA/_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/gains/jCqANtqofKPj1YVA/_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/gains/jCqANtqofKPj1YVA/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Bind Code - Gains Network\">\u003cmeta data-mint-head property=\"og:description\" content=\"Attaches a referrer to a wallet from an EIP-712 signature.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Gains Network\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.gains.trade/developer/api-reference/endpoint/referral-bind-code\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://gains.mintlify.app/images/og-image.png\">\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=\"Bind Code - Gains Network\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Attaches a referrer to a wallet from an EIP-712 signature.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://gains.mintlify.app/images/og-image.png\">\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/gains/jCqANtqofKPj1YVA/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Gains Network\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#16A34A\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.gains.trade/developer/api-reference/endpoint/referral-bind-code\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/developer/api-reference/endpoint/referral-bind-code.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.gains.trade/#organization\",\"name\":\"Gains Network\",\"url\":\"https://docs.gains.trade\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/gains/FCyVOdVfN-_VqQ5X/logo/gains.png?fit=max\u0026auto=format\u0026n=FCyVOdVfN-_VqQ5X\u0026q=85\u0026s=576fad34f2d6042b81905e874db68f39\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.gains.trade#website\",\"name\":\"Gains Network\",\"url\":\"https://docs.gains.trade\",\"publisher\":{\"@id\":\"https://docs.gains.trade/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.gains.trade/developer/api-reference/endpoint/referral-bind-code#webpage\",\"url\":\"https://docs.gains.trade/developer/api-reference/endpoint/referral-bind-code\",\"name\":\"Bind Code\",\"description\":\"Attaches a referrer to a wallet from an EIP-712 signature.\",\"dateModified\":\"2026-08-06T15:37:37.587Z\",\"isPartOf\":{\"@id\":\"https://docs.gains.trade#website\"},\"breadcrumb\":{\"@id\":\"https://docs.gains.trade/developer/api-reference/endpoint/referral-bind-code#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.gains.trade/developer/api-reference/endpoint/referral-bind-code#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"API Reference\",\"item\":\"https://docs.gains.trade/developer/api-reference/introduction\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Referrals\",\"item\":\"https://docs.gains.trade/developer/api-reference/endpoint/referral-config\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Bind Code\",\"item\":\"https://docs.gains.trade/developer/api-reference/endpoint/referral-bind-code\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.gains.trade/developer/api-reference/endpoint/referral-bind-code#apireference\",\"headline\":\"Bind Code\",\"name\":\"Bind Code\",\"description\":\"Attaches a referrer to a wallet from an EIP-712 signature.\",\"url\":\"https://docs.gains.trade/developer/api-reference/endpoint/referral-bind-code\",\"mainEntityOfPage\":{\"@id\":\"https://docs.gains.trade/developer/api-reference/endpoint/referral-bind-code#webpage\"},\"image\":\"https://docs.gains.trade/images/og-image.png\",\"dateModified\":\"2026-08-06T15:37:37.587Z\",\"publisher\":{\"@id\":\"https://docs.gains.trade/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.gains.trade#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Gains Network\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Gains Network","nav":{"global":null,"tabs":[{"tab":"Traders","pages":[{"title":"Traders","href":""}]},{"tab":"Developers","groups":[{"group":"Trading API","icon":"bolt","tag":"Beta","pages":[{"title":"Trading API","href":"/developer/trading-api/overview"},{"title":"Quickstart","href":"/developer/trading-api/quickstart"},{"title":"Authentication","href":"/developer/trading-api/authentication"},{"title":"Orders and positions","href":"/developer/trading-api/orders"},{"title":"Market data","href":"/developer/trading-api/market-data"},{"title":"WebSocket","href":"/developer/trading-api/websocket"},{"title":"Errors and limits","href":"/developer/trading-api/errors"},{"title":"SDKs","href":"/developer/trading-api/sdks"},{"title":"Hyperliquid compatibility","href":"/developer/trading-api/hyperliquid-compatibility"},{"group":"Reference","pages":[{"group":"System","pages":[{"title":"Liveness","deprecated":null,"version":null,"openapi":"/developer/trading-api/openapi.json get /health","href":"/api-reference/system/liveness"},{"title":"Readiness per chain","deprecated":null,"version":null,"openapi":"/developer/trading-api/openapi.json get /ready","href":"/api-reference/system/readiness-per-chain"},{"title":"Chain identity and signing domain","deprecated":null,"version":null,"openapi":"/developer/trading-api/openapi.json get /v1/{chain}","href":"/api-reference/system/chain-identity-and-signing-domain"}]},{"group":"Markets","pages":[{"title":"List markets","deprecated":null,"version":null,"openapi":"/developer/trading-api/openapi.json get /v1/{chain}/markets","href":"/api-reference/markets/list-markets"},{"title":"Get one market","deprecated":null,"version":null,"openapi":"/developer/trading-api/openapi.json get /v1/{chain}/markets/{symbol}","href":"/api-reference/markets/get-one-market"},{"title":"Virtual order book","deprecated":null,"version":null,"openapi":"/developer/trading-api/openapi.json get /v1/{chain}/markets/{symbol}/book","href":"/api-reference/markets/virtual-order-book"},{"title":"Historical candles","deprecated":null,"version":null,"openapi":"/developer/trading-api/openapi.json get /v1/{chain}/markets/{symbol}/candles","href":"/api-reference/markets/historical-candles"},{"title":"Recent executed trades","deprecated":null,"version":null,"openapi":"/developer/trading-api/openapi.json get /v1/{chain}/markets/{symbol}/trades","href":"/api-reference/markets/recent-executed-trades"},{"title":"Current funding and borrowing rates","deprecated":null,"version":null,"openapi":"/developer/trading-api/openapi.json get /v1/{chain}/markets/{symbol}/funding","href":"/api-reference/markets/current-funding-and-borrowing-rates"},{"title":"Mark and index price of every market","deprecated":null,"version":null,"openapi":"/developer/trading-api/openapi.json get /v1/{chain}/prices","href":"/api-reference/markets/mark-and-index-price-of-every-market"}]},{"group":"Account","pages":[{"title":"Balances, fee tier and agents","deprecated":null,"version":null,"openapi":"/developer/trading-api/openapi.json get /v1/{chain}/account/{address}","href":"/api-reference/account/balances-fee-tier-and-agents"},{"title":"Open positions","deprecated":null,"version":null,"openapi":"/developer/trading-api/openapi.json get /v1/{chain}/account/{address}/positions","href":"/api-reference/account/open-positions"},{"title":"Open orders","deprecated":null,"version":null,"openapi":"/developer/trading-api/openapi.json get /v1/{chain}/account/{address}/orders","href":"/api-reference/account/open-orders"},{"title":"Orders placed through the API, newest first","deprecated":null,"version":null,"openapi":"/developer/trading-api/openapi.json get /v1/{chain}/account/{address}/orders/history","href":"/api-reference/account/orders-placed-through-the-api-newest-first"},{"title":"Fill history","deprecated":null,"version":null,"openapi":"/developer/trading-api/openapi.json get /v1/{chain}/account/{address}/fills","href":"/api-reference/account/fill-history"}]},{"group":"Orders","pages":[{"title":"Order lifecycle status","deprecated":null,"version":null,"openapi":"/developer/trading-api/openapi.json get /v1/{chain}/orders/{id}","href":"/api-reference/orders/order-lifecycle-status"},{"title":"Cancel a resting order, or reclaim a timed-out market request","deprecated":null,"version":null,"openapi":"/developer/trading-api/openapi.json delete /v1/{chain}/orders/{id}","href":"/api-reference/orders/cancel-a-resting-order-or-reclaim-a-timed-out-market-request"},{"title":"Update a resting limit or stop order","deprecated":null,"version":null,"openapi":"/developer/trading-api/openapi.json patch /v1/{chain}/orders/{id}","href":"/api-reference/orders/update-a-resting-limit-or-stop-order"},{"title":"Place an order","deprecated":null,"version":null,"openapi":"/developer/trading-api/openapi.json post /v1/{chain}/orders","href":"/api-reference/orders/place-an-order"},{"title":"Report the broadcast transaction of a prepared order","deprecated":null,"version":null,"openapi":"/developer/trading-api/openapi.json post /v1/{chain}/orders/{id}/submit","href":"/api-reference/orders/report-the-broadcast-transaction-of-a-prepared-order"}]},{"group":"Positions","pages":[{"title":"Close a position at market","deprecated":null,"version":null,"openapi":"/developer/trading-api/openapi.json post /v1/{chain}/positions/{id}/close","href":"/api-reference/positions/close-a-position-at-market"},{"title":"Update stop loss, take profit, leverage or collateral","deprecated":null,"version":null,"openapi":"/developer/trading-api/openapi.json patch /v1/{chain}/positions/{id}","href":"/api-reference/positions/update-stop-loss-take-profit-leverage-or-collateral"}]},{"group":"Agents","pages":[{"title":"Authorise an agent","deprecated":null,"version":null,"openapi":"/developer/trading-api/openapi.json post /v1/{chain}/agents","href":"/api-reference/agents/authorise-an-agent"},{"title":"Agent status and delegation transaction","deprecated":null,"version":null,"openapi":"/developer/trading-api/openapi.json get /v1/{chain}/agents/{address}","href":"/api-reference/agents/agent-status-and-delegation-transaction"},{"title":"Revoke an agent","deprecated":null,"version":null,"openapi":"/developer/trading-api/openapi.json delete /v1/{chain}/agents/{address}","href":"/api-reference/agents/revoke-an-agent"},{"title":"Issue a read-only API key","deprecated":null,"version":null,"openapi":"/developer/trading-api/openapi.json post /v1/{chain}/api-keys","href":"/api-reference/agents/issue-a-read-only-api-key"}]},{"group":"Hyperliquid compatibility","pages":[{"title":"Hyperliquid-shaped /info","deprecated":null,"version":null,"openapi":"/developer/trading-api/openapi.json post /hl/{chain}/info","href":"/api-reference/hyperliquid-compatibility/hyperliquid-shaped-info"},{"title":"Hyperliquid-shaped /exchange","deprecated":null,"version":null,"openapi":"/developer/trading-api/openapi.json post /hl/{chain}/exchange","href":"/api-reference/hyperliquid-compatibility/hyperliquid-shaped-exchange"}]}]}]},{"group":"API Reference","icon":"server","pages":[{"title":"Backend API Reference","href":"/developer/api-reference/introduction"},{"group":"Global","pages":[{"title":"Health Check","openapi":"get /health","href":"/developer/api-reference/endpoint/health"},{"title":"Get Chain Stats","openapi":"get /api/stats","href":"/developer/api-reference/endpoint/stats"},{"title":"Get APR Info","openapi":"get /api/apr","href":"/developer/api-reference/endpoint/apr"},{"title":"Get GNS Total Supply","openapi":"get /api/total-supply","href":"/developer/api-reference/endpoint/total-supply"}]},{"group":"Trading Data","pages":[{"title":"Get Trading History Window","openapi":"get /api/trading-history/{window}","href":"/developer/api-reference/endpoint/trading-history"},{"title":"Get Trading History Stats","openapi":"get /api/trading-history/{window}/stats","href":"/developer/api-reference/endpoint/trading-history-stats"},{"title":"Get Wallet Trading Stats","openapi":"get /api/personal-trading-history/{address}/stats","href":"/developer/api-reference/endpoint/personal-trading-stats"},{"title":"Get Batch Wallet Trading Stats","openapi":"post /api/personal-trading-history/stats","href":"/developer/api-reference/endpoint/batch-personal-trading-stats"},{"title":"Get Wallet Trading History","openapi":"get /api/personal-trading-history/{address}","href":"/developer/api-reference/endpoint/personal-trading-history"},{"title":"Get Batch Wallet Trading History","openapi":"post /api/personal-trading-history/batch","href":"/developer/api-reference/endpoint/batch-personal-trading-history"},{"title":"Get Trader Leaderboard","openapi":"get /api/leaderboard/{period}","href":"/developer/api-reference/endpoint/leaderboard"},{"title":"Get Holding Rates","openapi":"get /api/holding-rates/{collateralIndex}/{pairIndex}","href":"/developer/api-reference/endpoint/holding-rates"}]},{"group":"Contests","pages":[{"title":"List Contests","openapi":"get /api/contests","href":"/developer/api-reference/endpoint/contests"},{"title":"Get Contest Details","openapi":"get /api/contests/{id}","href":"/developer/api-reference/endpoint/contest-details"},{"title":"Get Contest Leaderboard","openapi":"get /api/contests/{id}/leaderboard","href":"/developer/api-reference/endpoint/contest-leaderboard"},{"title":"Get Contest Trader Stats","openapi":"get /api/contests/{id}/leaderboard/{trader}","href":"/developer/api-reference/endpoint/contest-trader-stats"}]},{"group":"Dapp","pages":[{"title":"Get Latest Dapp Version","openapi":"get /api/dapp/latest","href":"/developer/api-reference/endpoint/latest-dapp"},{"title":"Get Latest Dapp Version By Mode","openapi":"get /api/dapp/latest/{mode}","href":"/developer/api-reference/endpoint/latest-dapp-by-mode"},{"title":"Get Wallet Associations","openapi":"get /api/dapp/wallet/associated/{address}","href":"/developer/api-reference/endpoint/wallet-associations"},{"title":"Associate Wallet","openapi":"post /api/dapp/wallet/associate","href":"/developer/api-reference/endpoint/associate-wallet"},{"title":"Get Circle Messages","openapi":"get /api/dapp/circle/messages/{domainId}/{txHash}","href":"/developer/api-reference/endpoint/circle-messages"},{"title":"Get Solana Token Balance","openapi":"get /api/dapp/solana/usdc-balance/{address}","href":"/developer/api-reference/endpoint/solana-usdc-balance"},{"title":"Create Transak Widget URL","openapi":"post /api/dapp/transak/widget-url","href":"/developer/api-reference/endpoint/transak-widget-url"}]},{"group":"Bridge","pages":[{"title":"Create Bridge Flow","openapi":"post /api/dapp/bridge/flows","href":"/developer/api-reference/endpoint/create-bridge-flow"},{"title":"Get Bridge Flows By Address","openapi":"get /api/dapp/bridge/flows/{address}","href":"/developer/api-reference/endpoint/bridge-flows-by-address"},{"title":"Get Pending Bridge Flows","openapi":"get /api/dapp/bridge/flows/pending/{address}","href":"/developer/api-reference/endpoint/pending-bridge-flows"},{"title":"Get Bridge Flow By Hash","openapi":"get /api/dapp/bridge/flows/hash/{srcHash}","href":"/developer/api-reference/endpoint/bridge-flow-by-hash"},{"title":"Update Bridge Flow","openapi":"put /api/dapp/bridge/flows/{srcHash}","href":"/developer/api-reference/endpoint/update-bridge-flow"},{"title":"Finalize Bridge Flow","openapi":"patch /api/dapp/bridge/flows/finalize","href":"/developer/api-reference/endpoint/finalize-bridge-flow"},{"title":"Delete Bridge Flow","openapi":"delete /api/dapp/bridge/flows/{srcHash}","href":"/developer/api-reference/endpoint/delete-bridge-flow"}]},{"group":"Campaigns","pages":[{"title":"Check Campaign Eligibility","openapi":"get /api/campaigns/eligibility/{address}","href":"/developer/api-reference/endpoint/campaign-eligibility"},{"title":"Check Campaign Eligibility By ID","openapi":"get /api/campaigns/{campaignId}/eligibility/{address}","href":"/developer/api-reference/endpoint/campaign-eligibility-by-id"},{"title":"Check Solana Campaign Eligibility","openapi":"get /api/campaigns/eligibility/solana/{address}","href":"/developer/api-reference/endpoint/solana-campaign-eligibility"},{"title":"Check Solana Campaign Eligibility By ID","openapi":"get /api/campaigns/{campaignId}/eligibility/solana/{address}","href":"/developer/api-reference/endpoint/solana-campaign-eligibility-by-id"}]},{"group":"User Messaging","pages":[{"title":"Get VIP Status","openapi":"get /api/vip/{address}","href":"/developer/api-reference/endpoint/vip-status"},{"title":"Acknowledge VIP Status","openapi":"post /api/vip/{address}/ack","href":"/developer/api-reference/endpoint/ack-vip-status"},{"title":"Get Notifications","openapi":"get /api/notifications/{address}","href":"/developer/api-reference/endpoint/notifications"},{"title":"Dismiss Notification","openapi":"post /api/notifications/{address}/dismiss","href":"/developer/api-reference/endpoint/dismiss-notification"}]},{"group":"Referrals","pages":[{"title":"Referral Config","openapi":"get /api/referrals/config","href":"/developer/api-reference/endpoint/referral-config"},{"title":"Register Code","openapi":"post /api/referrals/code","description":"Registers a referral code from an EIP-712 signature.","href":"/developer/api-reference/endpoint/referral-register-code"},{"title":"Bind Code","openapi":"post /api/referrals/bind","href":"/developer/api-reference/endpoint/referral-bind-code"},{"title":"Resolve Binding","openapi":"get /api/referrals/binding/{address}","description":"The referrer this address is bound to.","href":"/developer/api-reference/endpoint/referral-binding"},{"title":"Resolve Code Owner","openapi":"get /api/referrals/code/{code}/address","href":"/developer/api-reference/endpoint/referral-code-owner"},{"title":"Resolve Address Code","openapi":"get /api/referrals/address/{address}/code","href":"/developer/api-reference/endpoint/referral-owner-code"},{"title":"Referral Summary","openapi":"get /api/referrals/summary/{address}","href":"/developer/api-reference/endpoint/referral-summary"},{"title":"Referral Rewards","openapi":"get /api/referrals/rewards/{address}","href":"/developer/api-reference/endpoint/referral-rewards"},{"title":"Referred Wallets","openapi":"get /api/referrals/referred/{address}","href":"/developer/api-reference/endpoint/referral-referred"},{"title":"Referred Wallet Detail","openapi":"get /api/referrals/referred/{address}/detail","href":"/developer/api-reference/endpoint/referral-referred-detail"},{"title":"Referral History","openapi":"get /api/referrals/history/{address}","href":"/developer/api-reference/endpoint/referral-history"},{"title":"Claim Proof","openapi":"get /api/referrals/proof/{address}","href":"/developer/api-reference/endpoint/referral-proof"},{"title":"Resolve Referral Link","openapi":"get /api/referrals/links/{link}/address","href":"/developer/api-reference/endpoint/referral-link-address"},{"title":"Resolve Referral Address","openapi":"get /api/referrals/addresses/{address}/link","href":"/developer/api-reference/endpoint/referral-address-link"}]},{"group":"Trading Backend","pages":[{"title":"Get Trading Variables","openapi":"get /trading-variables","href":"/developer/api-reference/endpoint/core-trading-variables"},{"title":"Get All Trading Variables","openapi":"get /trading-variables/all","href":"/developer/api-reference/endpoint/core-trading-variables-all"},{"title":"Get Trading Variables By Keys","openapi":"get /trading-variables/{keys}","href":"/developer/api-reference/endpoint/core-trading-variables-by-keys"},{"title":"Get Trading Variable Keys","openapi":"get /trading-variables-keys","href":"/developer/api-reference/endpoint/core-trading-variable-keys"},{"title":"Get Open Trades","openapi":"get /open-trades","href":"/developer/api-reference/endpoint/core-open-trades"},{"title":"Get Open Trades By Address","openapi":"get /open-trades/{address}","href":"/developer/api-reference/endpoint/core-open-trades-by-address"},{"title":"Get Open Trades Info","openapi":"get /open-trades-info","href":"/developer/api-reference/endpoint/core-open-trades-info"},{"title":"Get Pending Events","openapi":"get /pending-events","href":"/developer/api-reference/endpoint/core-pending-events"},{"title":"Get User Trading Variables","openapi":"get /user-trading-variables/{address}","href":"/developer/api-reference/endpoint/core-user-trading-variables"}]},{"group":"Legacy Contests","pages":[{"title":"Get Legacy Contest Leaderboard","openapi":"get /contest/leaderboard","href":"/developer/api-reference/endpoint/legacy-contest-leaderboard"},{"title":"Get Legacy Contest PnL","openapi":"get /contest/pnl","href":"/developer/api-reference/endpoint/legacy-contest-pnl"},{"title":"Get Legacy Contest PnL Percent","openapi":"get /contest/pnl-percent","href":"/developer/api-reference/endpoint/legacy-contest-pnl-percent"},{"title":"Get Legacy Final Open PnL","openapi":"get /contest/final-open-pnl","href":"/developer/api-reference/endpoint/legacy-contest-final-open-pnl"},{"title":"Get Legacy Contest","openapi":"get /contest","href":"/developer/api-reference/endpoint/legacy-contest"},{"title":"Get Legacy Contest Rewards","openapi":"get /contest/rewards","href":"/developer/api-reference/endpoint/legacy-contest-rewards"},{"title":"Get Legacy Contest Results","openapi":"get /contest/results","href":"/developer/api-reference/endpoint/legacy-contest-results"},{"title":"Update Legacy Contest Cache","openapi":"put /contest/cache-update","href":"/developer/api-reference/endpoint/legacy-contest-cache-update"}]},{"group":"Rewards","pages":[{"title":"Get Rewards Root","openapi":"get /rewards/root/{configId}/{epoch}","href":"/developer/api-reference/endpoint/rewards-root"},{"title":"Get All Rewards Roots","openapi":"get /rewards/root/all/{configId}/{epoch}","href":"/developer/api-reference/endpoint/rewards-root-all"},{"title":"Get Rewards By Address","openapi":"get /rewards/{configId}/{epoch}/{address}","href":"/developer/api-reference/endpoint/rewards-by-address"},{"title":"Get All Rewards By Address","openapi":"get /rewards/all/{configId}/{epoch}/{address}","href":"/developer/api-reference/endpoint/rewards-all-by-address"}]}]},{"group":"Integrators","icon":"plug","pages":[{"title":"Integrators","href":"/developer/integrators"},{"title":"Trading Contracts","href":"/developer/integrators/trading-contracts"},{"title":"Delegated Trading","href":"/developer/integrators/delegated-trading"},{"title":"Backend","href":"/developer/integrators/backend"},{"title":"Contests","href":"/developer/integrators/contests"},{"title":"Live prices and OHLC snapshots","href":"/developer/integrators/price-feed"},{"title":"Referrals","href":"/developer/integrators/referrals"},{"group":"Guides","pages":[{"title":"Guides","href":"/developer/integrators/guides"},{"title":"Listing all assets","href":"/developer/integrators/guides/listed-assets"},{"title":"Mark + Index Introduction","href":"/developer/integrators/guides/mark-+-index-introduction"},{"title":"Building the virtual order book","href":"/developer/integrators/guides/building-the-virtual-order-book"},{"title":"Support Endpoints Migration","href":"/developer/integrators/guides/support-endpoints-migration"},{"title":"v10.2 migration","href":"/developer/integrators/guides/v10.2-migration"},{"title":"v10 migration","href":"/developer/integrators/guides/v10-migration"},{"title":"Calculating borrowing fees","href":"/developer/integrators/guides/calculating-borrowing-fees"},{"title":"Calculating liquidation price","href":"/developer/integrators/guides/calculating-liquidation-price"},{"title":"Backend Endpoint Refactor","href":"/developer/integrators/guides/backend-endpoint-refactor"},{"title":"History Endpoints Migration","href":"/developer/integrators/guides/history-endpoints-migration"}]}]},{"group":"Technical Reference","icon":"code","pages":[{"group":"Contracts","pages":[{"group":"Changelogs","pages":[{"title":"v10.2 Update","href":"/developer/technical-reference/contracts/changelogs/v10.2-update"},{"title":"v10.1 Update","href":"/developer/technical-reference/contracts/changelogs/v10.1-update"},{"title":"v10 Update","href":"/developer/technical-reference/contracts/changelogs/v10-update"},{"title":"v9.2.1 Update","href":"/developer/technical-reference/contracts/changelogs/v9.2.1-update"},{"title":"v9.1 Update","href":"/developer/technical-reference/contracts/changelogs/v9.1-update"},{"title":"v9.1.1 Update","href":"/developer/technical-reference/contracts/changelogs/v9.1.1-update"},{"title":"v9 Update","href":"/developer/technical-reference/contracts/changelogs/v9-update"}]},{"group":"Core","pages":[{"group":"Abstract","pages":[{"title":"GNSAddressStore","href":"/developer/technical-reference/contracts/core/abstract/gnsaddressstore"},{"title":"GNSDiamondCut","href":"/developer/technical-reference/contracts/core/abstract/gnsdiamondcut"},{"title":"GNSDiamondLoupe","href":"/developer/technical-reference/contracts/core/abstract/gnsdiamondloupe"},{"title":"GNSDiamondStorage","href":"/developer/technical-reference/contracts/core/abstract/gnsdiamondstorage"}]},{"group":"Facets","pages":[{"title":"GNSBorrowingFees","href":"/developer/technical-reference/contracts/core/facets/gnsborrowingfees"},{"title":"GNSOtc","href":"/developer/technical-reference/contracts/core/facets/gnsotc"},{"title":"GNSPriceAggregator","href":"/developer/technical-reference/contracts/core/facets/gnspriceaggregator"},{"title":"GNSTradingInteractions","href":"/developer/technical-reference/contracts/core/facets/gnstradinginteractions"},{"title":"GNSTriggerRewards","href":"/developer/technical-reference/contracts/core/facets/gnstriggerrewards"},{"title":"GNSFeeTiers","href":"/developer/technical-reference/contracts/core/facets/gnsfeetiers"},{"title":"GNSPairsStorage","href":"/developer/technical-reference/contracts/core/facets/gnspairsstorage"},{"title":"GNSPriceImpact","href":"/developer/technical-reference/contracts/core/facets/gnspriceimpact"},{"title":"GNSReferrals","href":"/developer/technical-reference/contracts/core/facets/gnsreferrals"},{"title":"GNSTradingCallbacks","href":"/developer/technical-reference/contracts/core/facets/gnstradingcallbacks"},{"title":"GNSTradingStorage","href":"/developer/technical-reference/contracts/core/facets/gnstradingstorage"}]},{"title":"GNSMultiCollatDiamond","href":"/developer/technical-reference/contracts/core/gnsmulticollatdiamond"},{"title":"GNSStaking","href":"/developer/technical-reference/contracts/core/gnsstaking"},{"title":"GToken","href":"/developer/technical-reference/contracts/core/gtoken"},{"title":"GTokenOpenPnlFeed","href":"/developer/technical-reference/contracts/core/gtokenopenpnlfeed"}]},{"group":"Interfaces","pages":[{"group":"Libraries","pages":[{"title":"IBorrowingFeesUtils","href":"/developer/technical-reference/contracts/interfaces/libraries/iborrowingfeesutils"},{"title":"IOtcUtils","href":"/developer/technical-reference/contracts/interfaces/libraries/iotcutils"},{"title":"IPriceAggregatorUtils","href":"/developer/technical-reference/contracts/interfaces/libraries/ipriceaggregatorutils"},{"title":"ITriggerRewardsUtils","href":"/developer/technical-reference/contracts/interfaces/libraries/itriggerrewardsutils"},{"title":"IFeeTiersUtils","href":"/developer/technical-reference/contracts/interfaces/libraries/ifeetiersutils"},{"title":"IPairsStorageUtils","href":"/developer/technical-reference/contracts/interfaces/libraries/ipairsstorageutils"},{"title":"IPriceImpactUtils","href":"/developer/technical-reference/contracts/interfaces/libraries/ipriceimpactutils"},{"title":"IReferralsUtils","href":"/developer/technical-reference/contracts/interfaces/libraries/ireferralsutils"},{"title":"ITradingCallbacksUtils","href":"/developer/technical-reference/contracts/interfaces/libraries/itradingcallbacksutils"},{"title":"ITradingCommonUtils","href":"/developer/technical-reference/contracts/interfaces/libraries/itradingcommonutils"},{"title":"ITradingInteractionsUtils","href":"/developer/technical-reference/contracts/interfaces/libraries/itradinginteractionsutils"},{"title":"ITradingStorageUtils","href":"/developer/technical-reference/contracts/interfaces/libraries/itradingstorageutils"},{"title":"IUpdateLeverageUtils","href":"/developer/technical-reference/contracts/interfaces/libraries/iupdateleverageutils"},{"title":"IUpdatePositionSizeUtils","href":"/developer/technical-reference/contracts/interfaces/libraries/iupdatepositionsizeutils"}]},{"group":"Types","pages":[{"title":"IAddressStore","href":"/developer/technical-reference/contracts/interfaces/types/iaddressstore"},{"title":"IBorrowingFees","href":"/developer/technical-reference/contracts/interfaces/types/iborrowingfees"},{"title":"IDiamondStorage","href":"/developer/technical-reference/contracts/interfaces/types/idiamondstorage"},{"title":"IOtc","href":"/developer/technical-reference/contracts/interfaces/types/iotc"},{"title":"IPriceAggregator","href":"/developer/technical-reference/contracts/interfaces/types/ipriceaggregator"},{"title":"ITradingStorage","href":"/developer/technical-reference/contracts/interfaces/types/itradingstorage"},{"title":"ITradingInteractions","href":"/developer/technical-reference/contracts/interfaces/types/itradinginteractions"},{"title":"ITriggerRewards","href":"/developer/technical-reference/contracts/interfaces/types/itriggerrewards"},{"title":"ITypes","href":"/developer/technical-reference/contracts/interfaces/types/itypes"},{"title":"IUpdateLeverage","href":"/developer/technical-reference/contracts/interfaces/types/iupdateleverage"},{"title":"IPairsStorage","href":"/developer/technical-reference/contracts/interfaces/types/ipairsstorage"},{"title":"IFeeTiers","href":"/developer/technical-reference/contracts/interfaces/types/ifeetiers"},{"title":"IPriceImpact","href":"/developer/technical-reference/contracts/interfaces/types/ipriceimpact"},{"title":"IReferrals","href":"/developer/technical-reference/contracts/interfaces/types/ireferrals"},{"title":"ITradingCallbacks","href":"/developer/technical-reference/contracts/interfaces/types/itradingcallbacks"},{"title":"IUpdatePositionSize","href":"/developer/technical-reference/contracts/interfaces/types/iupdatepositionsize"}]},{"title":"IChainlinkFeed","href":"/developer/technical-reference/contracts/interfaces/ichainlinkfeed"},{"title":"IArbSys","href":"/developer/technical-reference/contracts/interfaces/iarbsys"},{"title":"IChainlinkOracle","href":"/developer/technical-reference/contracts/interfaces/ichainlinkoracle"},{"title":"IERC20","href":"/developer/technical-reference/contracts/interfaces/ierc20"},{"title":"IERC721","href":"/developer/technical-reference/contracts/interfaces/ierc721"},{"title":"IERC721Design","href":"/developer/technical-reference/contracts/interfaces/ierc721design"},{"title":"IGeneralErrors","href":"/developer/technical-reference/contracts/interfaces/igeneralerrors"},{"title":"IGNSAddressStore","href":"/developer/technical-reference/contracts/interfaces/ignsaddressstore"},{"title":"IGNSDiamond","href":"/developer/technical-reference/contracts/interfaces/ignsdiamond"},{"title":"IGNSDiamondCut","href":"/developer/technical-reference/contracts/interfaces/ignsdiamondcut"},{"title":"IGNSMultiCollatDiamond","href":"/developer/technical-reference/contracts/interfaces/ignsmulticollatdiamond"},{"title":"IGNSDiamondLoupe","href":"/developer/technical-reference/contracts/interfaces/ignsdiamondloupe"},{"title":"IGNSStaking","href":"/developer/technical-reference/contracts/interfaces/ignsstaking"},{"title":"IGToken","href":"/developer/technical-reference/contracts/interfaces/igtoken"},{"title":"IGTokenLockedDepositNft","href":"/developer/technical-reference/contracts/interfaces/igtokenlockeddepositnft"},{"title":"IGTokenOpenPnlFeed","href":"/developer/technical-reference/contracts/interfaces/igtokenopenpnlfeed"},{"title":"IGTokenLockedDepositNftDesign","href":"/developer/technical-reference/contracts/interfaces/igtokenlockeddepositnftdesign"},{"title":"ILiquidityPool","href":"/developer/technical-reference/contracts/interfaces/iliquiditypool"},{"title":"IRateProvider","href":"/developer/technical-reference/contracts/interfaces/irateprovider"},{"title":"IOwnable","href":"/developer/technical-reference/contracts/interfaces/iownable"}]},{"group":"Libraries","pages":[{"group":"updateLeverage","pages":[{"title":"UpdateLeverageLifecycles","href":"/developer/technical-reference/contracts/libraries/updateleverage/updateleveragelifecycles"}]},{"group":"updatePositionSize","pages":[{"title":"IncreasePositionSizeUtils","href":"/developer/technical-reference/contracts/libraries/updatepositionsize/increasepositionsizeutils"},{"title":"DecreasePositionSizeUtils","href":"/developer/technical-reference/contracts/libraries/updatepositionsize/decreasepositionsizeutils"},{"title":"UpdatePositionSizeLifecycles","href":"/developer/technical-reference/contracts/libraries/updatepositionsize/updatepositionsizelifecycles"}]},{"title":"AddressStoreUtils","href":"/developer/technical-reference/contracts/libraries/addressstoreutils"},{"title":"ChainlinkClientUtils","href":"/developer/technical-reference/contracts/libraries/chainlinkclientutils"},{"title":"ChainUtils","href":"/developer/technical-reference/contracts/libraries/chainutils"},{"title":"ConstantsUtils","href":"/developer/technical-reference/contracts/libraries/constantsutils"},{"title":"CollateralUtils","href":"/developer/technical-reference/contracts/libraries/collateralutils"},{"title":"DiamondUtils","href":"/developer/technical-reference/contracts/libraries/diamondutils"},{"title":"LiquidityPoolUtils","href":"/developer/technical-reference/contracts/libraries/liquiditypoolutils"},{"title":"OtcUtils","href":"/developer/technical-reference/contracts/libraries/otcutils"},{"title":"PackingUtils","href":"/developer/technical-reference/contracts/libraries/packingutils"},{"title":"StorageUtils","href":"/developer/technical-reference/contracts/libraries/storageutils"},{"title":"TriggerRewardsUtils","href":"/developer/technical-reference/contracts/libraries/triggerrewardsutils"},{"title":"ArrayGetters","href":"/developer/technical-reference/contracts/libraries/arraygetters"},{"title":"BorrowingFeesUtils","href":"/developer/technical-reference/contracts/libraries/borrowingfeesutils"},{"title":"FeeTiersUtils","href":"/developer/technical-reference/contracts/libraries/feetiersutils"},{"title":"PriceAggregatorUtils","href":"/developer/technical-reference/contracts/libraries/priceaggregatorutils"},{"title":"PriceImpactUtils","href":"/developer/technical-reference/contracts/libraries/priceimpactutils"},{"title":"ReferralsUtils","href":"/developer/technical-reference/contracts/libraries/referralsutils"},{"title":"TradingCallbacksUtils","href":"/developer/technical-reference/contracts/libraries/tradingcallbacksutils"},{"title":"PairsStorageUtils","href":"/developer/technical-reference/contracts/libraries/pairsstorageutils"},{"title":"TradingCommonUtils","href":"/developer/technical-reference/contracts/libraries/tradingcommonutils"},{"title":"TradingStorageUtils","href":"/developer/technical-reference/contracts/libraries/tradingstorageutils"},{"title":"TradingInteractionsUtils","href":"/developer/technical-reference/contracts/libraries/tradinginteractionsutils"}]},{"group":"Misc","pages":[{"title":"EpochBasedTokenClaim","href":"/developer/technical-reference/contracts/misc/epochbasedtokenclaim"},{"title":"GNSCompensationHandler","href":"/developer/technical-reference/contracts/misc/gnscompensationhandler"},{"title":"GTokenRateProvider","href":"/developer/technical-reference/contracts/misc/gtokenrateprovider"},{"title":"GTokenLockedDepositNftDesign","href":"/developer/technical-reference/contracts/misc/gtokenlockeddepositnftdesign"},{"title":"ManagerTimelock","href":"/developer/technical-reference/contracts/misc/managertimelock"},{"title":"OwnerTimelock","href":"/developer/technical-reference/contracts/misc/ownertimelock"},{"title":"VotingDelegator","href":"/developer/technical-reference/contracts/misc/votingdelegator"}]},{"group":"Tokens","pages":[{"title":"GainsNetworkToken","href":"/developer/technical-reference/contracts/tokens/gainsnetworktoken"},{"title":"GTokenLockedDepositNft","href":"/developer/technical-reference/contracts/tokens/gtokenlockeddepositnft"}]}]},{"group":"Backend","pages":[{"title":"Backend Types","href":"/developer/technical-reference/backend/backend-types"}]},{"group":"SDK","pages":[{"title":"SDK","href":"/developer/technical-reference/sdk"},{"title":"Client Types","href":"/developer/technical-reference/sdk/client-types"}]}]}]},{"tab":"$GNS","pages":[{"title":"$GNS","href":"/what-is-gains-network/summary"}]},{"tab":"Changelog","pages":[{"title":"Changelog","href":"/changelog"}]}]},"basePath":"","title":"Bind Code - Gains Network","buildId":"dpl_2gSLkbMoF5kkLsBqYzq9KWtDyJRo","deploymentId":"dpl_2gSLkbMoF5kkLsBqYzq9KWtDyJRo","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-hfTk6MZX.js","utils-Bfp7HcY4.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-D8dSW7yV.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-CFgQXcZO.js","snippetPresets-dMW1-pV3.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","ApiExamples-DyrCOido.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-Bwwdcyh3.js","shallow-drVXTg79.js","getApiPlaygroundDisplay-GMPxUzWV.js","CodeSnippet-wTmV0wP6.js","CodeSnippets-D_QxCJEq.js","Page-BsZAA8xk.js","getPastedJson-Dev-X0Xy.js","icon-7L2WL0jD.js","MethodPill-Ble59Dl_.js","DuplicateIcon-r-98uLGh.js","createIcon-DaFzipjW.js","DynamicMarkdown-Jk8YAWGN.js","SectionHeading-nLgrCDOg.js","axios-vUo_bRtp.js","Markdown-_QGow1Wo.js","clsx-v8ssfMzu.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-CjboTi0T.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-DkAyo-p5.js"]}