exchanges/futures: Implement open interest (#1417)

* adds open interest to exchanges

* ADDS TESTING YEAH

* New endpoints, BTSE, RPCS, cached

* slight design change, begin gateio

You will need to get cached for
each exchange that supports it

* gateio, huobi, rpc

* fix up kraken, cache retrieval

* okx, gateio

* finalising all implementations and tests

* definitely my final ever commit on this

* Well, well, well

* final v2

* quick fix of bug

* test coverage, assert notempty, test helper

Added a new testhelper for currency
management because its very annoying
in a parallel test setting which wastes
so much space otherwise

* minimises REST requests for Open Interest

* types.Number merge misses

* Minimises Kraken REST calls

* len change, value -> pointer receiver

* further fixup

* fixes gateio, batch calculates open interest

* single gateio, lint const fixes

* rejig and more thorough oi for huobi

* formatting expansion

* minor fix for handling expiring contracts

* rm unused Binance strings

* add bybit support, fix bybit issues

* oopsie doopsie, dont look at my whoopsie

* Fix issue, remove feature

* move an irrelevant function for the pr

* mini bybit upgrades

* fixes cli request bug
This commit is contained in:
Scott
2024-01-12 15:27:35 +11:00
committed by GitHub
parent 614042110a
commit b71bf1f3d1
62 changed files with 22660 additions and 10095 deletions

View File

@@ -2869,6 +2869,36 @@
]
}
},
"/v1/getopeninterest": {
"get": {
"operationId": "GoCryptoTraderService_GetOpenInterest",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/gctrpcGetOpenInterestResponse"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/rpcStatus"
}
}
},
"parameters": [
{
"name": "exchange",
"in": "query",
"required": false,
"type": "string"
}
],
"tags": [
"GoCryptoTraderService"
]
}
},
"/v1/getorder": {
"post": {
"operationId": "GoCryptoTraderService_GetOrder",
@@ -6291,6 +6321,18 @@
}
}
},
"gctrpcGetOpenInterestResponse": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/gctrpcOpenInterestDataResponse"
}
}
}
},
"gctrpcGetOrderRequest": {
"type": "object",
"properties": {
@@ -6730,6 +6772,35 @@
}
}
},
"gctrpcOpenInterestDataRequest": {
"type": "object",
"properties": {
"asset": {
"type": "string"
},
"pair": {
"$ref": "#/definitions/gctrpcCurrencyPair"
}
}
},
"gctrpcOpenInterestDataResponse": {
"type": "object",
"properties": {
"exchange": {
"type": "string"
},
"asset": {
"type": "string"
},
"pair": {
"$ref": "#/definitions/gctrpcCurrencyPair"
},
"openInterest": {
"type": "number",
"format": "double"
}
}
},
"gctrpcOrderDetails": {
"type": "object",
"properties": {