feat: 接入 CoinGlass 清算热力图隔离链路
Some checks failed
ci / build + vet + guard + race (push) Has been cancelled

This commit is contained in:
dela
2026-05-25 16:57:22 +08:00
parent e5fb54cb72
commit 1b61541ff5
32 changed files with 2550 additions and 70 deletions

View File

@@ -0,0 +1,54 @@
package entity
import "encoding/json"
// CGLiqHeatMap — /api/index/v2/liqHeatMap 一帧。
// RawGrid 承载 CoinGlass 原始 2D 网格spec §5.1JSONB 仅供应商原始网格 / 元信息,
// usecase 层禁止直接解析任意 JSON 结构,需要稳定字段时由 mapper 展开成 entity 字段)。
type CGLiqHeatMap struct {
Symbol string `json:"symbol"`
Interval string `json:"interval"`
Timestamp int64 `json:"timestamp"`
PriceMin string `json:"priceMin"`
PriceMax string `json:"priceMax"`
RawGrid json.RawMessage `json:"rawGrid"`
}
type CGOpenInterestChart struct {
Symbol string `json:"symbol"`
Interval string `json:"interval"`
Timestamp int64 `json:"timestamp"`
Exchanges []CGExchangeOIPoint `json:"exchanges"`
}
type CGExchangeOIPoint struct {
Exchange string `json:"exchange"`
OI string `json:"oi"`
}
type CGLongShortRate struct {
Symbol string `json:"symbol"`
Interval string `json:"interval"`
Timestamp int64 `json:"timestamp"`
Exchanges []CGExchangeLongShortPoint `json:"exchanges"`
}
type CGExchangeLongShortPoint struct {
Exchange string `json:"exchange"`
LongRate string `json:"longRate"`
ShortRate string `json:"shortRate"`
Ratio string `json:"ratio"`
}
type CGFundingHome struct {
Timestamp int64 `json:"timestamp"`
Items []CGFundingHomeItem `json:"items"`
}
type CGFundingHomeItem struct {
Symbol string `json:"symbol"`
Exchange string `json:"exchange"`
FundingRate string `json:"fundingRate"`
NextFundingTs int64 `json:"nextFundingTs"`
Interval string `json:"interval"`
}