From b281e17f1a46d8e79754a32f494731cb85412853 Mon Sep 17 00:00:00 2001 From: Felipe Cevallos Date: Thu, 6 Nov 2025 14:43:51 -0600 Subject: [PATCH 1/9] Refocus homepage messaging on Consumer DeFi positioning Update homepage to emphasize Cadence as the premier language for building Consumer DeFi applications. Changes include: - Update hero section and tagline to focus on Consumer DeFi - Replace NFT code example with DeFi Vault resource demonstrating financial primitives - Reframe intro text to highlight resource-oriented security model and user asset protection - Emphasize DeFi-specific security benefits and attack surface reduction - Add Flow Actions and Scheduled Transactions as key differentiators - Highlight infrastructure scalability, low costs, and fast development cycles - Focus feature sections on DeFi use cases: composability, atomic transactions, and consumer scale - Update meta description and site tagline - Add strategic links to developer resources The new positioning targets DeFi developers building financial applications for mainstream audiences. --- docusaurus.config.js | 2 +- src/pages/index.js | 135 +++++++++++++++++++------------------------ 2 files changed, 60 insertions(+), 77 deletions(-) diff --git a/docusaurus.config.js b/docusaurus.config.js index 8cc1219e..88114c9f 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -13,7 +13,7 @@ const hasTypesense = /** @type {import('@docusaurus/types').Config} */ const config = { title: "Cadence", - tagline: "The Best Programming Language for Smart Contracts", + tagline: "The Best Programming Language for Consumer DeFi", favicon: "favicon.ico", // Set the production url of your site here diff --git a/src/pages/index.js b/src/pages/index.js index f422f142..0eef8a05 100644 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -20,21 +20,25 @@ import styles from './index.module.css'; import Logo from '@site/static/img/logo.svg'; const example = `access(all) -resource NFT { +resource Vault { + access(all) + var balance: UFix64 + + init(balance: UFix64) { + self.balance = balance + } access(all) - fun greet(): String { - return "I'm NFT #" - .concat(self.uuid.toString()) + fun withdraw(amount: UFix64): @Vault { + self.balance = self.balance - amount + return <- create Vault(balance: amount) } -} -access(all) -fun main(): String { - let nft <- create NFT() - let greeting = nft.greet() - destroy nft - return greeting + access(all) + fun deposit(from: @Vault) { + self.balance = self.balance + from.balance + destroy from + } }` function cadence(Prism) { @@ -44,7 +48,7 @@ function cadence(Prism) { greedy: true }, keyword: - /\b(?:access|all|fun|resource|create|let|destroy|return|self)\b/, + /\b(?:access|all|fun|resource|create|let|destroy|return|self|var|init|from)\b/, 'class-name': /\b[A-Z][A-Za-z_\d]*\b/, function: /\b[a-z_]\w*(?=\s*\()/i, } @@ -73,8 +77,8 @@ export default function Home() { const {siteConfig} = useDocusaurusContext(); return ( + title={`${siteConfig.title} - Build the Future of Consumer DeFi`} + description="Cadence is the safest, most composable language for building DeFi applications that reach millions.">
@@ -85,11 +89,11 @@ export default function Home() {

- Forge the future of decentralized apps. + Build the future of Consumer DeFi.
- Unleash utility, composability, + The safest, most composable language
- and safety in smart contracts. + for financial applications that reach millions.

@@ -109,28 +113,28 @@ export default function Home() {

- Together, we are working to build a programming language to empower everyone to push the boundaries of smart contracts and on-chain logic. + Cadence is powering the next generation of Consumer DeFi, bringing institutional-grade security and consumer-friendly experiences to financial applications that serve millions.

-

- Announced in 2020, the Cadence programming language introduced a new paradigm of resource-oriented programming. - By leveraging the power of resources, Cadence brings exciting new ideas to the world of smart contracts. - Cadence makes it easy to write maximally on-chain smart contracts that are secure by design. - Our goals for Cadence are to enable ambitious developers to make daring & complex ideas possible while making them easy, - fun & developer-friendly, as well as safe and secure. + 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.

- Join us in shaping the future of blockchain, one line of code at a time. Get started today! + 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.

@@ -141,21 +145,21 @@ export default function Home() {
-

Safety by design

+

Built for DeFi Security

- Cadence provides security and safety guarantees that greatly simplify the development of secure smart contracts. + In DeFi, security isn't optional. Cadence's resource-oriented programming paradigm fundamentally changes how assets are stored and protected.

- As smart contracts often deal with valuable assets, Cadence provides the resource-oriented programming paradigm, - which guarantees that assets can only exist in one location at a time, cannot be copied, and cannot be accidentally lost or deleted. + 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.

- Cadence includes several language features that prevent entire classes of bugs via a strong static type system, design by contract, - and capability-based access control. + 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.

- These security and safety features allow smart contract developers to focus on the business logic of their contract, - instead of preventing security footguns and attacks. + Build financial applications with confidence. Cadence's safety guarantees let you focus on creating value, not patching vulnerabilities.

@@ -165,20 +169,17 @@ export default function Home() {
-

Built for permissionless composability

+

Composable DeFi Primitives

- Resources are stored directly in users' accounts, - and can flow freely between contracts. They can be passed as arguments to functions, returned from functions, or even combined in arbitrary data structures. - This makes implementing business logic easier and promotes the reuse of existing logic. + 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.

- Interfaces enable interoperability of contracts and resources allowing - developers to integrate their applications into existing experiences easily. + 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.

- In addition, the attachments feature - of Cadence allows developers to extend existing types with new functionality and data, - without requiring the original author of the type to plan or account for the intended behavior. + Interfaces and attachments make protocols truly composable. + Extend existing assets with new DeFi functionality without requiring permission from the original creators.

@@ -188,12 +189,12 @@ export default function Home() {
-

Easy to learn, build and ship

+

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

- Cadence's syntax is inspired by popular modern general-purpose programming languages like Swift, Kotlin, and Rust, - so developers will find the syntax and the semantics familiar. - Practical tooling, documentation, - and examples enable developers to start creating programs quickly and effectively. + 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.

@@ -203,42 +204,24 @@ export default function Home() {
-

Powerful transactions for mainstream experiences

-

- In Cadence, a transaction has a lot more flexibility and the power to perform multiple operations with a single transaction, - as opposed to multiple, separate smart contract calls like in other languages. - It allows complex, multi-step interactions to be one-click user experiences. -

+

Complex DeFi Operations, Simple User Experiences

- Developers can easily batch multiple transactions, turning complicated user journeys into a few clicks. - For example, imagine approving and completing the listing of an NFT from a new collection in the same transaction, - or adding and sending funds with just one approval. + 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.

-
-
- -
-
- -
-
-

🧰 Best-in-class tooling

- Cadence comes with great IDE support. Use your favorite editor, - like Visual Studio Code, - Vim or Emacs, to get diagnostics, code completion, refactoring support, and more. + 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.

- To further enhance the developer experience, there is also a - native testing framework, which allows developers to write - unit & integration tests using Cadence. + This transactional power is what makes Consumer DeFi possible. Complex financial operations that just work, every time.

- +
+
From 922483c151475be933a932c1052757f3ee56abae Mon Sep 17 00:00:00 2001 From: Felipe Cevallos Date: Fri, 7 Nov 2025 09:20:56 -0600 Subject: [PATCH 2/9] Replace Vault example with Flow Actions and Scheduled Transactions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update the homepage code example to showcase DeFi-specific features: - Demonstrates Flow Actions composing atomic operations (claim → swap → restake) - Shows Scheduled Transactions for recurring automation - Better illustrates the unique capabilities that enable Consumer DeFi - Updated syntax highlighter to support transaction keywords and comments This example directly showcases the key differentiators mentioned in the homepage content. --- src/pages/index.js | 59 ++++++++++++++++++++++++++++++---------------- 1 file changed, 39 insertions(+), 20 deletions(-) diff --git a/src/pages/index.js b/src/pages/index.js index 0eef8a05..a1d4bc04 100644 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -19,38 +19,57 @@ import learnAnimation from "./learn.json"; import styles from './index.module.css'; import Logo from '@site/static/img/logo.svg'; -const example = `access(all) -resource Vault { - access(all) - var balance: UFix64 - - init(balance: UFix64) { - self.balance = balance - } - - access(all) - fun withdraw(amount: UFix64): @Vault { - self.balance = self.balance - amount - return <- create Vault(balance: amount) - } - - access(all) - fun deposit(from: @Vault) { - self.balance = self.balance + from.balance - destroy from +const example = `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 + ) } }` function cadence(Prism) { Prism.languages.cadence = { + comment: { + pattern: /\/\/.*/, + greedy: true + }, string: { pattern: /"[^"]*"/, greedy: true }, keyword: - /\b(?:access|all|fun|resource|create|let|destroy|return|self|var|init|from)\b/, + /\b(?:access|all|fun|resource|create|let|destroy|return|self|var|init|from|import|transaction|prepare|auth|Storage|Account|true|false)\b/, 'class-name': /\b[A-Z][A-Za-z_\d]*\b/, function: /\b[a-z_]\w*(?=\s*\()/i, + number: /\b\d+\.?\d*\b/, } } From 6097a292e60971892b576233ad70fe725fbbde9d Mon Sep 17 00:00:00 2001 From: Felipe Cevallos Date: Fri, 7 Nov 2025 09:58:07 -0600 Subject: [PATCH 3/9] Refine homepage messaging and improve transaction capabilities section --- src/pages/index.js | 59 +++++++++++++++++++++++----------------------- 1 file changed, 30 insertions(+), 29 deletions(-) diff --git a/src/pages/index.js b/src/pages/index.js index a1d4bc04..0ef2c639 100644 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -146,8 +146,8 @@ export default function Home() { >

- 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. + 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. @@ -162,23 +162,44 @@ export default function Home() {

+
+
+

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. Cadence's resource-oriented programming paradigm fundamentally changes how assets are stored and protected. + 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, Cadence's model makes attacks exponentially harder. Attackers must target individual accounts one at a time, with no easy list of vulnerable targets. + 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, design by contract, + 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's safety guarantees let you focus on creating value, not patching vulnerabilities. + Build financial applications with confidence. Cadence provides safety guarantees that let you focus on creating value, not patching vulnerabilities.

@@ -194,11 +215,11 @@ export default function Home() {

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

@@ -210,7 +231,7 @@ export default function Home() {

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. + 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. @@ -221,26 +242,6 @@ export default function Home() {

-
-
-

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. -

-
-
- -
-
- -
From 6c102fd382c5561ec080018a9b1cbfad7f3ad5d1 Mon Sep 17 00:00:00 2001 From: Felipe Cevallos Date: Fri, 7 Nov 2025 10:03:18 -0600 Subject: [PATCH 4/9] Update meta description for clarity and impact --- src/pages/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/index.js b/src/pages/index.js index 0ef2c639..b69c07f5 100644 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -97,7 +97,7 @@ export default function Home() { return ( + description="Ship Consumer DeFi products faster. Cadence delivers the security, automation, and tooling to build financial apps that millions trust.">
From 3f3c57205d2edbda1cc58203e7988056faf41df7 Mon Sep 17 00:00:00 2001 From: Brian Doyle Date: Thu, 13 Nov 2025 15:58:24 -0500 Subject: [PATCH 5/9] Apply feedback --- src/css/custom.css | 13 +++++-- src/pages/index.js | 92 +++++++++++++++++++++++++++------------------- 2 files changed, 65 insertions(+), 40 deletions(-) diff --git a/src/css/custom.css b/src/css/custom.css index 8c28c6be..2b84b706 100644 --- a/src/css/custom.css +++ b/src/css/custom.css @@ -166,6 +166,7 @@ code { .content-wrapper { max-width: 80rem; + margin: 0 auto; padding-left: max(env(safe-area-inset-left), 1.5rem); padding-right: max(env(safe-area-inset-right), 1.5rem); } @@ -284,8 +285,14 @@ h2 strong { .code { border-radius: 1rem; - font-size: 0.9rem !important; + font-size: 0.73rem !important; box-shadow: 1px 2px 4px rgba(45, 45, 45, 0.4); + margin: 0 !important; +} + +.code pre { + margin: 0 !important; + padding: 1rem !important; } h3 { @@ -477,9 +484,9 @@ footer .license { } .feature { - gap: 6rem; + gap: 3rem; flex-direction: row; - align-items: center; + align-items: flex-start; } .feature.alternate { diff --git a/src/pages/index.js b/src/pages/index.js index b69c07f5..ccb8be44 100644 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -5,7 +5,6 @@ import Link from '@docusaurus/Link'; import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; import Layout from '@theme/Layout'; import HomepageFeatures from '@site/src/components/HomepageFeatures'; -import { FcLock, FcIdea, FcChargeBattery, FcMindMap } from 'react-icons/fc'; import { HiArrowRight, HiArrowSmDown } from 'react-icons/hi'; import { PrismAsyncLight as SyntaxHighlighter } from 'react-syntax-highlighter'; import { tomorrow } from 'react-syntax-highlighter/dist/cjs/styles/prism'; @@ -102,7 +101,7 @@ export default function Home() {
-
+
Cadence @@ -118,9 +117,38 @@ export default function Home() { Get started + +
+ +
-
+
-
+

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—a paradigm designed specifically for handling valuable digital assets. + 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.

@@ -164,18 +188,18 @@ export default function Home() {

-

Complex DeFi Operations, Simple User Experiences

+

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. + 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.

- 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. + Check staking positions, claim rewards, swap tokens, and restake all in one operation by writing a transaction.

- 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. + Cadence scripts provide native data availability, querying on-chain data directly without external indexers. Build sophisticated analytics and experiences 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. + This flexibility makes Consumer DeFi possible. Complex operations feel simple while maintaining security and atomicity.

@@ -185,18 +209,12 @@ export default function Home() {
-

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. -

+

Built for DeFi Security

- 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. + 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 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. + 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. @@ -209,17 +227,17 @@ export default function Home() {

-

Composable DeFi Primitives

+

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. + 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 enable native on-chain automation. Recurring payments, DCA strategies, and portfolio rebalancing execute directly from user wallets, no backend servers required. + {" "}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, creating composable building blocks that work together seamlessly. + Build new DeFi functionality on top of any token standard to create composable building blocks that work together seamlessly.

@@ -229,12 +247,12 @@ export default function Home() {
-

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

+

Learn the Best Language for Consumer DeFi

- 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. + 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.

- 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. + 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.

From 81e82772f57a01a7fc9007f60f3f1e84c05364bc Mon Sep 17 00:00:00 2001 From: Felipe Cevallos Date: Thu, 13 Nov 2025 15:51:55 -0600 Subject: [PATCH 6/9] corrected flow actions and scheduled tx snippet --- src/pages/index.js | 100 ++++++++++++++++++++++++++++++++++----------- 1 file changed, 76 insertions(+), 24 deletions(-) diff --git a/src/pages/index.js b/src/pages/index.js index ccb8be44..75fbfc1c 100644 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -19,37 +19,89 @@ import styles from './index.module.css'; import Logo from '@site/static/img/logo.svg'; const example = `import "DeFiActions" +import "FlowToken" import "FlowTransactionScheduler" +import "FlowTransactionSchedulerUtils" +import "IncrementFiStakingConnectors" +import "IncrementFiPoolLiquidityConnectors" +import "SwapConnectors" -// 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 - ) +// Schedule daily yield compounding with Flow Actions +transaction(stakingPoolId: UInt64, executionEffort: UInt64) { + prepare(signer: auth(Storage, Capabilities) &Account) { + // Setup transaction scheduler manager + if signer.storage.borrow<&AnyResource>(from: FlowTransactionSchedulerUtils.managerStoragePath) == nil { + let manager <- FlowTransactionSchedulerUtils.createManager() + signer.storage.save(<-manager, to: FlowTransactionSchedulerUtils.managerStoragePath) + } + + let manager = signer.storage.borrow( + from: FlowTransactionSchedulerUtils.managerStoragePath + ) ?? panic("Could not borrow Manager") - let swapper = SwapConnectors.TokenSwapper( + // Compose DeFi actions atomically: Claim → Zap → Restake + let operationID = DeFiActions.createUniqueIdentifier() + + // Source: Claim staking rewards + let rewardsSource = IncrementFiStakingConnectors.PoolRewardsSource( + userCertificate: signer.capabilities.storage + .issue<&StakingPool>(/storage/userCertificate), + pid: stakingPoolId, + uniqueID: operationID + ) + + // Swapper: Convert single reward token → LP tokens + let zapper = IncrementFiPoolLiquidityConnectors.Zapper( + token0Type: Type<@FlowToken.Vault>(), + token1Type: Type<@RewardToken.Vault>(), + stableMode: false, + uniqueID: operationID + ) + + // Compose: Wrap rewards source with zapper + let lpSource = SwapConnectors.SwapSource( + swapper: zapper, source: rewardsSource, - targetToken: "FLOW" + uniqueID: operationID ) - - let stakeSink = StakingConnectors.PoolStakeSink( - pool: stakingPool, - source: swapper + + // Sink: Restake LP tokens back into pool + let poolSink = IncrementFiStakingConnectors.PoolSink( + pid: stakingPoolId, + staker: signer.address, + uniqueID: operationID ) - // Schedule to run every N days - let future = getCurrentBlock().timestamp - + (intervalDays * 86400.0) - - FlowTransactionScheduler.schedule( - action: stakeSink, - timestamp: future, - recurring: true + // Schedule to run daily (86400 seconds = 24 hours) + let nextExecution = getCurrentBlock().timestamp + 86400.0 + + // Estimate and pay fees + let priority = FlowTransactionScheduler.Priority.Medium + let estimate = FlowTransactionScheduler.estimate( + data: nil, + timestamp: nextExecution, + priority: priority, + executionEffort: executionEffort + ) + + let feeVault = signer.storage.borrow(from: /storage/flowTokenVault)! + let fees <- feeVault.withdraw(amount: estimate.flowFee ?? 0.0) as! @FlowToken.Vault + + // Get handler capability + let handlerCap = signer.capabilities.storage + .issue(/storage/RestakeHandler) + + // Schedule recurring execution + manager.schedule( + handlerCap: handlerCap, + data: nil, + timestamp: nextExecution, + priority: priority, + executionEffort: executionEffort, + fees: <-fees ) } }` From 0525d0ca08c73f0e3941b4a40baa206d0d9b91f5 Mon Sep 17 00:00:00 2001 From: Brian Doyle Date: Thu, 13 Nov 2025 17:56:33 -0500 Subject: [PATCH 7/9] Style for whole code example --- src/pages/index.js | 80 +++++++++++++++++++++++++++++++--------------- 1 file changed, 54 insertions(+), 26 deletions(-) diff --git a/src/pages/index.js b/src/pages/index.js index 75fbfc1c..a5d836ea 100644 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -1,4 +1,4 @@ -import React from 'react'; +import React, { useRef, useEffect, useState } from 'react'; import clsx from 'clsx'; import Head from 'next/head'; import Link from '@docusaurus/Link'; @@ -29,16 +29,6 @@ import "SwapConnectors" // Schedule daily yield compounding with Flow Actions transaction(stakingPoolId: UInt64, executionEffort: UInt64) { prepare(signer: auth(Storage, Capabilities) &Account) { - // Setup transaction scheduler manager - if signer.storage.borrow<&AnyResource>(from: FlowTransactionSchedulerUtils.managerStoragePath) == nil { - let manager <- FlowTransactionSchedulerUtils.createManager() - signer.storage.save(<-manager, to: FlowTransactionSchedulerUtils.managerStoragePath) - } - - let manager = signer.storage.borrow( - from: FlowTransactionSchedulerUtils.managerStoragePath - ) ?? panic("Could not borrow Manager") // Compose DeFi actions atomically: Claim → Zap → Restake let operationID = DeFiActions.createUniqueIdentifier() @@ -73,11 +63,19 @@ transaction(stakingPoolId: UInt64, executionEffort: UInt64) { uniqueID: operationID ) - // Schedule to run daily (86400 seconds = 24 hours) - let nextExecution = getCurrentBlock().timestamp + 86400.0 + // Setup transaction scheduler manager + if signer.storage.borrow<&AnyResource>( + from: FlowTransactionSchedulerUtils.managerStoragePath) == nil { + let manager <- FlowTransactionSchedulerUtils.createManager() + signer.storage.save(<-manager, to: FlowTransactionSchedulerUtils.managerStoragePath) + } + let manager = signer.storage.borrow( + from: FlowTransactionSchedulerUtils.managerStoragePath + ) ?? panic("Could not borrow Manager") + // Estimate and pay fees - let priority = FlowTransactionScheduler.Priority.Medium let estimate = FlowTransactionScheduler.estimate( data: nil, timestamp: nextExecution, @@ -98,8 +96,8 @@ transaction(stakingPoolId: UInt64, executionEffort: UInt64) { manager.schedule( handlerCap: handlerCap, data: nil, - timestamp: nextExecution, - priority: priority, + timestamp: getCurrentBlock().timestamp + 86400.0, // 24 hours + priority: FlowTransactionScheduler.Priority.Medium, executionEffort: executionEffort, fees: <-fees ) @@ -145,6 +143,21 @@ function HomepageHeader() { export default function Home() { const {siteConfig} = useDocusaurusContext(); + const leftColumnRef = useRef(null); + const [codeBoxHeight, setCodeBoxHeight] = useState(null); + + useEffect(() => { + const updateHeight = () => { + if (leftColumnRef.current) { + setCodeBoxHeight(leftColumnRef.current.offsetHeight); + } + }; + + updateHeight(); + window.addEventListener('resize', updateHeight); + return () => window.removeEventListener('resize', updateHeight); + }, []); + return (
-
-
+
+
Cadence @@ -176,7 +189,7 @@ export default function Home() { height: 0, overflow: 'hidden', width: '100%', - marginTop: 'auto', + marginTop: '2rem', flexShrink: 0, borderRadius: '1rem', boxShadow: '1px 2px 4px rgba(45, 45, 45, 0.4)' @@ -200,13 +213,28 @@ export default function Home() {
-
- {example} +
+
+ {example} +
From 5ce4538a4ef81b9762efc09f318892b6db2006f6 Mon Sep 17 00:00:00 2001 From: Brian Doyle Date: Thu, 13 Nov 2025 18:14:31 -0500 Subject: [PATCH 8/9] Tune appearance --- src/pages/index.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/pages/index.js b/src/pages/index.js index a5d836ea..05ebac4d 100644 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -1,4 +1,4 @@ -import React, { useRef, useEffect, useState } from 'react'; +import React, { useRef, useLayoutEffect, useState } from 'react'; import clsx from 'clsx'; import Head from 'next/head'; import Link from '@docusaurus/Link'; @@ -146,7 +146,7 @@ export default function Home() { const leftColumnRef = useRef(null); const [codeBoxHeight, setCodeBoxHeight] = useState(null); - useEffect(() => { + useLayoutEffect(() => { const updateHeight = () => { if (leftColumnRef.current) { setCodeBoxHeight(leftColumnRef.current.offsetHeight); @@ -220,7 +220,9 @@ export default function Home() { flexDirection: 'column', overflow: 'hidden', height: codeBoxHeight ? `${codeBoxHeight}px` : 'auto', - borderRadius: '1rem' + borderRadius: '1rem', + opacity: codeBoxHeight ? 1 : 0, + transition: 'opacity 0.1s ease-in' }}>
-
+

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

From 95b8f76171d44bcfecf2d8555055b7d4df47c550 Mon Sep 17 00:00:00 2001 From: Brian Doyle Date: Thu, 13 Nov 2025 18:19:24 -0500 Subject: [PATCH 9/9] Fix long code box --- src/pages/index.js | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/pages/index.js b/src/pages/index.js index 05ebac4d..0385a006 100644 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -149,13 +149,26 @@ export default function Home() { useLayoutEffect(() => { const updateHeight = () => { if (leftColumnRef.current) { - setCodeBoxHeight(leftColumnRef.current.offsetHeight); + // Use requestAnimationFrame to ensure layout is complete + requestAnimationFrame(() => { + if (leftColumnRef.current) { + setCodeBoxHeight(leftColumnRef.current.offsetHeight); + } + }); } }; + // Initial measurement updateHeight(); + + // Also measure after a small delay to catch any async layout changes + const timeoutId = setTimeout(updateHeight, 0); + window.addEventListener('resize', updateHeight); - return () => window.removeEventListener('resize', updateHeight); + return () => { + clearTimeout(timeoutId); + window.removeEventListener('resize', updateHeight); + }; }, []); return ( @@ -219,10 +232,11 @@ export default function Home() { display: 'flex', flexDirection: 'column', overflow: 'hidden', - height: codeBoxHeight ? `${codeBoxHeight}px` : 'auto', + height: codeBoxHeight ? `${codeBoxHeight}px` : 0, borderRadius: '1rem', opacity: codeBoxHeight ? 1 : 0, - transition: 'opacity 0.1s ease-in' + visibility: codeBoxHeight ? 'visible' : 'hidden', + transition: codeBoxHeight ? 'opacity 0.15s ease-in' : 'none' }}>