Skip to content

Commit c45166d

Browse files
authored
Merge pull request #14100 from Shiva-Sai-ssb/fix-13648
feat: add DeFi quiz [Fixes #13648]
2 parents c596b5f + aeab35c commit c45166d

File tree

6 files changed

+193
-2
lines changed

6 files changed

+193
-2
lines changed

public/content/defi/index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,3 +355,7 @@ DeFi is an open-source movement. The DeFi protocols and applications are all ope
355355

356356
- [DeFi Llama Discord server](https://discord.defillama.com/)
357357
- [DeFi Pulse Discord server](https://discord.gg/Gx4TCTk)
358+
359+
<Divider />
360+
361+
<QuizWidget quizKey="defi" />

src/components/Quiz/stories/QuizzesStats.stories.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ const meta = {
2121
web3: [false, 0],
2222
daos: [false, 0],
2323
stablecoins: [false, 0],
24+
defi: [false, 0],
2425
},
2526
totalCorrectAnswers: 0,
2627
},

src/data/quizzes/index.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ const quizzes = {
5454
title: "stablecoins",
5555
questions: ["m001", "m002", "m003", "m004", "m005"],
5656
},
57+
defi: {
58+
title: "DeFi",
59+
questions: ["n001", "n002", "n003", "n004", "n005"],
60+
},
5761
} satisfies RawQuizzes
5862

5963
export const ethereumBasicsQuizzes: QuizzesSection[] = [
@@ -92,6 +96,11 @@ export const usingEthereumQuizzes: QuizzesSection[] = [
9296
{
9397
id: "stablecoins",
9498
level: "beginner",
99+
next: "defi",
100+
},
101+
{
102+
id: "defi",
103+
level: "beginner",
95104
next: "layer-2",
96105
},
97106
{

src/data/quizzes/questionBank.ts

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1610,6 +1610,137 @@ const questionBank = {
16101610
],
16111611
correctAnswerId: "m005-d",
16121612
},
1613+
// DeFi
1614+
n001: {
1615+
prompt: "n001-prompt",
1616+
answers: [
1617+
{
1618+
id: "n001-a",
1619+
label: "n001-a-label",
1620+
explanation: "n001-a-explanation",
1621+
},
1622+
{
1623+
id: "n001-b",
1624+
label: "n001-b-label",
1625+
explanation: "n001-b-explanation",
1626+
},
1627+
{
1628+
id: "n001-c",
1629+
label: "n001-c-label",
1630+
explanation: "n001-c-explanation",
1631+
},
1632+
{
1633+
id: "n001-d",
1634+
label: "n001-d-label",
1635+
explanation: "n001-d-explanation",
1636+
},
1637+
],
1638+
correctAnswerId: "n001-a",
1639+
},
1640+
n002: {
1641+
prompt: "n002-prompt",
1642+
answers: [
1643+
{
1644+
id: "n002-a",
1645+
label: "n002-a-label",
1646+
explanation: "n002-a-explanation",
1647+
},
1648+
{
1649+
id: "n002-b",
1650+
label: "n002-b-label",
1651+
explanation: "n002-b-explanation",
1652+
},
1653+
{
1654+
id: "n002-c",
1655+
label: "n002-c-label",
1656+
explanation: "n002-c-explanation",
1657+
},
1658+
{
1659+
id: "n002-d",
1660+
label: "n002-d-label",
1661+
explanation: "n002-d-explanation",
1662+
},
1663+
],
1664+
correctAnswerId: "n002-b",
1665+
},
1666+
n003: {
1667+
prompt: "n003-prompt",
1668+
answers: [
1669+
{
1670+
id: "n003-a",
1671+
label: "n003-a-label",
1672+
explanation: "n003-a-explanation",
1673+
},
1674+
{
1675+
id: "n003-b",
1676+
label: "n003-b-label",
1677+
explanation: "n003-b-explanation",
1678+
},
1679+
{
1680+
id: "n003-c",
1681+
label: "n003-c-label",
1682+
explanation: "n003-c-explanation",
1683+
},
1684+
{
1685+
id: "n003-d",
1686+
label: "n003-d-label",
1687+
explanation: "n003-d-explanation",
1688+
},
1689+
],
1690+
correctAnswerId: "n003-a",
1691+
},
1692+
n004: {
1693+
prompt: "n004-prompt",
1694+
answers: [
1695+
{
1696+
id: "n004-a",
1697+
label: "n004-a-label",
1698+
explanation: "n004-a-explanation",
1699+
},
1700+
{
1701+
id: "n004-b",
1702+
label: "n004-b-label",
1703+
explanation: "n004-b-explanation",
1704+
},
1705+
{
1706+
id: "n004-c",
1707+
label: "n004-c-label",
1708+
explanation: "n004-c-explanation",
1709+
},
1710+
{
1711+
id: "n004-d",
1712+
label: "n004-d-label",
1713+
explanation: "n004-d-explanation",
1714+
},
1715+
],
1716+
correctAnswerId: "n004-d",
1717+
},
1718+
n005: {
1719+
prompt: "n005-prompt",
1720+
answers: [
1721+
{
1722+
id: "n005-a",
1723+
label: "n005-a-label",
1724+
explanation: "n005-a-explanation",
1725+
},
1726+
{
1727+
id: "n005-b",
1728+
label: "n005-b-label",
1729+
explanation: "n005-b-explanation",
1730+
},
1731+
{
1732+
id: "n005-c",
1733+
label: "n005-c-label",
1734+
explanation: "n005-c-explanation",
1735+
},
1736+
{
1737+
id: "n005-d",
1738+
label: "n005-d-label",
1739+
explanation: "n005-d-explanation",
1740+
},
1741+
],
1742+
correctAnswerId: "n005-a",
1743+
},
16131744
} as const satisfies QuestionBank
16141745

16151746
export default questionBank

src/intl/en/learn-quizzes.json

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,5 +568,50 @@
568568
"m005-c-label": "Buy them from an exchange",
569569
"m005-c-explanation": "Incorrect, this is a way to get stablecoins. Many exchanges and wallets let you buy stablecoins directly. Geographical restrictions may apply for centralized exchanges.",
570570
"m005-d-label": "Mine them",
571-
"m005-d-explanation": "Correct! Unlike bitcoin, you are unable to mine stablecoins."
571+
"m005-d-explanation": "Correct! Unlike bitcoin, you are unable to mine stablecoins.",
572+
"n001-prompt": "What does DeFi stand for?",
573+
"n001-a-label": "Decentralized Finance",
574+
"n001-a-explanation": "Correct! DeFi refers to Decentralized Finance, a financial system built on Ethereum that operates without intermediaries like banks or financial institutions.",
575+
"n001-b-label": "Digital Finance",
576+
"n001-b-explanation": "This is incorrect. Digital Finance refers to financial services that are provided through digital platforms, but it doesn’t specifically imply decentralization.",
577+
"n001-c-label": "Distributed Finance",
578+
"n001-c-explanation": "This is incorrect. While 'distributed' could imply decentralization, the term used in the industry is 'Decentralized Finance,' not Distributed Finance.",
579+
"n001-d-label": "Development Finance",
580+
"n001-d-explanation": "This is incorrect. Development Finance typically refers to financial support provided for projects aimed at economic development, often in developing countries, and is unrelated to blockchain or DeFi.",
581+
"n002-prompt": "What CAN'T you do with DeFi?",
582+
"n002-a-label": "Send money around the globe.",
583+
"n002-a-explanation": "This is incorrect. With DeFi, you can send value to anybody anywhere in the world, without any limits.",
584+
"n002-b-label": "Ask customer support to revert your mistakes.",
585+
"n002-b-explanation": "Correct! In DeFi, transactions are final and controlled by code rather than a company. If a mistake happens, like sending funds to the wrong address, there’s no customer support to help fix it. You need to be extra careful.",
586+
"n002-c-label": "Borrow funds with collateral.",
587+
"n002-c-explanation": "This is incorrect. With DeFi, you can borrow money instantly, avoiding the days-long approval process of traditional banks.",
588+
"n002-d-label": "Trade your tokens 24/7.",
589+
"n002-d-explanation": "This is incorrect. DeFi allows you to trade tokens 24/7. Markets are always open, and you can trade your ETH against USDT or any other currency anytime.",
590+
"n003-prompt": "Which DeFi platform is known for allowing users to swap tokens directly with one another?",
591+
"n003-a-label": "Uniswap",
592+
"n003-a-explanation": "Correct! Uniswap is a decentralized exchange that allows users to trade (swap) tokens directly with each other using automated market-making mechanisms.",
593+
"n003-b-label": "Aave",
594+
"n003-b-explanation": "This is incorrect. Aave is a DeFi protocol focused on lending and borrowing, not token swaps.",
595+
"n003-c-label": "PoolTogether",
596+
"n003-c-explanation": "This is incorrect. PoolTogether runs no-loss lotteries which offer a new innovative way to save money.",
597+
"n003-d-label": "MakerDao",
598+
"n003-d-explanation": "This is incorrect. MakerDAO is a decentralized platform that allows users to issue and manage the DAI stablecoin, but it doesn’t focus on token swaps.",
599+
"n004-prompt": "When you use a DeFi app and make a transaction, where is the transaction information kept?",
600+
"n004-a-label": "ETH",
601+
"n004-a-explanation": "This is incorrect. Data is not stored in ether (ETH). ETH is the native asset of the Ethereum blockchain.",
602+
"n004-b-label": "My wallet",
603+
"n004-b-explanation": "This is incorrect. A wallet is an application that manages your Ethereum account by connecting to the Ethereum blockchain. It doesn't store any data about your transaction history.",
604+
"n004-c-label": "DeFi apps",
605+
"n004-c-explanation": "This is incorrect. DeFi apps don’t store your transaction history directly. Instead, your transaction details are recorded on the Ethereum blockchain.",
606+
"n004-d-label": "Ethereum blockchain",
607+
"n004-d-explanation": "Correct! Ethereum as a blockchain stores all the data made by its users and apps. This allows validators to maintain the same state across the P2P network.",
608+
"n005-prompt": "What makes Decentralized Finance (DeFi) possible on Ethereum?",
609+
"n005-a-label": "Smart Contracts",
610+
"n005-a-explanation": "Correct! Smart contracts are like digital 'if-then' statements written into Ethereum. They replace traditional contracts and middlemen, automatically executing transactions if certain conditions are met.",
611+
"n005-b-label": "Middlemen",
612+
"n005-b-explanation": "This is incorrect. Ethereum doesn't need middlemen for transactions to run. Everything runs on the chain through smart contracts.",
613+
"n005-c-label": "Bitcoin",
614+
"n005-c-explanation": "This is incorrect. Bitcoin is a simple network for storing value, not for running advanced programs. DeFi requires a more flexible system, like Ethereum, that can run complex programs to handle loans and trades automatically.",
615+
"n005-d-label": "Traditional financial institutions",
616+
"n005-d-explanation": "This is incorrect. DeFi apps don’t need traditional financial institutions. They use blockchain programs called smart contracts to handle transactions automatically."
572617
}

src/lib/utils/translations.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,8 @@ const getRequiredNamespacesForPath = (relativePath: string) => {
207207
path.startsWith("/web3/") ||
208208
path.startsWith("/what-is-ethereum/") ||
209209
path.startsWith("/quizzes/") ||
210-
path.startsWith("/stablecoins/")
210+
path.startsWith("/stablecoins/") ||
211+
path.startsWith("/defi/")
211212
) {
212213
requiredNamespaces = [...requiredNamespaces, "learn-quizzes"]
213214
}

0 commit comments

Comments
 (0)