Skip to main content

Build the future of Consumer DeFi.
The safest, most composable language
for financial applications that reach millions.

Get started
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import "DeFiActions"
import "FlowTransactionScheduler"

// Schedule recurring yield compounding
transaction(stakingPid: UInt64, intervalDays: UInt64) {
    prepare(signer: auth(Storage) &Account) {
        // Compose DeFi actions atomically:
        // Claim rewards → Swap → Restake
        let rewardsSource = StakingConnectors.PoolRewardsSource(
            userCertificate: signer.capabilities
                .get<&StakingPool>(publicPath),
            pid: stakingPid
        )

        let swapper = SwapConnectors.TokenSwapper(
            source: rewardsSource,
            targetToken: "FLOW"
        )

        let stakeSink = StakingConnectors.PoolStakeSink(
            pool: stakingPool,
            source: swapper
        )

        // Schedule to run every N days
        let future = getCurrentBlock().timestamp
            + (intervalDays * 86400.0)

        FlowTransactionScheduler.schedule(
            action: stakeSink,
            timestamp: future,
            recurring: true
        )
    }
}

Cadence is powering the next generation of Consumer DeFi, bringing institutional-grade security and consumer-friendly experiences to financial applications that serve millions.

  • User assets stay in user accounts, delivering better-than-fintech security without centralized risk.
  • Atomic transactions create seamless, one-click experiences that feel native to everyday users.
  • Always-on automation runs 24/7/365, enabling recurring payments and strategies that work while you sleep.
  • Real-time settlement in seconds, not days, making DeFi faster than traditional financial rails.
  • Open and composable by design, enabling global financial apps that work together seamlessly.

Cadence pioneers resource-oriented programming—designed specifically to handle valuable digital assets. Unlike traditional smart contract languages where assets are piled in centralized contract storage, Cadence ensures user assets stay in their own accounts. The result is dramatically reduced attack surfaces and the elimination of entire classes of DeFi vulnerabilities.

With features like Flow Actions and Scheduled Transactions, developers can build sophisticated DeFi experiences that feel native to their users.

Ready to build the future of finance? Get started today.

Complex DeFi Operations, Simple User Experiences

In Cadence, transactions are first-class citizens. Write customized transactions that interact with multiple contracts atomically, either all succeed or all fail. No need for intermediary contracts or complex multi-call patterns.

Check staking positions, claim rewards, swap tokens, and restake all in one operation by writing a transaction.

Cadence scripts provide native data availability, querying on-chain data directly without external indexers. Build sophisticated analytics and experiences other chains cannot offer.

This flexibility makes Consumer DeFi possible. Complex operations feel simple while maintaining security and atomicity.

Built for DeFi Security

In DeFi, security isn't optional. The resource-oriented programming paradigm in Cadence fundamentally changes how assets are stored and protected. User assets stay in user accounts, not in contract storage.

Resources guarantee assets can only exist in one location, cannot be copied, and cannot be accidentally lost. Combined with a strong static type system, enforced business logic, and capability-based access control, Cadence eliminates entire classes of DeFi vulnerabilities including reentrancy attacks.

Build financial applications with confidence. Cadence provides safety guarantees that let you focus on creating value, not patching vulnerabilities.

Composable DeFi Primitives

Compose powerful primitives to build sophisticated financial products. Resources stored in users' accounts can flow freely between contracts, which allows seamless integration of lending, swapping, and yield strategies in a single user experience.

Flow Actions allow you to bundle complex multi-step DeFi operations into one-click experiences. Scheduled Transactions turn on native onchain automation. Recurring payments, DCA strategies, and portfolio rebalancing execute directly from user wallets, no backend servers required.

Interfaces and attachments make protocols truly composable. Build new DeFi functionality on top of any token standard to create composable building blocks that work together seamlessly.

Learn the Best Language for Consumer DeFi

Cadence is purpose-built for consumer DeFi applications. Its intuitive syntax and resource-oriented design make it the ideal language for building financial products that millions of users trust.

Learn a language designed from the ground up by smart contract developers for smart contract developers. With comprehensive documentation, powerful testing frameworks, and a supportive community, you'll be building production-ready consumer DeFi apps faster than with traditional smart contract languages.