Stats
Actions
Tags
From nation-of-elites
Cryptocurrency trading, DeFi protocols, smart contract interaction, blockchain integration, and crypto API development
How this skill is triggered — by the user, by Claude, or both
Slash command
/nation-of-elites:crypto-defi-patternsThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
- Building cryptocurrency trading systems
crypto-api-developer - Primary userbackend-developer - Crypto backend systemsfinancial-systems-expert - Crypto tradingimport { ethers } from 'ethers'
class Web3Service {
private provider: ethers.providers.Provider
private signer: ethers.Signer
constructor(rpcUrl: string, privateKey: string) {
this.provider = new ethers.providers.JsonRpcProvider(rpcUrl)
this.signer = new ethers.Wallet(privateKey, this.provider)
}
async getBalance(address: string): Promise<string> {
const balance = await this.provider.getBalance(address)
return ethers.utils.formatEther(balance)
}
async sendTransaction(to: string, amount: string) {
const tx = await this.signer.sendTransaction({
to,
value: ethers.utils.parseEther(amount)
})
const receipt = await tx.wait()
return receipt
}
}
interface IUniswapV2Router {
swapExactTokensForTokens(
amountIn: BigNumber,
amountOutMin: BigNumber,
path: string[],
to: string,
deadline: number
): Promise<ContractTransaction>
}
class DeFiService {
private router: IUniswapV2Router
constructor(routerAddress: string, signer: Signer) {
this.router = new ethers.Contract(
routerAddress,
UNISWAP_ROUTER_ABI,
signer
) as IUniswapV2Router
}
async swapTokens(
tokenIn: string,
tokenOut: string,
amountIn: string,
slippage: number = 0.5
) {
const path = [tokenIn, tokenOut]
const amountInWei = ethers.utils.parseEther(amountIn)
// Calculate minimum output with slippage
const amountOut = await this.getAmountOut(amountInWei, path)
const amountOutMin = amountOut.mul(100 - slippage).div(100)
const deadline = Math.floor(Date.now() / 1000) + 60 * 20 // 20 minutes
const tx = await this.router.swapExactTokensForTokens(
amountInWei,
amountOutMin,
path,
await this.signer.getAddress(),
deadline
)
return await tx.wait()
}
}
import { HDNode } from 'ethers/lib/utils'
class WalletService {
generateMnemonic(): string {
return ethers.Wallet.createRandom().mnemonic.phrase
}
deriveWallet(mnemonic: string, index: number = 0): ethers.Wallet {
const path = `m/44'/60'/0'/0/${index}` // BIP44 Ethereum path
return ethers.Wallet.fromMnemonic(mnemonic, path)
}
async signMessage(wallet: ethers.Wallet, message: string): Promise<string> {
return await wallet.signMessage(message)
}
}
import ccxt from 'ccxt'
class ExchangeService {
private exchange: ccxt.Exchange
constructor(exchangeName: string, apiKey: string, secret: string) {
const ExchangeClass = ccxt[exchangeName]
this.exchange = new ExchangeClass({
apiKey,
secret,
})
}
async fetchBalance() {
return await this.exchange.fetchBalance()
}
async placeOrder(
symbol: string,
type: 'market' | 'limit',
side: 'buy' | 'sell',
amount: number,
price?: number
) {
return await this.exchange.createOrder(symbol, type, side, amount, price)
}
async fetchOrderBook(symbol: string, limit: number = 20) {
return await this.exchange.fetchOrderBook(symbol, limit)
}
}
npx claudepluginhub advisely/claude-code-agents-team-nation-of-elites --plugin nation-of-elitesGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.