1---
2name: chainlink
3description: Assist with Chainlink LINK tokens, oracle integrations, staking, and price feed usage.
4metadata:
5 source: https://skillmd.com/skills/modbender/chainlink
6 clawdbot:
7 emoji: ⬡
8 os:
9 - linux
10 - darwin
11 - win32
12---
13
14## LINK Token Basics
15- LINK is an ERC-20 token on Ethereum — standard wallet and exchange support
16- Also available on multiple chains — Arbitrum, Optimism, Polygon, Avalanche, BSC
17- Bridging LINK between chains uses official Chainlink bridge — verify bridge address before using
18- Different chains have different LINK contract addresses — verify correct address per network
19
20## Token Transfers
21- Standard ERC-20 transfer rules apply — gas paid in native token (ETH, MATIC, etc.)
22- Some DeFi protocols accept LINK as collateral — Aave, Compound
23- LINK has no special transfer restrictions — no tax tokens, no rebasing
24- Decimals: 18 — same as ETH, standard precision
25
26## Staking (v0.2)
27- Community staking allows LINK holders to stake — earn rewards for securing network
28- Staking has capacity limits — pool may be full, waitlist exists
29- Unbonding period applies — can't withdraw instantly after unstaking
30- Rewards in LINK — automatically added to staked balance
31- Slashing risk exists — node operators can lose stake for misbehavior
32
33## Price Feeds (For Developers)
34- Chainlink price feeds are the standard for DeFi — Aave, Synthetix, and most protocols use them
35- Feed addresses differ per network and pair — always verify on docs.chain.link
36- Feeds update based on deviation threshold and heartbeat — not every block
37- Check `latestRoundData()` not just `latestAnswer()` — includes timestamp and round info
38- Stale data check critical — verify `updatedAt` timestamp is recent
39
40## Oracle Integration Patterns
41- Direct consumer: your contract calls feed directly — simplest approach
42- Chainlink Automation (Keepers): trigger actions based on conditions — no server needed
43- VRF (Verifiable Random Function): provably fair randomness — for NFT mints, games, lotteries
44- Functions: connect to any API — custom off-chain computation
45- CCIP: cross-chain messaging — official Chainlink interoperability protocol
46
47## VRF Usage
48- Request/receive pattern: request randomness, receive in callback — not synchronous
49- Each request costs LINK — fund subscription or pay per request
50- Confirmation blocks add security but delay — more confirmations = more secure
51- Randomness is verifiable on-chain — anyone can verify it wasn't manipulated
52
53## Common Developer Mistakes
54- Hardcoding feed addresses — use address registry or config
55- Not checking for stale data — price feeds can stop updating
56- Assuming instant updates — deviation thresholds mean prices can be slightly stale
57- Not handling VRF callback failures — callback can revert, losing the randomness
58- Insufficient LINK for subscriptions — requests fail silently when underfunded
59
60## Network Comparisons
61- Ethereum mainnet: highest security, highest gas costs
62- L2s (Arbitrum, Optimism): lower cost, same security model
63- Alt-L1s (Polygon, Avalanche): native integration, different trust assumptions
64- Testnets: Sepolia for Ethereum, network-specific for others
65
66## Security Considerations
67- Only use official Chainlink feeds — verify contract addresses on docs.chain.link
68- Monitor for feed deprecation — Chainlink announces deprecated feeds
69- Multi-oracle pattern for critical systems — don't rely on single source
70- Circuit breakers for extreme price movements — protect against oracle manipulation
71
72## CCIP (Cross-Chain)
73- Send messages and tokens across chains — official Chainlink bridge
74- Lane availability varies — not all chain pairs supported
75- Fee estimation before sending — paid in LINK or native token
76- Message finality depends on source and destination chains
77
78## Ecosystem
79- Node operators earn LINK for providing data — professional infrastructure required
80- BUILD program for projects integrating Chainlink — access to resources and support
81- Extensive documentation at docs.chain.link — primary reference for developers
82- Community resources: Discord, Stack Overflow, GitHub