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.

Introduced in 2020, Cadence pioneered resource-oriented programming—a paradigm designed specifically for handling valuable digital assets. Unlike traditional smart contract languages where assets live in centralized contract storage, Cadence ensures user assets stay in their own accounts, dramatically reducing attack surfaces and eliminating 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.

Built for DeFi Security

In DeFi, security isn't optional. Cadence's resource-oriented programming paradigm fundamentally changes how assets are stored and protected.

User assets stay in user accounts, not in contract storage. This architectural decision dramatically reduces attack surfaces. Unlike Solidity where exploits can drain entire protocols in one transaction, Cadence's model makes attacks exponentially harder. Attackers must target individual accounts one at a time, with no easy list of vulnerable targets.

Resources guarantee that assets can only exist in one location at a time, cannot be copied, and cannot be accidentally lost or deleted. Combined with a strong static type system, design by contract, and capability-based access control, Cadence eliminates entire classes of DeFi vulnerabilities including reentrancy attacks.

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

Composable DeFi Primitives

Build sophisticated financial products by composing powerful primitives. Resources stored in users' accounts can flow freely between contracts, enabling seamless integration of lending, staking, 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 enable native on-chain automation. Recurring payments, DCA strategies, and portfolio rebalancing execute directly from user wallets, no backend servers required.

Interfaces and attachments make protocols truly composable. Extend existing assets with new DeFi functionality without requiring permission from the original creators.

Built for Scale: Fast, Cheap, and Ready for Millions

Consumer DeFi needs infrastructure that can handle millions of users without breaking the bank. Cadence delivers on both fronts with near instant transaction finality and costs measured in fractions of a cents, not dollars.

The development time has been reduced from months to days, enabling rapid iteration and faster time-to-market for DeFi products. Ship faster, test in production with confidence, and capture market opportunities before your competitors.

Complex DeFi Operations, Simple User Experiences

Cadence transactions can perform multiple operations atomically—all succeed or all fail. This enables sophisticated DeFi workflows to feel as simple as a single click for users, while maintaining security and composability.

Deploy capital across multiple yield strategies in one transaction. Swap, stake, and deposit into a lending pool—all atomic, all secure. Approve a token spend limit and execute the trade simultaneously, eliminating the frustrating multi-step approval flows that plague other chains.

This transactional power is what makes Consumer DeFi possible. Complex financial operations that just work, every time.