akshare 0.1.0

100% pure Rust implementation of akshare — unified access to Chinese and global financial market data APIs
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
//! Shared types used across all modules.
//!
//! Core data structures: [`QuoteSnapshot`], [`CandlePoint`], [`MacroDataPoint`],
//! [`Row`] (flexible key-value map), [`MarketKind`], and more.

use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum MarketKind {
    AShare,
    HongKong,
    UsEquity,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct QuoteSnapshot {
    pub symbol: String,
    pub date: String,
    pub open: f64,
    pub high: f64,
    pub low: f64,
    pub close: f64,
    pub volume: i64,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CandlePoint {
    pub trade_date: String,
    pub open: f64,
    pub close: f64,
    pub high: f64,
    pub low: f64,
    pub volume: i64,
    pub amount: f64,
    pub amplitude_pct: f64,
    pub change_pct: f64,
    pub change_amount: f64,
    pub turnover_pct: f64,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct FundamentalsSnapshot {
    pub symbol: String,
    pub company_name: String,
    pub cik: String,
    pub industry: Option<String>,
    pub currency: String,
    pub fiscal_year_end: Option<String>,
    pub shares_outstanding: Option<i64>,
    pub market_cap: Option<f64>,
    pub net_income_usd: Option<f64>,
    pub revenues_usd: Option<f64>,
    pub assets_usd: Option<f64>,
    pub liabilities_usd: Option<f64>,
    pub stockholders_equity_usd: Option<f64>,
    pub cash_and_equivalents_usd: Option<f64>,
    pub gross_profit_usd: Option<f64>,
    pub operating_income_usd: Option<f64>,
    pub operating_expenses_usd: Option<f64>,
    pub operating_cash_flow_usd: Option<f64>,
    pub capital_expenditure_usd: Option<f64>,
    pub free_cash_flow_usd: Option<f64>,
    pub long_term_debt_usd: Option<f64>,
    pub current_debt_usd: Option<f64>,
    pub total_debt_usd: Option<f64>,
    pub diluted_shares_outstanding: Option<i64>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct NewsItem {
    pub published_at: String,
    pub title: String,
    pub summary: String,
    pub source: String,
    pub url: Option<String>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CapitalFlowPoint {
    pub trade_date: String,
    pub main_net_inflow: f64,
    pub small_net_inflow: f64,
    pub medium_net_inflow: f64,
    pub large_net_inflow: f64,
    pub super_large_net_inflow: f64,
    pub main_net_inflow_ratio_pct: f64,
    pub small_net_inflow_ratio_pct: f64,
    pub medium_net_inflow_ratio_pct: f64,
    pub large_net_inflow_ratio_pct: f64,
    pub super_large_net_inflow_ratio_pct: f64,
    pub close: f64,
    pub change_pct: f64,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SectorSnapshot {
    pub sector_code: String,
    pub sector_name: String,
    pub latest_index: f64,
    pub change_pct: f64,
    pub main_net_inflow: f64,
    pub main_net_inflow_ratio_pct: f64,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SectorConstituent {
    pub symbol: String,
    pub name: String,
    pub latest_price: f64,
    pub change_pct: f64,
    pub main_net_inflow: Option<f64>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct StockSearchResult {
    pub symbol: String,
    pub name: String,
    pub market: String,
    pub exchange: String,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct AnnouncementDetail {
    pub art_code: String,
    pub title: String,
    pub published_at: String,
    pub content: String,
    pub pdf_url: Option<String>,
    pub source: String,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct AnnouncementItem {
    pub art_code: String,
    pub symbol: String,
    pub title: String,
    pub published_at: String,
    pub url: Option<String>,
    pub source: String,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct BillboardEntry {
    pub trade_date: String,
    pub symbol: String,
    pub name: String,
    pub close_price: f64,
    pub change_rate_pct: f64,
    pub turnover_rate_pct: Option<f64>,
    pub net_amount: Option<f64>,
    pub buy_amount: Option<f64>,
    pub sell_amount: Option<f64>,
    pub explanation: Option<String>,
    pub reason: Option<String>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct BillboardSeatDetail {
    pub trade_date: String,
    pub symbol: String,
    pub department_name: String,
    pub buy_amount: Option<f64>,
    pub sell_amount: Option<f64>,
    pub net_amount: Option<f64>,
    pub explanation: Option<String>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct TradeCalendarItem {
    pub exchange: String,
    pub calendar_date: String,
    pub is_open: bool,
    pub previous_trade_date: Option<String>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct MacroDataPoint {
    pub date: String,
    pub value: f64,
    pub name: String,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct IndexSnapshot {
    pub symbol: String,
    pub name: String,
    pub date: String,
    pub close: f64,
    pub change_pct: f64,
    pub volume: f64,
    pub amount: f64,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct FundSnapshot {
    pub symbol: String,
    pub name: String,
    pub date: String,
    pub nav: f64,
    pub acc_nav: f64,
    pub change_pct: f64,
    #[serde(default)]
    pub fund_type: Option<String>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct BondSnapshot {
    pub symbol: String,
    pub name: String,
    pub date: String,
    pub close: f64,
    pub change_pct: f64,
    pub yield_rate: Option<f64>,
    #[serde(default)]
    pub credit_rating: Option<String>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct FuturesSnapshot {
    pub symbol: String,
    pub name: String,
    pub date: String,
    pub close: f64,
    pub change_pct: f64,
    pub volume: f64,
    pub open_interest: f64,
    #[serde(default)]
    pub settlement_price: Option<f64>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct OptionSnapshot {
    pub symbol: String,
    pub name: String,
    pub date: String,
    pub close: f64,
    pub change_pct: f64,
    pub volume: f64,
    pub open_interest: f64,
    #[serde(default)]
    pub strike_price: Option<f64>,
    #[serde(default)]
    pub expiry_date: Option<String>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ForexRate {
    pub currency_pair: String,
    pub buy_rate: f64,
    pub sell_rate: f64,
    pub middle_rate: f64,
    pub date: String,
    #[serde(default)]
    pub change_pct: Option<f64>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CryptoSpot {
    pub symbol: String,
    pub name: String,
    pub price_usd: f64,
    pub price_cny: f64,
    pub change_24h_pct: f64,
    pub volume_24h: f64,
    pub market_cap: f64,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ReitSnapshot {
    pub symbol: String,
    pub name: String,
    pub date: String,
    pub close: f64,
    pub change_pct: f64,
    pub volume: f64,
    #[serde(default)]
    pub nav: Option<f64>,
}

/// Generic row type for flexible tabular data returned by many APIs.
pub type Row = std::collections::HashMap<String, serde_json::Value>;

/// Futures daily bar (OHLCV + settlement) across exchanges.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct FuturesDailyBar {
    pub symbol: String,
    pub date: String,
    pub open: f64,
    pub high: f64,
    pub low: f64,
    pub close: f64,
    pub volume: f64,
    pub open_interest: f64,
    pub turnover: f64,
    pub settle: f64,
    pub pre_settle: f64,
    pub variety: String,
}

/// Futures position rank entry for a single member.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct FuturesPositionRank {
    pub rank: i32,
    pub vol_party_name: String,
    pub vol: f64,
    pub vol_chg: f64,
    pub long_party_name: String,
    pub long_open_interest: f64,
    pub long_open_interest_chg: f64,
    pub short_party_name: String,
    pub short_open_interest: f64,
    pub short_open_interest_chg: f64,
    pub symbol: String,
    pub variety: String,
}

/// Futures realtime quote from Sina.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct FuturesRealtimeQuote {
    pub symbol: String,
    pub time: String,
    pub open: f64,
    pub high: f64,
    pub low: f64,
    pub current_price: f64,
    pub bid_price: f64,
    pub ask_price: f64,
    pub buy_vol: f64,
    pub sell_vol: f64,
    pub hold: f64,
    pub volume: f64,
    pub avg_price: f64,
    pub last_close: f64,
    pub last_settle_price: f64,
}

/// Foreign commodity realtime quote from Sina.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ForeignCommodityQuote {
    pub symbol: String,
    pub current_price: f64,
    pub current_price_rmb: f64,
    pub change_amount: f64,
    pub change_pct: f64,
    pub open: f64,
    pub high: f64,
    pub low: f64,
    pub last_settle_price: f64,
    pub hold: f64,
    pub bid: f64,
    pub ask: f64,
    pub time: String,
    pub date: String,
}

/// Futures kline point (minute or daily) from Sina.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct FuturesKlinePoint {
    pub datetime: String,
    pub open: f64,
    pub high: f64,
    pub low: f64,
    pub close: f64,
    pub volume: f64,
    pub hold: f64,
}

/// Eastmoney futures historical kline.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct FuturesHistKline {
    pub date: String,
    pub open: f64,
    pub close: f64,
    pub high: f64,
    pub low: f64,
    pub change_amount: f64,
    pub change_pct: f64,
    pub volume: f64,
    pub amount: f64,
    pub open_interest: f64,
}

/// Global futures kline from Eastmoney.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GlobalFuturesKline {
    pub date: String,
    pub code: String,
    pub name: String,
    pub open: f64,
    pub latest_price: f64,
    pub high: f64,
    pub low: f64,
    pub volume: f64,
    pub change_pct: f64,
    pub open_interest: f64,
    pub open_interest_chg: f64,
}

// ---------------------------------------------------------------------------
// Index-specific types
// ---------------------------------------------------------------------------

/// Generic index spot item (A-share / HK / Global indices).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct IndexSpotItem {
    pub code: String,
    pub name: String,
    pub close: f64,
    pub change_pct: f64,
    pub change_amount: f64,
    pub volume: f64,
    pub amount: f64,
    pub amplitude_pct: f64,
    pub high: f64,
    pub low: f64,
    pub open: f64,
    pub prev_close: f64,
}

/// HK index spot item with internal market id.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct HkIndexSpotItem {
    pub code: String,
    pub internal_id: String,
    pub name: String,
    pub close: f64,
    pub change_amount: f64,
    pub change_pct: f64,
    pub open: f64,
    pub high: f64,
    pub low: f64,
    pub prev_close: f64,
    pub volume: f64,
    pub amount: f64,
}

/// CX / Caixin index time-series point.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CxIndexPoint {
    pub date: String,
    pub value: f64,
    pub change: f64,
}

/// QVIX daily OHLC point.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct QvixDailyPoint {
    pub date: String,
    pub open: f64,
    pub high: f64,
    pub low: f64,
    pub close: f64,
}

/// QVIX intraday point.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct QvixMinPoint {
    pub time: String,
    pub qvix: f64,
}

/// CNIndex overview item.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CniIndexItem {
    pub code: String,
    pub name: String,
    pub sample_count: f64,
    pub close: f64,
    pub change_pct: f64,
    pub pe_ttm: f64,
    pub volume: f64,
    pub amount: f64,
    pub total_mv: f64,
    pub free_circ_mv: f64,
}

/// CNIndex daily history point.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CniHistPoint {
    pub date: String,
    pub open: f64,
    pub high: f64,
    pub low: f64,
    pub close: f64,
    pub change_pct: f64,
    pub volume: f64,
    pub amount: f64,
}

/// CSIndex history point.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CsindexHistPoint {
    pub date: String,
    pub open: f64,
    pub high: f64,
    pub low: f64,
    pub close: f64,
    pub change: f64,
    pub change_pct: f64,
    pub volume: f64,
    pub amount: f64,
    pub sample_count: f64,
    pub pe_ttm: f64,
}

/// Shenwan research index history point.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SwResearchHistPoint {
    pub code: String,
    pub date: String,
    pub open: f64,
    pub close: f64,
    pub high: f64,
    pub low: f64,
    pub volume: f64,
    pub amount: f64,
}

/// Shenwan research index realtime.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SwResearchRealtime {
    pub code: String,
    pub name: String,
    pub prev_close: f64,
    pub change_pct: f64,
    pub year_change_pct: f64,
}

/// Shenwan research component stock.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SwResearchComponent {
    pub symbol: String,
    pub name: String,
    pub weight: f64,
    pub date: String,
}

/// Shenwan analysis daily point.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SwAnalysisPoint {
    pub code: String,
    pub name: String,
    pub date: String,
    pub close: f64,
    pub volume: f64,
    pub change_pct: f64,
    pub turnover_rate: f64,
    pub pe: f64,
    pub pb: f64,
    pub avg_price: f64,
    pub amount_ratio: f64,
    pub circ_mv: f64,
    pub avg_circ_mv: f64,
    pub dividend_yield: f64,
}

/// Shenwan fund index realtime.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SwFundRealtime {
    pub code: String,
    pub name: String,
    pub prev_close: f64,
    pub change_pct: f64,
    pub year_change_pct: f64,
}

/// Shenwan fund index history point.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SwFundHistPoint {
    pub date: String,
    pub close: f64,
    pub open: f64,
    pub high: f64,
    pub low: f64,
    pub change_pct: f64,
}

/// CFLP logistics index point.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CflpIndexPoint {
    pub date: String,
    pub base_index: f64,
    pub mom_index: f64,
    pub yoy_index: f64,
}

/// Sugar index point (msweet).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SugarIndexPoint {
    pub date: String,
    pub composite_price: f64,
    pub raw_sugar_price: f64,
    pub spot_price: f64,
}

/// Hog index point.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct HogIndexPoint {
    pub date: String,
    pub index: f64,
    pub ma4: f64,
    pub ma6: f64,
    pub ma12: f64,
    pub presale_avg: f64,
    pub deal_avg: f64,
    pub deal_avg_weight: f64,
}

/// ERI (emission rights) index point.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct EriIndexPoint {
    pub date: String,
    pub trade_index: f64,
    pub volume: f64,
    pub amount: f64,
}

/// Spot goods price index point.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SpotGoodsPoint {
    pub date: String,
    pub index: f64,
    pub change_amount: f64,
    pub change_pct: f64,
}

/// News sentiment index point.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct NewsSentimentPoint {
    pub date: String,
    pub sentiment_index: f64,
    pub csi300: f64,
}

// ---------------------------------------------------------------------------
// Fund-specific types
// ---------------------------------------------------------------------------

/// Fund NAV history info point (from eastmoney lsjz API).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct FundNavHistory {
    pub date: String,
    pub nav: f64,
    pub acc_nav: f64,
    pub change_pct: f64,
    pub subscribe_status: String,
    pub redeem_status: String,
}

/// Fund position estimate point (from Legu).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct FundPositionPoint {
    pub date: String,
    pub close: f64,
    pub position: f64,
}

/// Fund announcement item.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct FundAnnouncementItem {
    pub fund_code: String,
    pub title: String,
    pub fund_name: String,
    pub date: String,
    pub report_id: String,
}

/// Fund portfolio change item.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct FundPortfolioChangeItem {
    pub rank: i32,
    pub stock_code: String,
    pub stock_name: String,
    pub amount: f64,
    pub ratio: f64,
    pub quarter: String,
}

/// Fund industry allocation item.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct FundIndustryAllocItem {
    pub rank: i32,
    pub industry: String,
    pub ratio: f64,
    pub market_value: f64,
    pub date: String,
}

/// Fund rating item.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct FundRatingItem {
    pub code: String,
    pub name: String,
    pub fund_manager: String,
    pub company: String,
    pub rating_count_5star: i32,
    pub rating_sh: i32,
    pub rating_zs: i32,
    pub rating_ja: i32,
    pub rating_morningstar: i32,
    pub fee: f64,
    pub fund_type: String,
}

/// Fund manager item.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct FundManagerItem {
    pub rank: i32,
    pub name: String,
    pub company: String,
    pub fund_code: String,
    pub fund_name: String,
    pub career_days: i32,
    pub total_scale: f64,
    pub best_return: f64,
}

/// Fund new found item.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct FundNewFoundItem {
    pub fund_code: String,
    pub fund_name: String,
    pub company: String,
    pub fund_type: String,
    pub subscribe_period: String,
    pub shares: f64,
    pub found_date: String,
    pub return_since_found: f64,
    pub manager: String,
    pub status: String,
    pub discount_fee: f64,
}

/// Fund scale change item.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct FundScaleChangeItem {
    pub rank: i32,
    pub report_date: String,
    pub fund_count: i32,
    pub subscribe: f64,
    pub redeem: f64,
    pub end_shares: f64,
    pub end_net_assets: f64,
}

/// Fund holder structure item.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct FundHolderStructureItem {
    pub rank: i32,
    pub report_date: String,
    pub fund_count: i32,
    pub institution_ratio: f64,
    pub individual_ratio: f64,
    pub internal_ratio: f64,
    pub total_shares: f64,
}

/// Fund dividend item (from fhsp_em).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct FundDividendItem {
    pub rank: i32,
    pub fund_code: String,
    pub fund_name: String,
    pub record_date: String,
    pub ex_date: String,
    pub dividend: f64,
    pub pay_date: String,
}

/// Fund dividend rank item.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct FundDividendRankItem {
    pub rank: i32,
    pub fund_code: String,
    pub fund_name: String,
    pub cumulative_dividend: f64,
    pub cumulative_count: i32,
    pub found_date: String,
}

/// Fund split item.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct FundSplitItem {
    pub rank: i32,
    pub fund_code: String,
    pub fund_name: String,
    pub split_date: String,
    pub split_type: String,
    pub split_ratio: f64,
}

/// ETF spot item from Eastmoney.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct EtfSpotItem {
    pub code: String,
    pub name: String,
    pub latest_price: f64,
    pub change_pct: f64,
    pub change_amount: f64,
    pub volume: f64,
    pub amount: f64,
    pub open: f64,
    pub high: f64,
    pub low: f64,
    pub prev_close: f64,
    pub amplitude: f64,
    pub turnover_rate: f64,
    pub iopv: f64,
    pub discount_rate: f64,
    pub shares: f64,
    pub circ_mv: f64,
    pub total_mv: f64,
    pub data_date: String,
}

/// ETF scale item from SSE.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct EtfScaleItem {
    pub rank: i32,
    pub fund_code: String,
    pub fund_name: String,
    pub etf_type: String,
    pub stat_date: String,
    pub shares: f64,
}

/// Fund AUM trend point.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct FundAumTrendPoint {
    pub date: String,
    pub value: f64,
}

/// Fund AUM history item.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct FundAumHistItem {
    pub rank: i32,
    pub company: String,
    pub total: f64,
    pub equity: f64,
    pub mixed: f64,
    pub bond: f64,
    pub index: f64,
    pub qdii: f64,
    pub money: f64,
}

/// Fund AUM company item.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct FundAumCompanyItem {
    pub rank: i32,
    pub company: String,
    pub found_date: String,
    pub total_scale: f64,
    pub fund_count: i32,
    pub manager_count: i32,
    pub update_date: String,
}

/// Fund exchange rank item.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct FundExchangeRankItem {
    pub rank: i32,
    pub fund_code: String,
    pub fund_name: String,
    pub fund_type: String,
    pub date: String,
    pub nav: f64,
    pub acc_nav: f64,
    pub week_1: f64,
    pub month_1: f64,
    pub month_3: f64,
    pub month_6: f64,
    pub year_1: f64,
    pub year_2: f64,
    pub year_3: f64,
    pub ytd: f64,
    pub since_found: f64,
    pub found_date: String,
}

/// Fund money rank item.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct FundMoneyRankItem {
    pub rank: i32,
    pub fund_code: String,
    pub fund_name: String,
    pub date: String,
    pub yield_per_10k: f64,
    pub annualized_7d: f64,
    pub annualized_14d: f64,
    pub annualized_28d: f64,
    pub month_1: f64,
    pub month_3: f64,
    pub month_6: f64,
    pub year_1: f64,
    pub year_2: f64,
    pub year_3: f64,
    pub year_5: f64,
    pub ytd: f64,
    pub since_found: f64,
}

/// Fund HK rank item.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct FundHkRankItem {
    pub rank: i32,
    pub fund_code: String,
    pub fund_name: String,
    pub currency: String,
    pub date: String,
    pub nav: f64,
    pub change_pct: f64,
    pub week_1: f64,
    pub month_1: f64,
    pub month_3: f64,
    pub month_6: f64,
    pub year_1: f64,
    pub year_2: f64,
    pub year_3: f64,
    pub ytd: f64,
    pub since_found: f64,
    pub can_buy: String,
    pub hk_fund_code: String,
}

/// Xueqiu fund basic info item.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct XqBasicInfo {
    pub item: String,
    pub value: String,
}

/// Xueqiu fund achievement item.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct XqAchievementItem {
    pub achievement_type: String,
    pub period: String,
    pub return_pct: f64,
    pub max_drawdown: f64,
    pub rank: String,
}

/// Xueqiu fund analysis item.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct XqAnalysisItem {
    pub period: String,
    pub risk_return_ratio: f64,
    pub risk_control: f64,
    pub volatility: f64,
    pub sharpe: f64,
    pub max_drawdown: f64,
}

/// Xueqiu fund profit probability item.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct XqProfitProbabilityItem {
    pub holding_period: String,
    pub profit_ratio: f64,
    pub avg_return: f64,
}

/// Xueqiu fund detail hold item.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct XqDetailHoldItem {
    pub asset_type: String,
    pub percent: f64,
}

/// Fund value estimation item.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct FundValueEstimationItem {
    pub rank: i32,
    pub fund_code: String,
    pub fund_name: String,
    pub estimated_value: f64,
    pub estimated_change_pct: f64,
    pub published_nav: f64,
    pub published_change_pct: f64,
    pub deviation: f64,
    pub nav_date: String,
}