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