diff options
Diffstat (limited to 'cmd/crypto.go')
| -rw-r--r-- | cmd/crypto.go | 461 |
1 files changed, 461 insertions, 0 deletions
diff --git a/cmd/crypto.go b/cmd/crypto.go new file mode 100644 index 0000000..02b39b1 --- /dev/null +++ b/cmd/crypto.go @@ -0,0 +1,461 @@ +package cmd + +import ( + "git.db.org.ai/dborg/internal/client" + "git.db.org.ai/dborg/internal/formatter" + "github.com/spf13/cobra" +) + +var cryptoCmd = &cobra.Command{ + Use: "crypto", + Short: "Crypto analysis commands", + Long: `Analyze cryptocurrency tokens, wallets, and trading activity`, +} + +var bundleDetectionCmd = &cobra.Command{ + Use: "bundle-detection [address]", + Short: "Detect bundled launches", + Long: `Analyzes whether a token contract was bundled during launch`, + Args: cobra.ExactArgs(1), + RunE: runBundleDetection, +} + +var crossTradersCmd = &cobra.Command{ + Use: "cross-traders [addresses]", + Short: "Find cross-token traders", + Long: `Filters common traders active across multiple token contracts (comma-separated addresses)`, + Args: cobra.ExactArgs(1), + RunE: runCrossTraders, +} + +var earlyAdoptersCmd = &cobra.Command{ + Use: "early-adopters [address]", + Short: "Analyze early adopters", + Long: `Analyzes early buyers and their trading activity for a token`, + Args: cobra.ExactArgs(1), + RunE: runEarlyAdopters, +} + +var floorHoldersCmd = &cobra.Command{ + Use: "floor-holders [address]", + Short: "Analyze floor price holders", + Long: `Analyzes top holders who bought at floor prices`, + Args: cobra.ExactArgs(1), + RunE: runFloorHolders, +} + +var freshAccountsCmd = &cobra.Command{ + Use: "fresh-accounts [address]", + Short: "Analyze fresh accounts", + Long: `Analyzes top holder fresh wallets to detect potential sybil attacks`, + Args: cobra.ExactArgs(1), + RunE: runFreshAccounts, +} + +var fundingSourceCmd = &cobra.Command{ + Use: "funding-source [address]", + Short: "Analyze funding source", + Long: `Determines how and when a wallet address was funded`, + Args: cobra.ExactArgs(1), + RunE: runFundingSource, +} + +var graduationStatsCmd = &cobra.Command{ + Use: "graduation-stats", + Short: "Get graduation statistics", + Long: `Retrieves statistics for recently graduated token launches`, + Args: cobra.NoArgs, + RunE: runGraduationStats, +} + +var launchParticipantsCmd = &cobra.Command{ + Use: "launch-participants [address]", + Short: "Get launch participants", + Long: `Retrieves list of early participants in token launch`, + Args: cobra.ExactArgs(1), + RunE: runLaunchParticipants, +} + +var liquidityCmd = &cobra.Command{ + Use: "liquidity [address]", + Short: "Check liquidity status", + Long: `Checks if liquidity has been added or updated on DEX for a token`, + Args: cobra.ExactArgs(1), + RunE: runLiquidity, +} + +var ownerIntelCmd = &cobra.Command{ + Use: "owner-intel [address]", + Short: "Get owner intelligence", + Long: `Retrieves detailed intelligence and analysis on token holders`, + Args: cobra.ExactArgs(1), + RunE: runOwnerIntel, +} + +var ownershipDistributionCmd = &cobra.Command{ + Use: "ownership-distribution [address]", + Short: "Analyze ownership distribution", + Long: `Visualizes token holder ownership distribution and concentration`, + Args: cobra.ExactArgs(1), + RunE: runOwnershipDistribution, +} + +var portfolioCmd = &cobra.Command{ + Use: "portfolio [address]", + Short: "Analyze portfolio", + Long: `Analyzes profit and loss for recently traded tokens in a wallet`, + Args: cobra.ExactArgs(1), + RunE: runPortfolio, +} + +var topOwnersCmd = &cobra.Command{ + Use: "top-owners [address]", + Short: "Analyze top owners", + Long: `Analyzes the top holders and their positions for a token`, + Args: cobra.ExactArgs(1), + RunE: runTopOwners, +} + +var whaleIntelCmd = &cobra.Command{ + Use: "whale-intel [address]", + Short: "Analyze whale holdings", + Long: `Analyzes net worth and positions of top 50 whale holders`, + Args: cobra.ExactArgs(1), + RunE: runWhaleIntel, +} + +func init() { + rootCmd.AddCommand(cryptoCmd) + + cryptoCmd.AddCommand(bundleDetectionCmd) + cryptoCmd.AddCommand(crossTradersCmd) + cryptoCmd.AddCommand(earlyAdoptersCmd) + cryptoCmd.AddCommand(floorHoldersCmd) + cryptoCmd.AddCommand(freshAccountsCmd) + cryptoCmd.AddCommand(fundingSourceCmd) + cryptoCmd.AddCommand(graduationStatsCmd) + cryptoCmd.AddCommand(launchParticipantsCmd) + cryptoCmd.AddCommand(liquidityCmd) + cryptoCmd.AddCommand(ownerIntelCmd) + cryptoCmd.AddCommand(ownershipDistributionCmd) + cryptoCmd.AddCommand(portfolioCmd) + cryptoCmd.AddCommand(topOwnersCmd) + cryptoCmd.AddCommand(whaleIntelCmd) +} + +func runBundleDetection(cmd *cobra.Command, args []string) error { + address := args[0] + if err := client.ValidateCryptoAddress(address); err != nil { + return err + } + + c, err := newClient() + if err != nil { + return err + } + + response, err := c.GetBundleDetection(address) + if err != nil { + return err + } + + if err := checkError(response.Error); err != nil { + return err + } + + return formatter.FormatCryptoResults(response, IsJSONOutput()) +} + +func runCrossTraders(cmd *cobra.Command, args []string) error { + addresses := args[0] + if err := client.ValidateCryptoAddresses(addresses); err != nil { + return err + } + + c, err := newClient() + if err != nil { + return err + } + + response, err := c.GetCrossTraders(addresses) + if err != nil { + return err + } + + if err := checkError(response.Error); err != nil { + return err + } + + return formatter.FormatCryptoResults(response, IsJSONOutput()) +} + +func runEarlyAdopters(cmd *cobra.Command, args []string) error { + address := args[0] + if err := client.ValidateCryptoAddress(address); err != nil { + return err + } + + c, err := newClient() + if err != nil { + return err + } + + response, err := c.GetEarlyAdopters(address) + if err != nil { + return err + } + + if err := checkError(response.Error); err != nil { + return err + } + + return formatter.FormatCryptoResults(response, IsJSONOutput()) +} + +func runFloorHolders(cmd *cobra.Command, args []string) error { + address := args[0] + if err := client.ValidateCryptoAddress(address); err != nil { + return err + } + + c, err := newClient() + if err != nil { + return err + } + + response, err := c.GetFloorHolders(address) + if err != nil { + return err + } + + if err := checkError(response.Error); err != nil { + return err + } + + return formatter.FormatCryptoResults(response, IsJSONOutput()) +} + +func runFreshAccounts(cmd *cobra.Command, args []string) error { + address := args[0] + if err := client.ValidateCryptoAddress(address); err != nil { + return err + } + + c, err := newClient() + if err != nil { + return err + } + + response, err := c.GetFreshAccounts(address) + if err != nil { + return err + } + + if err := checkError(response.Error); err != nil { + return err + } + + return formatter.FormatCryptoResults(response, IsJSONOutput()) +} + +func runFundingSource(cmd *cobra.Command, args []string) error { + address := args[0] + if err := client.ValidateCryptoAddress(address); err != nil { + return err + } + + c, err := newClient() + if err != nil { + return err + } + + response, err := c.GetFundingSource(address) + if err != nil { + return err + } + + if err := checkError(response.Error); err != nil { + return err + } + + return formatter.FormatCryptoResults(response, IsJSONOutput()) +} + +func runGraduationStats(cmd *cobra.Command, args []string) error { + c, err := newClient() + if err != nil { + return err + } + + response, err := c.GetGraduationStats() + if err != nil { + return err + } + + if err := checkError(response.Error); err != nil { + return err + } + + return formatter.FormatCryptoResults(response, IsJSONOutput()) +} + +func runLaunchParticipants(cmd *cobra.Command, args []string) error { + address := args[0] + if err := client.ValidateCryptoAddress(address); err != nil { + return err + } + + c, err := newClient() + if err != nil { + return err + } + + response, err := c.GetLaunchParticipants(address) + if err != nil { + return err + } + + if err := checkError(response.Error); err != nil { + return err + } + + return formatter.FormatCryptoResults(response, IsJSONOutput()) +} + +func runLiquidity(cmd *cobra.Command, args []string) error { + address := args[0] + if err := client.ValidateCryptoAddress(address); err != nil { + return err + } + + c, err := newClient() + if err != nil { + return err + } + + response, err := c.GetLiquidity(address) + if err != nil { + return err + } + + if err := checkError(response.Error); err != nil { + return err + } + + return formatter.FormatCryptoResults(response, IsJSONOutput()) +} + +func runOwnerIntel(cmd *cobra.Command, args []string) error { + address := args[0] + if err := client.ValidateCryptoAddress(address); err != nil { + return err + } + + c, err := newClient() + if err != nil { + return err + } + + response, err := c.GetOwnerIntel(address) + if err != nil { + return err + } + + if err := checkError(response.Error); err != nil { + return err + } + + return formatter.FormatCryptoResults(response, IsJSONOutput()) +} + +func runOwnershipDistribution(cmd *cobra.Command, args []string) error { + address := args[0] + if err := client.ValidateCryptoAddress(address); err != nil { + return err + } + + c, err := newClient() + if err != nil { + return err + } + + response, err := c.GetOwnershipDistribution(address) + if err != nil { + return err + } + + if err := checkError(response.Error); err != nil { + return err + } + + return formatter.FormatCryptoResults(response, IsJSONOutput()) +} + +func runPortfolio(cmd *cobra.Command, args []string) error { + address := args[0] + if err := client.ValidateCryptoAddress(address); err != nil { + return err + } + + c, err := newClient() + if err != nil { + return err + } + + response, err := c.GetPortfolio(address) + if err != nil { + return err + } + + if err := checkError(response.Error); err != nil { + return err + } + + return formatter.FormatCryptoResults(response, IsJSONOutput()) +} + +func runTopOwners(cmd *cobra.Command, args []string) error { + address := args[0] + if err := client.ValidateCryptoAddress(address); err != nil { + return err + } + + c, err := newClient() + if err != nil { + return err + } + + response, err := c.GetTopOwners(address) + if err != nil { + return err + } + + if err := checkError(response.Error); err != nil { + return err + } + + return formatter.FormatCryptoResults(response, IsJSONOutput()) +} + +func runWhaleIntel(cmd *cobra.Command, args []string) error { + address := args[0] + if err := client.ValidateCryptoAddress(address); err != nil { + return err + } + + c, err := newClient() + if err != nil { + return err + } + + response, err := c.GetWhaleIntel(address) + if err != nil { + return err + } + + if err := checkError(response.Error); err != nil { + return err + } + + return formatter.FormatCryptoResults(response, IsJSONOutput()) +} |
