Skip to content

Commit

Permalink
fix: prices
Browse files Browse the repository at this point in the history
  • Loading branch information
Majorfi committed Jun 19, 2023
1 parent 9afa4a2 commit eea4845
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion internal/prices/accessor.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func MapPrices(chainID uint64) map[common.Address]*bigNumber.Int {
**********************************************************************************************/
func FindPrice(chainID uint64, tokenAddress common.Address) (*bigNumber.Int, bool) {
syncMap := initOrGetPriceMap(chainID)
price, ok := syncMap.Load(tokenAddress)
price, ok := syncMap.Load(tokenAddress.Hex())
if !ok {
return nil, false
}
Expand Down
2 changes: 1 addition & 1 deletion internal/strategies/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func BuildRiskScore(t *models.TStrategy) *models.TStrategyFromRisk {
_tokenPrice, ok := prices.FindPrice(t.ChainID, tokenData.Address)
if !ok {
traces.
Capture(`warn`, `impossible to find tokenPrice for token `+tokenData.Address.Hex()).
Capture(`warn`, `impossible to find tokenPrice for token `+tokenData.Address.Hex()+` on chain `+strconv.FormatUint(t.ChainID, 10)).
SetEntity(`strategy`).
SetTag(`chainID`, strconv.FormatUint(t.ChainID, 10)).
SetTag(`rpcURI`, ethereum.GetRPCURI(t.ChainID)).
Expand Down
2 changes: 1 addition & 1 deletion internal/strategies/risk.framework.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ func computeRiskGroupAllocation(chainID uint64) {
tokenPrice, ok := prices.FindPrice(chainID, tokenData.Address)
if !ok {
traces.
Capture(`warn`, `impossible to find tokenPrice for token `+tokenData.Address.Hex()).
Capture(`warn`, `impossible to find tokenPrice for token `+tokenData.Address.Hex()+` on chain `+strconv.FormatUint(chainID, 10)).
SetEntity(`strategy`).
SetTag(`chainID`, strconv.FormatUint(chainID, 10)).
SetTag(`rpcURI`, ethereum.GetRPCURI(chainID)).
Expand Down

1 comment on commit eea4845

@vercel
Copy link

@vercel vercel bot commented on eea4845 Jun 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

ydaemon – ./docs

ydaemon-git-main.yearn.farm
ydaemon.yearn.farm

Please sign in to comment.