diff --git a/cmd/agent_info.go b/cmd/agent_info.go index 5cf2db6..61f1023 100644 --- a/cmd/agent_info.go +++ b/cmd/agent_info.go @@ -196,7 +196,7 @@ func econInfo(ctx context.Context, agent common.Address, afi *econ.AgentFi, s *s printTable([]string{ "Liquidation value", "Total debt", - "Debt to liquidation value % (DTL)", + "Debt-to-liquidation ratio (DTL)", }, []string{ fmt.Sprintf("%0.09f FIL", util.ToFIL(afi.LiquidationValue())), fmt.Sprintf("%0.09f FIL", util.ToFIL(afi.Debt())), @@ -206,12 +206,10 @@ func econInfo(ctx context.Context, agent common.Address, afi *econ.AgentFi, s *s printTable([]string{ "Max borrow to seal", "Max borrow to withdraw", - "Current borrow limit", - "Current withdraw limit", + "Available to withdraw", }, []string{ fmt.Sprintf("%0.09f FIL", util.ToFIL(afi.MaxBorrowAndSeal())), fmt.Sprintf("%0.09f FIL", util.ToFIL(afi.MaxBorrowAndWithdraw())), - fmt.Sprintf("%0.09f FIL", util.ToFIL(afi.BorrowLimit())), fmt.Sprintf("%0.09f FIL", util.ToFIL(afi.WithdrawLimit())), }) diff --git a/cmd/root.go b/cmd/root.go index 2ea6def..c3185fb 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -173,12 +173,13 @@ func initConfig() { daemonURL := viper.GetString("daemon.rpc-url") daemonToken := viper.GetString("daemon.token") adoURL := viper.GetString("ado.address") + eventsURL := viper.GetString("routes.events-url") override := viper.GetBool("routes.override") if override || chainID == constants.LocalnetChainID || chainID == constants.AnvilChainID { routerAddr := viper.GetString("routes.router") router := common.HexToAddress(routerAddr) - err := sdk.LazyInit(context.Background(), &PoolsSDK, router, adoURL, "ADO", daemonURL, daemonToken) + err := sdk.LazyInit(context.Background(), &PoolsSDK, router, adoURL, "ADO", daemonURL, daemonToken, eventsURL) if err != nil { logFatal(err) } @@ -199,7 +200,9 @@ func initConfig() { if daemonToken != "" { extern.LotusToken = daemonToken } - + if eventsURL != "" { + extern.EventsURL = eventsURL + } if adoURL != "" { extern.AdoAddr = adoURL } diff --git a/go.mod b/go.mod index ad7d601..16d52ad 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/filecoin-project/go-address v1.1.0 github.com/filecoin-project/go-state-types v0.14.0 github.com/filecoin-project/lotus v1.28.1 - github.com/glifio/go-pools v1.1.0 + github.com/glifio/go-pools v1.1.1 github.com/glifio/go-wallet-utils v0.0.0-20230719050429-ff6c4bc75533 github.com/golang/mock v1.6.0 github.com/ipfs/go-cid v0.4.1 diff --git a/go.sum b/go.sum index eb8602d..a057f27 100644 --- a/go.sum +++ b/go.sum @@ -235,6 +235,8 @@ github.com/getsentry/sentry-go v0.18.0 h1:MtBW5H9QgdcJabtZcuJG80BMOwaBpkRDZkxRkN github.com/getsentry/sentry-go v0.18.0/go.mod h1:Kgon4Mby+FJ7ZWHFUAZgVaIa8sxHtnRJRLTXZr51aKQ= github.com/glifio/go-pools v1.1.0 h1:7tcKe3Ro8nsAzcN516eKbwuKgyrFK57UwElZ8zZ+7F4= github.com/glifio/go-pools v1.1.0/go.mod h1:G+JltF4457QvLCk8cIMLTHl6L7HgB515Bv8IRgFJJx8= +github.com/glifio/go-pools v1.1.1 h1:mcsc/jegFZgAoSzobN02hivAVIVSJSS96iekOqL98uI= +github.com/glifio/go-pools v1.1.1/go.mod h1:G+JltF4457QvLCk8cIMLTHl6L7HgB515Bv8IRgFJJx8= github.com/glifio/go-wallet-utils v0.0.0-20230719050429-ff6c4bc75533 h1:teuqQtVb7YMyqIOg+xUNO21qZAnm8ibhpKy4lIUBpag= github.com/glifio/go-wallet-utils v0.0.0-20230719050429-ff6c4bc75533/go.mod h1:zJ9ksxDWIsuS80RtpjaM6swuKZ7OYdJH56I00EZRxD4= github.com/go-check/check v0.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98=