Skip to content

Commit

Permalink
feat: continue refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Majorfi committed Oct 20, 2023
1 parent 436695a commit 95693b5
Show file tree
Hide file tree
Showing 56 changed files with 24,476 additions and 28,401 deletions.
1 change: 0 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ RPC_URI_FOR_42161=
# Optional
WEBHOOK_SECRET=
GRAPH_API_URI=
API_V1_BASE_URL=
SENTRY_DSN=
SENTRY_SAMPLE_RATE=
LOG_LEVEL= # DEBUG, INFO, WARNING, SUCCESS, ERROR
4 changes: 1 addition & 3 deletions cmd/daemons.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"github.com/yearn/ydaemon/common/env"
"github.com/yearn/ydaemon/common/logs"
"github.com/yearn/ydaemon/external/partners"
"github.com/yearn/ydaemon/external/vaults"
"github.com/yearn/ydaemon/internal/meta"
"github.com/yearn/ydaemon/internal/risk"
)
Expand Down Expand Up @@ -39,12 +38,11 @@ func SummonDaemons(chainID uint64) {

// This first work group does not need any other data to be able to work.
// They can all be summoned at the same time, with no dependencies.
wg.Add(4)
wg.Add(3)
{
go runDaemon(chainID, &wg, 0, meta.RetrieveAllProtocolsFromFiles)
go runDaemon(chainID, &wg, 0, partners.FetchPartnersFromFiles)
go runDaemon(chainID, &wg, 0, risk.RetrieveAllRisksGroupsFromFiles)
go runDaemon(chainID, &wg, 10*time.Minute, vaults.FetchVaultsFromV1)
}
wg.Wait()
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

"github.com/yearn/ydaemon/common/logs"
"github.com/yearn/ydaemon/internal"
"github.com/yearn/ydaemon/processes/apy"
"github.com/yearn/ydaemon/processes/apr"
"github.com/yearn/ydaemon/processes/initDailyBlock"
"github.com/yearn/ydaemon/processes/tokenList"
"github.com/yearn/ydaemon/processes/vaultsMigrations"
Expand Down Expand Up @@ -86,7 +86,7 @@ func main() {
for _, chainID := range chains {
wg.Add(1)
go func(chainID uint64) {
apy.Run(chainID)
apr.Run(chainID)
wg.Done()
}(chainID)
}
Expand Down
5 changes: 5 additions & 0 deletions common/bigNumber/float.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,11 @@ func (b *Float) Pow(x *Float, y uint64) *Float {
return result
}

func (b *Float) SetMode(mode big.RoundingMode) *Float {
b.Float.SetMode(mode)
return b
}

/**************************************************************************************************
** Helpers functions that can be used to convert back a bigNumber.Float to a string or a BigInt.
**************************************************************************************************/
Expand Down
14 changes: 7 additions & 7 deletions common/contracts/yVault.3.0.0.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions common/env/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,3 @@ var GECKO_PRICE_URL = `https://api.coingecko.com/api/v3/simple/token_price/`

// LLAMA_PRICE_URL contains the URL for the DeFiLlama pricing API
var LLAMA_PRICE_URL = `https://coins.llama.fi/prices/current/`

// API_V1_BASE_URL is the base URL to access query the legacy Yearn's api
var API_V1_BASE_URL = `https://api.yexporter.io/v1/chains/`
7 changes: 0 additions & 7 deletions common/env/environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,6 @@ func SetEnv(path string) {
chain.RpcURI = RPCURIFor42161
CHAINS[42161] = chain
}

ApiV1BaseUrl, exists := os.LookupEnv("API_V1_BASE_URL")
if !exists {
logs.Warning("API_V1_BASE_URL not set, using default value: [https://api.yearn.fi/v1/chains/]")
} else {
API_V1_BASE_URL = ApiV1BaseUrl
}
}

func init() {
Expand Down
Loading

0 comments on commit 95693b5

Please sign in to comment.