> For the complete documentation index, see [llms.txt](https://www.pionex.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.pionex.com/docs/api-docs/earn-api/arbitrage.md).

# Arbitrage

Term Arbitrage endpoints

## List Arbitrage products

> Returns the list of Term Arbitrage products currently available. Requires \`View\` permission. Weight: 1.\
> \
> Example request:\
> \`\`\`\
> GET /api/v1/earn/arbitrage/fetchProducts?timestamp=1774959429596\
> \`\`\`<br>

````json
{"openapi":"3.0.3","info":{"title":"Pionex Earn Open API - Arbitrage","version":"1.0.0"},"tags":[{"name":"Arbitrage","description":"Term Arbitrage endpoints"}],"servers":[{"url":"https://api.pionex.com","description":"Production"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","in":"header","name":"PIONEX-KEY","description":"API Key authentication. Requires two headers:\n- `PIONEX-KEY`: Your API Key\n- `PIONEX-SIGNATURE`: HMAC SHA256 hex signature\n\nAnd a `timestamp` query parameter (milliseconds).\n"}},"parameters":{"Timestamp":{"name":"timestamp","in":"query","required":true,"description":"Current timestamp in milliseconds (valid range +/- 20 seconds)","schema":{"type":"integer","format":"int64"}}},"schemas":{"BaseResponse":{"type":"object","properties":{"result":{"type":"boolean","description":"Whether the request succeeded"},"timestamp":{"type":"integer","format":"int64","description":"Response timestamp in milliseconds"}}},"ErrorResponse":{"type":"object","properties":{"result":{"type":"boolean"},"code":{"type":"string","description":"Error code (e.g. `ARBITRAGE_PARAMETER_ERROR`)"},"message":{"type":"string","description":"Human-readable error message"},"timestamp":{"type":"integer","format":"int64"}}}},"responses":{"BadRequest":{"description":"Bad request — invalid parameters. Common error code: `ARBITRAGE_PARAMETER_ERROR`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"Unauthorized":{"description":"Authentication failed — missing or invalid API Key / signature","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/api/v1/earn/arbitrage/fetchProducts":{"get":{"tags":["Arbitrage"],"summary":"List Arbitrage products","description":"Returns the list of Term Arbitrage products currently available. Requires `View` permission. Weight: 1.\n\nExample request:\n```\nGET /api/v1/earn/arbitrage/fetchProducts?timestamp=1774959429596\n```\n","operationId":"arbitrageFetchProducts","parameters":[{"$ref":"#/components/parameters/Timestamp"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/BaseResponse"},{"type":"object","properties":{"data":{"type":"object","description":"Product list (pass-through of the upstream gRPC Products response)"}}}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"}}}}}}
````

## Get user Arbitrage balances

> Returns the authenticated user's Term Arbitrage positions and balances. Requires \`View\` permission. Weight: 1.\
> \
> Example request:\
> \`\`\`\
> GET /api/v1/earn/arbitrage/fetchUserBalances?timestamp=1774959429596\
> \`\`\`<br>

````json
{"openapi":"3.0.3","info":{"title":"Pionex Earn Open API - Arbitrage","version":"1.0.0"},"tags":[{"name":"Arbitrage","description":"Term Arbitrage endpoints"}],"servers":[{"url":"https://api.pionex.com","description":"Production"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","in":"header","name":"PIONEX-KEY","description":"API Key authentication. Requires two headers:\n- `PIONEX-KEY`: Your API Key\n- `PIONEX-SIGNATURE`: HMAC SHA256 hex signature\n\nAnd a `timestamp` query parameter (milliseconds).\n"}},"parameters":{"Timestamp":{"name":"timestamp","in":"query","required":true,"description":"Current timestamp in milliseconds (valid range +/- 20 seconds)","schema":{"type":"integer","format":"int64"}}},"schemas":{"BaseResponse":{"type":"object","properties":{"result":{"type":"boolean","description":"Whether the request succeeded"},"timestamp":{"type":"integer","format":"int64","description":"Response timestamp in milliseconds"}}},"ErrorResponse":{"type":"object","properties":{"result":{"type":"boolean"},"code":{"type":"string","description":"Error code (e.g. `ARBITRAGE_PARAMETER_ERROR`)"},"message":{"type":"string","description":"Human-readable error message"},"timestamp":{"type":"integer","format":"int64"}}}},"responses":{"BadRequest":{"description":"Bad request — invalid parameters. Common error code: `ARBITRAGE_PARAMETER_ERROR`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"Unauthorized":{"description":"Authentication failed — missing or invalid API Key / signature","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/api/v1/earn/arbitrage/fetchUserBalances":{"get":{"tags":["Arbitrage"],"summary":"Get user Arbitrage balances","description":"Returns the authenticated user's Term Arbitrage positions and balances. Requires `View` permission. Weight: 1.\n\nExample request:\n```\nGET /api/v1/earn/arbitrage/fetchUserBalances?timestamp=1774959429596\n```\n","operationId":"arbitrageFetchUserBalances","parameters":[{"$ref":"#/components/parameters/Timestamp"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/BaseResponse"},{"type":"object","properties":{"data":{"type":"object","description":"User balances (pass-through of the upstream gRPC FetchUserBalancesResponse)"}}}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"}}}}}}
````

## Stake into an Arbitrage product

> Subscribes to a Term Arbitrage product. Requires \`Earn\` permission. Weight: 1.\
> \
> \*\*Validation:\*\*\
> \- \`amount\` must be a valid decimal amount.\
> \- \`productId\` must exist in the product list returned by \`GET /api/v1/earn/arbitrage/fetchProducts\`.\
> \- \`coin\` must be one of \`USDT\` or \`USDC\`.\
> \
> Example request body:\
> \`\`\`json\
> {\
> &#x20; "productId": "ARB-USDT-30D",\
> &#x20; "coin": "USDT",\
> &#x20; "amount": "100"\
> }\
> \`\`\`\
> \
> Example response:\
> \`\`\`json\
> {\
> &#x20; "result": true,\
> &#x20; "data": {\
> &#x20;   "request\_id": "req-abcdef",\
> &#x20;   "status": "success",\
> &#x20;   "txid": "tx-123456"\
> &#x20; },\
> &#x20; "timestamp": 1774959429596\
> }\
> \`\`\`<br>

````json
{"openapi":"3.0.3","info":{"title":"Pionex Earn Open API - Arbitrage","version":"1.0.0"},"tags":[{"name":"Arbitrage","description":"Term Arbitrage endpoints"}],"servers":[{"url":"https://api.pionex.com","description":"Production"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","in":"header","name":"PIONEX-KEY","description":"API Key authentication. Requires two headers:\n- `PIONEX-KEY`: Your API Key\n- `PIONEX-SIGNATURE`: HMAC SHA256 hex signature\n\nAnd a `timestamp` query parameter (milliseconds).\n"}},"parameters":{"Timestamp":{"name":"timestamp","in":"query","required":true,"description":"Current timestamp in milliseconds (valid range +/- 20 seconds)","schema":{"type":"integer","format":"int64"}}},"schemas":{"ArbitrageStakeRequest":{"type":"object","required":["productId","coin","amount"],"properties":{"productId":{"type":"string","description":"Product ID. Must exist in the product list from `/api/v1/earn/arbitrage/fetchProducts`."},"coin":{"type":"string","description":"Subscription currency. Only `USDT` or `USDC` are supported.","enum":["USDT","USDC"]},"amount":{"type":"string","description":"Subscription amount as a decimal string"}}},"BaseResponse":{"type":"object","properties":{"result":{"type":"boolean","description":"Whether the request succeeded"},"timestamp":{"type":"integer","format":"int64","description":"Response timestamp in milliseconds"}}},"ArbitrageTxData":{"type":"object","properties":{"request_id":{"type":"string","description":"Request ID assigned by the upstream Arbitrage service"},"status":{"type":"string","description":"Transaction status (e.g. `success`)"},"txid":{"type":"string","description":"Transaction ID"}}},"ErrorResponse":{"type":"object","properties":{"result":{"type":"boolean"},"code":{"type":"string","description":"Error code (e.g. `ARBITRAGE_PARAMETER_ERROR`)"},"message":{"type":"string","description":"Human-readable error message"},"timestamp":{"type":"integer","format":"int64"}}}},"responses":{"BadRequest":{"description":"Bad request — invalid parameters. Common error code: `ARBITRAGE_PARAMETER_ERROR`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"Unauthorized":{"description":"Authentication failed — missing or invalid API Key / signature","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/api/v1/earn/arbitrage/stake":{"post":{"tags":["Arbitrage"],"summary":"Stake into an Arbitrage product","description":"Subscribes to a Term Arbitrage product. Requires `Earn` permission. Weight: 1.\n\n**Validation:**\n- `amount` must be a valid decimal amount.\n- `productId` must exist in the product list returned by `GET /api/v1/earn/arbitrage/fetchProducts`.\n- `coin` must be one of `USDT` or `USDC`.\n\nExample request body:\n```json\n{\n  \"productId\": \"ARB-USDT-30D\",\n  \"coin\": \"USDT\",\n  \"amount\": \"100\"\n}\n```\n\nExample response:\n```json\n{\n  \"result\": true,\n  \"data\": {\n    \"request_id\": \"req-abcdef\",\n    \"status\": \"success\",\n    \"txid\": \"tx-123456\"\n  },\n  \"timestamp\": 1774959429596\n}\n```\n","operationId":"arbitrageStake","parameters":[{"$ref":"#/components/parameters/Timestamp"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArbitrageStakeRequest"}}}},"responses":{"200":{"description":"Stake succeeded","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/BaseResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ArbitrageTxData"}}}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"}}}}}}
````

## Redeem from an Arbitrage product

> Redeems from a Term Arbitrage product. Requires \`Earn\` permission. Weight: 1.\
> \
> \*\*Validation:\*\*\
> \- \`amount\` must be a valid decimal amount.\
> \- \`productId\` must exist in the product list returned by \`GET /api/v1/earn/arbitrage/fetchProducts\`.\
> \- \`coin\` must be one of \`USDT\` or \`USDC\`.\
> \
> Example request body:\
> \`\`\`json\
> {\
> &#x20; "productId": "ARB-USDT-30D",\
> &#x20; "coin": "USDT",\
> &#x20; "amount": "100"\
> }\
> \`\`\`\
> \
> Example response:\
> \`\`\`json\
> {\
> &#x20; "result": true,\
> &#x20; "data": {\
> &#x20;   "status": "success"\
> &#x20; },\
> &#x20; "timestamp": 1774959429596\
> }\
> \`\`\`<br>

````json
{"openapi":"3.0.3","info":{"title":"Pionex Earn Open API - Arbitrage","version":"1.0.0"},"tags":[{"name":"Arbitrage","description":"Term Arbitrage endpoints"}],"servers":[{"url":"https://api.pionex.com","description":"Production"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","in":"header","name":"PIONEX-KEY","description":"API Key authentication. Requires two headers:\n- `PIONEX-KEY`: Your API Key\n- `PIONEX-SIGNATURE`: HMAC SHA256 hex signature\n\nAnd a `timestamp` query parameter (milliseconds).\n"}},"parameters":{"Timestamp":{"name":"timestamp","in":"query","required":true,"description":"Current timestamp in milliseconds (valid range +/- 20 seconds)","schema":{"type":"integer","format":"int64"}}},"schemas":{"ArbitrageUnStakeRequest":{"type":"object","required":["productId","coin","amount"],"properties":{"productId":{"type":"string","description":"Product ID. Must exist in the product list from `/api/v1/earn/arbitrage/fetchProducts`."},"coin":{"type":"string","description":"Redemption currency. Only `USDT` or `USDC` are supported.","enum":["USDT","USDC"]},"amount":{"type":"string","description":"Redemption amount as a decimal string"}}},"BaseResponse":{"type":"object","properties":{"result":{"type":"boolean","description":"Whether the request succeeded"},"timestamp":{"type":"integer","format":"int64","description":"Response timestamp in milliseconds"}}},"ArbitrageUnStakeData":{"type":"object","properties":{"status":{"type":"string","description":"Transaction status (e.g. `success`)"}}},"ErrorResponse":{"type":"object","properties":{"result":{"type":"boolean"},"code":{"type":"string","description":"Error code (e.g. `ARBITRAGE_PARAMETER_ERROR`)"},"message":{"type":"string","description":"Human-readable error message"},"timestamp":{"type":"integer","format":"int64"}}}},"responses":{"BadRequest":{"description":"Bad request — invalid parameters. Common error code: `ARBITRAGE_PARAMETER_ERROR`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"Unauthorized":{"description":"Authentication failed — missing or invalid API Key / signature","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/api/v1/earn/arbitrage/unStake":{"post":{"tags":["Arbitrage"],"summary":"Redeem from an Arbitrage product","description":"Redeems from a Term Arbitrage product. Requires `Earn` permission. Weight: 1.\n\n**Validation:**\n- `amount` must be a valid decimal amount.\n- `productId` must exist in the product list returned by `GET /api/v1/earn/arbitrage/fetchProducts`.\n- `coin` must be one of `USDT` or `USDC`.\n\nExample request body:\n```json\n{\n  \"productId\": \"ARB-USDT-30D\",\n  \"coin\": \"USDT\",\n  \"amount\": \"100\"\n}\n```\n\nExample response:\n```json\n{\n  \"result\": true,\n  \"data\": {\n    \"status\": \"success\"\n  },\n  \"timestamp\": 1774959429596\n}\n```\n","operationId":"arbitrageUnStake","parameters":[{"$ref":"#/components/parameters/Timestamp"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArbitrageUnStakeRequest"}}}},"responses":{"200":{"description":"Redemption succeeded","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/BaseResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ArbitrageUnStakeData"}}}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"}}}}}}
````
