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.

Cadence pioneers resource-oriented programming—a paradigm designed specifically for handling 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 detailed, customized transactions that interact with multiple contracts atomically, either all succeed or all fail. No need to deploy intermediary contracts or build complex multi-call patterns.

Want to check a user's staking position across three protocols, claim rewards from two pools, swap tokens, and restake—all in one operation? Write it as a transaction. This level of composability and customization simply isn't possible on other platforms where you're limited to pre-deployed contract functions.

Cadence scripts provide native data availability—query any on chain data directly from state without external indexers or APIs. Build sophisticated analytics and user experiences that other chains cannot offer.

This transactional flexibility is what makes Consumer DeFi possible. Complex financial operations that feel simple, all 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. This architectural decision dramatically reduces attack surfaces. Unlike Solidity where exploits can drain entire protocols in one transaction, the Cadence 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, 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

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. Build new DeFi functionality on top of any token standard, creating composable building blocks that work together seamlessly.

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

Cadence is designed for speed. Intuitive syntax, comprehensive testing frameworks, and powerful abstractions mean you spend less time debugging and more time building. Development cycles that took months in Solidity take days in Cadence.

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.