-
Notifications
You must be signed in to change notification settings - Fork 504
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add proper types for futuresExchangeInfo #649
base: master
Are you sure you want to change the base?
Conversation
@@ -1,6 +1,8 @@ | |||
node_modules/ | |||
.nyc_output/ | |||
dist/ | |||
|
|||
.vscode/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(all changes of gitignore)
@@ -1036,7 +1036,7 @@ declare module 'binance-api-node' { | |||
|
|||
export interface SymbolMinNotionalFilter { | |||
filterType: SymbolFilterType.MIN_NOTIONAL | |||
notional: string | |||
minNotional: string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bennycode what's the consensus on this one? Pretty sure there's a lot of back and forth on this which might be due to the fact the field changes depending on which endpoint is hit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yepp, that's why there is now a FuturesSymbolMinNotionalFilter
and a SymbolMinNotionalFilter
. 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh actually you were part of the original convo, my bad
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotcha thank you for the confirmation
@valentiniljaz thank you very much for making this PR 🙇♂️ Can you also change |
Both filters: SPOT and FUTURES are still called "MIN_NOTIONAL". Only the property for Futures Symbol Filter is changed to "notional". That's why I would not change MIN_NOTIONAL => NOTIONAL. Or did you have something else in mind? |
@valentiniljaz If I call this.client.exchangeInfo() then I am getting returned products with a Example: {
"allowedSelfTradePreventionModes": [
"NONE",
"EXPIRE_TAKER",
"EXPIRE_MAKER",
"EXPIRE_BOTH"
],
"allowTrailingStop": true,
"baseAsset": "ETH",
"baseAssetPrecision": 8,
"baseCommissionPrecision": 8,
"cancelReplaceAllowed": true,
"defaultSelfTradePreventionMode": "NONE",
"filters": [
{
"filterType": "PRICE_FILTER",
"maxPrice": "922327.00000000",
"minPrice": "0.00001000",
"tickSize": "0.00001000"
},
{
"filterType": "LOT_SIZE",
"maxQty": "100000.00000000",
"minQty": "0.00010000",
"stepSize": "0.00010000"
},
{
"filterType": "ICEBERG_PARTS",
"limit": 10
},
{
"filterType": "MARKET_LOT_SIZE",
"maxQty": "2829.36596416",
"minQty": "0.00000000",
"stepSize": "0.00000000"
},
{
"filterType": "TRAILING_DELTA",
"maxTrailingAboveDelta": 2000,
"maxTrailingBelowDelta": 2000,
"minTrailingAboveDelta": 10,
"minTrailingBelowDelta": 10
},
{
"askMultiplierDown": "0.2",
"askMultiplierUp": "5",
"avgPriceMins": 5,
"bidMultiplierDown": "0.2",
"bidMultiplierUp": "5",
"filterType": "PERCENT_PRICE_BY_SIDE"
},
{
"applyMaxToMarket": false,
"applyMinToMarket": true,
"avgPriceMins": 5,
"filterType": "NOTIONAL",
"maxNotional": "9000000.00000000",
"minNotional": "0.00010000"
},
{
"filterType": "MAX_NUM_ORDERS",
"maxNumOrders": 200
},
{
"filterType": "MAX_NUM_ALGO_ORDERS",
"maxNumAlgoOrders": 5
}
],
"icebergAllowed": true,
"isMarginTradingAllowed": true,
"isSpotTradingAllowed": true,
"ocoAllowed": true,
"orderTypes": [
"LIMIT",
"LIMIT_MAKER",
"MARKET",
"STOP_LOSS_LIMIT",
"TAKE_PROFIT_LIMIT"
],
"permissions": [
"SPOT",
"MARGIN",
"TRD_GRP_004",
"TRD_GRP_005",
"TRD_GRP_006",
"TRD_GRP_008",
"TRD_GRP_009",
"TRD_GRP_010",
"TRD_GRP_011",
"TRD_GRP_012",
"TRD_GRP_013",
"TRD_GRP_014",
"TRD_GRP_015",
"TRD_GRP_016",
"TRD_GRP_017",
"TRD_GRP_018",
"TRD_GRP_019",
"TRD_GRP_020",
"TRD_GRP_021",
"TRD_GRP_022",
"TRD_GRP_023"
],
"quoteAsset": "BTC",
"quoteAssetPrecision": 8,
"quoteCommissionPrecision": 8,
"quoteOrderQtyMarketAllowed": true,
"quotePrecision": 8,
"status": "TRADING",
"symbol": "ETHBTC"
} |
@bennycode Referring to the official docs https://binance-docs.github.io/apidocs/spot/en/#filters There are two distinct filters: MIN_NOTIONAL and NOTIONAL. As of this moment "binance-api-node" does not provide types for filter NOTIONAL. With additional investigation there appears to be more missing types for Symbol Filters: and for Exchange Filter: I think it's better to prepare new PR just for these filters. What do you think? |
I have edited the PR and added the missing filters for Spot. I've also decoupled Futures filters from Spot. Take a look and let me know if there's anything else that I can do |
Exchange info for Futures API uses different structure then the API for Spot. PR contains new types for ExchangeInfo that reflect the actual state of the API.
Source of truth for the change is:
https://binance-docs.github.io/apidocs/futures/en/#general-info
/fapi/v1/exchangeInfo