Documentation
¶
Overview ¶
Copyright 2024 SPDX-License-Identifier: Apache-2.0
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2024 SPDX-License-Identifier: Apache-2.0
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2024 SPDX-License-Identifier: Apache-2.0
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Constants
- func Enrich(assets ...*data.Asset)
- func FormatSyntheticFIGI(ticker, name string) string
- func GenerateSyntheticFIGI(ticker, name string) string
- func IsSyntheticFIGI(figi string) bool
- func LoadCacheFromDB(ctx context.Context, dbConn *pgxpool.Conn)
- func LookupFigi(assets []*data.Asset, rateLimiter *rate.Limiter) map[string]*OpenFigiAsset
- func LookupFigiUnlisted(assets []*data.Asset, rateLimiter *rate.Limiter) map[string]*OpenFigiAsset
- func MapInstance() *haxmap.Map[string, string]
- func RateLimit() *rate.Limiter
- func ValidateFIGICheckDigit(figi string) bool
- type MappingResponse
- type OpenFigiAsset
- type OpenFigiQuery
Constants ¶
const (
OPENFIGI_MAPPING_URL string = "https://api.openfigi.com/v3/mapping"
)
Variables ¶
This section is empty.
Functions ¶
func FormatSyntheticFIGI ¶
FormatSyntheticFIGI is a convenience that generates a synthetic FIGI and returns it as a formatted string for logging/debugging.
func GenerateSyntheticFIGI ¶
GenerateSyntheticFIGI generates a deterministic FIGI-format identifier for a given ticker and name. The identifier uses the "PV" issuer prefix to distinguish it from real OpenFIGI-assigned identifiers.
Format: PVG{8 alphanumeric chars}{check digit}
The 8 body characters are derived from a SHA-256 hash of "ticker|name" mapped onto the valid FIGI alphabet.
func IsSyntheticFIGI ¶
IsSyntheticFIGI returns true if the given FIGI was generated by GenerateSyntheticFIGI (i.e., has the "PVG" prefix).
func LookupFigi ¶
func LookupFigiUnlisted ¶
func ValidateFIGICheckDigit ¶
ValidateFIGICheckDigit validates whether the 12th character of a FIGI identifier is the correct check digit per the modified Luhn algorithm.
Types ¶
type MappingResponse ¶
type MappingResponse struct {
Data []*OpenFigiAsset `json:"data"`
}
type OpenFigiAsset ¶
type OpenFigiAsset struct {
Figi string `json:"figi"`
SecurityType string `json:"securityType"`
MarketSector string `json:"marketSector"`
Ticker string `json:"ticker"`
Name string `json:"name"`
ExchangeCode string `json:"exchCode"`
CompositeFIGI string `json:"compositeFIGI"`
SecurityType2 string `json:"securityType2"`
SecurityDescription string `json:"securityDescription"`
}