mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-28 21:12:16 +00:00
256 lines
7.3 KiB
Python
256 lines
7.3 KiB
Python
"""Polygon Constants."""
|
|
|
|
CRYPTO_EXCHANGE_MAP = {
|
|
1: "Coinbase",
|
|
2: "Bitfinex",
|
|
6: "Bitstamp",
|
|
10: "Binance",
|
|
23: "Kraken",
|
|
}
|
|
|
|
FX_EXCHANGE_MAP = {
|
|
48: "Currency Banks 1",
|
|
}
|
|
|
|
STOCK_EXCHANGE_MAP = {
|
|
1: "XNYS",
|
|
2: "XNAS",
|
|
3: "XNYS",
|
|
4: "FINR",
|
|
5: "XNAS",
|
|
6: "XNAS",
|
|
7: "XCBO",
|
|
8: "XCBO",
|
|
9: "XNYS",
|
|
10: "XNYS",
|
|
11: "XNYS",
|
|
12: "XNAS",
|
|
13: "XNYS",
|
|
14: "LTSE",
|
|
15: "IEXG",
|
|
16: "XCBO",
|
|
17: "XNAS",
|
|
18: "XCBO",
|
|
19: "XCBO",
|
|
20: "MIHI",
|
|
21: "MEMX",
|
|
62: "FINR",
|
|
}
|
|
|
|
STOCK_TRADE_CONDITIONS = {
|
|
0: "Regular Trade",
|
|
1: "Acquisition",
|
|
2: "Average Price Trade",
|
|
3: "Automatic Execution",
|
|
4: "Bunched Trade",
|
|
5: "Bunched Sold Trade",
|
|
6: "CAP Election",
|
|
7: "Cash Sale",
|
|
8: "Closing Prints",
|
|
9: "Cross Trade",
|
|
10: "Derivatively Priced",
|
|
11: "Distribution",
|
|
12: "Form T/Extended Hours",
|
|
13: "Extended Hours (Sold Out Of Sequence)",
|
|
14: "Intermarket Sweep",
|
|
15: "Market Center Official Close",
|
|
16: "Market Center Official Open",
|
|
17: "Market Center Opening Trade",
|
|
18: "Market Center Reopening Trade",
|
|
19: "Market Center Closing Trade",
|
|
20: "Next Day",
|
|
21: "Price Variation Trade",
|
|
22: "Prior Reference Price",
|
|
23: "Rule 155 Trade (AMEX)",
|
|
24: "Rule 127 (NYSE Only)",
|
|
25: "Opening Prints",
|
|
27: "Stopped Stock (Regular Trade)",
|
|
28: "Re-Opening Prints",
|
|
29: "Seller",
|
|
30: "Sold Last",
|
|
31: "Sold Last and Stopped Stock",
|
|
32: "Sold (Out Of Sequence)",
|
|
33: "Sold (Out of Sequence) and Stopped Stock",
|
|
34: "Split Trade",
|
|
35: "Stock Option",
|
|
36: "Yellow Flag Regular Trade",
|
|
37: "Odd Lot Trade",
|
|
38: "Corrected Consolidated Close (per listing market)",
|
|
41: "Trade Thru Exempt",
|
|
52: "Contingent Trade",
|
|
53: "Qualified Contingent Trade",
|
|
55: "Opening Reopening Trade Detail",
|
|
57: "Short Sale Restriction Activated",
|
|
58: "Short Sale Restriction Continued",
|
|
59: "Short Sale Restriction Deactivated",
|
|
60: "Short Sale Restriction In Effect",
|
|
62: "Financial Status - Bankrupt",
|
|
63: "Financial Status - Deficient",
|
|
64: "Financial Status - Delinquent",
|
|
65: "Financial Status - Bankrupt and Deficient",
|
|
66: "Financial Status - Bankrupt and Delinquent",
|
|
67: "Financial Status - Deficient and Delinquent",
|
|
68: "Financial Status - Deficient, Delinquent, and Bankrupt",
|
|
69: "Financial Status - Liquidation",
|
|
70: "Financial Status - Creations Suspended",
|
|
71: "Financial Status - Redemptions Suspended",
|
|
}
|
|
|
|
STOCK_QUOTE_CONDITIONS = {
|
|
0: "Regular",
|
|
1: "RegularTwoSidedOpen",
|
|
2: "RegularOneSidedOpen",
|
|
3: "SlowAsk",
|
|
4: "SlowBid",
|
|
5: "SlowBidAsk",
|
|
6: "SlowDueLRPBid",
|
|
7: "SlowDueLRPAsk",
|
|
8: "SlowDueNYSELRP",
|
|
9: "SlowDueSetSlowListBidAsk",
|
|
10: "ManualAskAutomatedBid",
|
|
11: "ManualBidAutomatedAsk",
|
|
12: "ManualBidAndAsk",
|
|
13: "Opening",
|
|
14: "Closing",
|
|
15: "Closed",
|
|
16: "Resume",
|
|
17: "FastTrading",
|
|
18: "TradingRangeIndication",
|
|
19: "MarketMakerQuotesClosed",
|
|
20: "NonFirm",
|
|
21: "NewsDissemination",
|
|
22: "OrderInflux",
|
|
23: "OrderImbalance",
|
|
24: "DueToRelatedSecurityNewsDissemination",
|
|
25: "DueToRelatedSecurityNewsPending",
|
|
26: "AdditionalInformation",
|
|
27: "NewsPending",
|
|
28: "AdditionalInformationDueToRelatedSecurity",
|
|
29: "DueToRelatedSecurity",
|
|
30: "InViewOfCommon",
|
|
31: "EquipmentChangeover",
|
|
32: "NoOpenNoResponse",
|
|
33: "SubPennyTrading",
|
|
34: "AutomatedBidNoOfferNoBid",
|
|
35: "LULDPriceBand",
|
|
36: "MarketWideCircuitBreakerLevel1",
|
|
37: "MarketWideCircuitBreakerLevel2",
|
|
38: "MarketWideCircuitBreakerLevel3",
|
|
39: "RepublishedLULDPriceBand",
|
|
40: "OnDemandAuction",
|
|
41: "CashOnlySettlement",
|
|
42: "NextDaySettlement",
|
|
43: "LULDTradingPause",
|
|
71: "SlowDuelRPBidAsk",
|
|
80: "Cancel",
|
|
81: "Corrected Price",
|
|
82: "SIPGenerated",
|
|
83: "Unknown",
|
|
84: "Crossed Market",
|
|
85: "Locked Market",
|
|
86: "Depth On Offer Side",
|
|
87: "Depth On Bid Side",
|
|
88: "Depth On Bid And Offer",
|
|
89: "Pre Opening Indication",
|
|
90: "Syndicate Bid",
|
|
91: "Pre Syndicate Bid",
|
|
92: "Penalty Bid",
|
|
95: "CQS Generated",
|
|
}
|
|
|
|
STOCK_QUOTE_INDICATORS = {
|
|
1: "LULD_NBB_NBO_EXECUTABLE",
|
|
22: "LULD_REPUBLISHED_LULD_PRICE_BAND",
|
|
52: "FINANCIAL_STATUS_DEFICIENT",
|
|
301: "SHORT_SALES_RESTRICTION_ACTIVATED",
|
|
302: "SHORT_SALES_RESTRICTION_CONTINUED",
|
|
303: "SHORT_SALES_RESTRICTION_DEACTIVATED",
|
|
304: "SHORT_SALES_RESTRICTION_IN_EFFECT",
|
|
305: "SHORT_SALES_RESTRICTION_MAX",
|
|
601: "NBBO_NO_CHANGE",
|
|
602: "NBBO_QUOTE_IS_NBBO",
|
|
603: "NBBO_NO_BB_NO_BO",
|
|
604: "NBBO_BB_BO_SHORT_APPENDAGE",
|
|
605: "NBBO_BB_BO_LONG_APPENDAGE",
|
|
621: "HELD_TRADE_NOT_LAST_SALE_AND_NOT_ON_CONSOLIDATED",
|
|
622: "HELD_TRADE_LAST_SALE_BUT_NOT_ON_CONSOLIDATED",
|
|
623: "HELD_TRADE_LAST_SALE_AND_ON_CONSOLIDATED",
|
|
501: "RETAIL_INTEREST_ON_BID",
|
|
502: "RETAIL_INTEREST_ON_ASK",
|
|
503: "RETAIL_INTEREST_ON_BID_AND_ASK",
|
|
504: "FINRA_BBO_NO_CHANGE",
|
|
505: "FINRA_BBO_DOES_NOT_EXIST",
|
|
506: "FINRA_BB_BO_EXECUTABLE",
|
|
507: "FINRA_BB_BELOW_LOWER_BAND",
|
|
508: "FINRA_BO_ABOVE_UPPER_BAND",
|
|
509: "FINRA_BB_BELOW_LOWER_BAND_BO_ABOVE_UPPER_BAND",
|
|
901: "CTA_NOT_DUE_TO_RELATED_SECURITY",
|
|
902: "CTA_DUE_TO_RELATED_SECURITY",
|
|
903: "CTA_NOT_IN_VIEW_OF_COMMON",
|
|
904: "CTA_IN_VIEW_OF_COMMON",
|
|
905: "CTA_PRICE_INDICATOR",
|
|
906: "CTA_NEW_PRICE_INDICATOR",
|
|
907: "CTA_CORRECTED_PRICE_INDICATION",
|
|
908: "CTA_CANCELLED_MARKET_IMBALANCE_PRICE_TRADING_RANGE_INDICATION",
|
|
}
|
|
|
|
OPTIONS_EXCHANGE_MAP = {
|
|
300: "XNYS",
|
|
301: "XBOX",
|
|
302: "XCBO",
|
|
303: "MIHI",
|
|
304: "XCBO",
|
|
307: "GEMX",
|
|
308: "XISX",
|
|
309: "XISX",
|
|
310: "XISX",
|
|
312: "MIHI",
|
|
313: "XNYS",
|
|
314: "OPRA",
|
|
315: "MIHI",
|
|
316: "XNAS",
|
|
318: "MIHI",
|
|
319: "XNAS",
|
|
320: "MEMX",
|
|
322: "XCBO",
|
|
323: "XNAS",
|
|
325: "XCBO",
|
|
}
|
|
|
|
|
|
OPTIONS_TRADE_CONDITIONS = {
|
|
201: "Canceled",
|
|
202: "Late and Out Of Sequence",
|
|
203: "Last and Canceled",
|
|
204: "Late",
|
|
205: "Opening Trade and Canceled",
|
|
206: "Opening Trade, Late, and Out Of Sequence",
|
|
207: "Only Trade and Canceled",
|
|
208: "Opening Trade and Late",
|
|
209: "Automatic Execution",
|
|
210: "Reopening Trade",
|
|
219: "Intermarket Sweep Order",
|
|
227: "Single Leg Auction Non ISO",
|
|
228: "Single Leg Auction ISO",
|
|
229: "Single Leg Cross Non ISO",
|
|
230: "Single Leg Cross ISO",
|
|
231: "Single Leg Floor Trade",
|
|
232: "Multi Leg auto-electronic trade",
|
|
233: "Multi Leg Auction",
|
|
234: "Multi Leg Cross",
|
|
235: "Multi Leg floor trade",
|
|
236: "Multi Leg auto-electronic trade against single leg(s)",
|
|
237: "Stock Options Auction",
|
|
238: "Multi Leg Auction against single leg(s)",
|
|
239: "Multi Leg floor trade against single leg(s)",
|
|
240: "Stock Options auto-electronic trade",
|
|
241: "Stock Options Cross",
|
|
242: "Stock Options floor trade",
|
|
243: "Stock Options auto-electronic trade against single leg(s)",
|
|
244: "Stock Options Auction against single leg(s)",
|
|
245: "Stock Options floor trade against single leg(s)",
|
|
246: "Multi Leg Floor Trade of Proprietary Products",
|
|
247: "Multilateral Compression Trade of Proprietary Products",
|
|
248: "Extended Hours Trade",
|
|
}
|