-
Notifications
You must be signed in to change notification settings - Fork 28
Add new article, challenges of backing stablecoin with basket of assets. #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add new article, challenges of backing stablecoin with basket of assets. #15
Conversation
|
Caution Review failedThe pull request is closed. WalkthroughAdds a new article: an index entry in Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
public/articles/articles-index.json(1 hunks)public/articles/basket-backing-challenges.md(1 hunks)
🧰 Additional context used
🪛 LanguageTool
public/articles/basket-backing-challenges.md
[style] ~40-~40: ‘for the benefit’ might be wordy. Consider a shorter alternative.
Context: ...for its own benefit instead of doing so for the benefit of the system. Decentralized governance...
(EN_WORDINESS_PREMIUM_FOR_THE_BENEFIT)
[style] ~40-~40: ‘a majority of’ might be wordy. Consider a shorter alternative.
Context: ... are not done by a single entity but by a majority of various entities (or even minority in c...
(EN_WORDINESS_PREMIUM_A_MAJORITY_OF)
[grammar] ~42-~42: Use a hyphen to join words.
Context: ...oo expensive to process all that data on chain, in a smart contract. Doing it off...
(QB_NEW_EN_HYPHEN)
[grammar] ~48-~48: Ensure spelling is correct
Context: ...pproach that we choose (whether it is a propoer portfolio management approach when it b...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~48-~48: Use a hyphen to join words.
Context: ... when it becomes technically feasible on chain or a liquidity pool inspired appro...
(QB_NEW_EN_HYPHEN)
[grammar] ~48-~48: Use a hyphen to join words.
Context: ...ly feasible on chain or a liquidity pool inspired approach), it would be more int...
(QB_NEW_EN_HYPHEN)
[grammar] ~50-~50: Use a hyphen to join words.
Context: ... A2. Instead of modifying a single asset backed stablecoin protocol to work as a ...
(QB_NEW_EN_HYPHEN)
[grammar] ~50-~50: Use a hyphen to join words.
Context: ...ablecoin protocol to work as a two-asset backed stablecoin protocol with, let's s...
(QB_NEW_EN_HYPHEN)
[grammar] ~56-~56: Use a hyphen to join words.
Context: ...ultiple assets using just a single asset backed stablecoin protocol. The second ...
(QB_NEW_EN_HYPHEN)
🔇 Additional comments (2)
public/articles/articles-index.json (1)
1-40: JSON structure and formatting look goodThe new article entry is properly formatted with valid JSON syntax, consistent field structure, and appropriate metadata (title, author, date, image, excerpt, featured flag). The entry is correctly positioned in the articles array.
public/articles/basket-backing-challenges.md (1)
1-7: Image asset verified and frontmatter is correctThe image asset exists at
public/images/challenges-of-basket-backing.webpand the path reference in frontmatter (/images/challenges-of-basket-backing.webp) is properly configured. All frontmatter metadata is valid.
| { | ||
| "slug": "challenges-of-backing-by-basket-of-assets", | ||
| "title": "The Challenges and Problems of Backing by a Basket of Assets", | ||
| "author": "Zahnentferner", | ||
| "date": "2025-06-13", | ||
| "image": "/images/challenges-of-basket-backing.webp", | ||
| "excerpt": "Exploring the hidden pitfalls of backing a stablecoin with a basket of assets instead of a single asset.", | ||
| "featured": false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
Verify filename and slug naming consistency
The new article entry uses slug "challenges-of-backing-by-basket-of-assets" but the markdown file is named basket-backing-challenges.md. These don't follow a consistent naming pattern—the slug is the expanded form while the filename is abbreviated.
Verify that your routing/linking system doesn't require filename-slug alignment, or rename one to match the other for maintainability.
🏁 Script executed:
#!/bin/bash
# Check if there's a routing mapping or if files should match slugs
rg -i "challenges-of-backing-by-basket-of-assets|basket-backing-challenges" --type json --type js --type tsLength of output: 94
🏁 Script executed:
#!/bin/bash
# Check how articles are loaded - look for imports or dynamic loading patterns
rg -nC3 "import.*article|require.*article|basename|slug" --type js --type ts --type json -g '!node_modules' | head -50Length of output: 2994
🏁 Script executed:
#!/bin/bash
# List all markdown files in articles directory to see naming patterns
fd "\.md$" public/articles/ -exec basename {} \;Length of output: 151
🏁 Script executed:
#!/bin/bash
# Check the articles-index.json structure for other slug/filename patterns
cat public/articles/articles-index.json | head -30Length of output: 1227
🏁 Script executed:
#!/bin/bash
# List all markdown files in articles directory (corrected)
fd "\.md$" public/articles/Length of output: 975
🏁 Script executed:
#!/bin/bash
# Search for how article content is actually loaded - look for file imports or path construction
rg -nC5 "public/articles|\.md|articles-index|getArticle|loadArticle" --type js --type ts --type jsx --type tsx -g '!node_modules' | head -100Length of output: 27
🏁 Script executed:
#!/bin/bash
# Search for how articles are loaded/routed (broader search without type restrictions)
rg -n "articles-index|slug|\.md" src/ app/ pages/ components/ 2>/dev/null | head -50Length of output: 1256
🏁 Script executed:
#!/bin/bash
# Look for import or require patterns for articles
rg -n "import.*articles|require.*articles" 2>/dev/null | head -30Length of output: 265
🏁 Script executed:
#!/bin/bash
# Find getPostBySlugServer implementation to see how it maps slug to file
rg -nA10 "getPostBySlugServer|function getPostBySlug|export.*getPostBySlug" lib/ app/Length of output: 2202
Rename markdown file to match the slug—current mismatch will cause 404 errors
The system constructs markdown file paths directly from the slug parameter (lib/blog-server.ts:20):
const markdownPath = join(process.cwd(), 'public/articles', `${slug}.md`)
For slug "challenges-of-backing-by-basket-of-assets", it will look for public/articles/challenges-of-backing-by-basket-of-assets.md, but the actual file is basket-backing-challenges.md. The file won't be found, causing notFound() to trigger and making the article inaccessible.
Rename basket-backing-challenges.md to challenges-of-backing-by-basket-of-assets.md to match the slug, or vice versa (all other articles follow this pattern: filename = slug).
🤖 Prompt for AI Agents
In public/articles/articles-index.json around lines 12 to 19, the entry's slug
"challenges-of-backing-by-basket-of-assets" does not match the actual markdown
filename (currently basket-backing-challenges.md), causing the code that builds
markdownPath from the slug to fail; fix by renaming
public/articles/basket-backing-challenges.md to
public/articles/challenges-of-backing-by-basket-of-assets.md (or alternatively
change the slug to match the existing filename) and update any references or
links accordingly so the slug-to-filename mapping is consistent.
|
|
||
| A centralized portfolio management would bring the usual disadvantages of centralization, including the risk that the single entity manages the portfolio for its own benefit instead of doing so for the benefit of the system. Decentralized governance would just mean that decisions are not done by a single entity but by a majority of various entities (or even minority in case of low participation), but the potential conflict of interests remain. In both cases, the stability derived from knowing that the rules and parameters of the system will remain unchanged ("code is law"!) is lost. So, from a philosophical perspective, only algorithmic portfolio management is really suitable. | ||
|
|
||
| The challenge with algorithmic portfolio management then is which algorithm to choose. There is a vast academic literature on proper portfolio management, but these algorithms require lots of historical data about the prices of the portfolio's assets. Nowadays, blockchain oracles do not provide all this data. And, even if they did, it would be too expensive to process all that data on chain, in a smart contract. Doing it off-chain would lead us back to centralization or decentralized off-chain governance. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add missing hyphens to compound adjectives and technical terms
Several compound adjectives and technical phrases lack required hyphens:
- Line 42: "on chain" → "on-chain"
- Line 50: "single asset backed stablecoin" → "single-asset-backed stablecoin" (appears twice)
- Line 50: "two-asset backed" → "two-asset-backed" (inconsistent hyphenation)
Apply these diffs to fix hyphenation:
-And, even if they did, it would be too expensive to process all that data on chain, in a smart contract.
+And, even if they did, it would be too expensive to process all that data on-chain, in a smart contract.-Let's suppose that we would like to have a stablecoin S backed by two assets A1 and A2. Instead of modifying a single asset backed stablecoin protocol to work as a two-asset backed stablecoin protocol with, let's say, a built-in liquidity-pool-like mechanism to manage the A1 and A2 portfolio, we could do one of the following two options:
+Let's suppose that we would like to have a stablecoin S backed by two assets A1 and A2. Instead of modifying a single-asset-backed stablecoin protocol to work as a two-asset-backed stablecoin protocol with, let's say, a built-in liquidity-pool-like mechanism to manage the A1 and A2 portfolio, we could do one of the following two options:-With both of these options, one can effectively have a stablecoin backed by multiple assets using just a single asset backed stablecoin protocol.
+With both of these options, one can effectively have a stablecoin backed by multiple assets using just a single-asset-backed stablecoin protocol.Also applies to: 50-50, 56-56
🧰 Tools
🪛 LanguageTool
[grammar] ~42-~42: Use a hyphen to join words.
Context: ...oo expensive to process all that data on chain, in a smart contract. Doing it off...
(QB_NEW_EN_HYPHEN)
🤖 Prompt for AI Agents
public/articles/basket-backing-challenges.md lines 42, 50, and 56: several
compound adjectives and technical phrases are missing hyphens; update "on chain"
to "on-chain" at line 42, change both occurrences of "single asset backed
stablecoin" to "single-asset-backed stablecoin" and change "two-asset backed"
(or "two asset backed") to "two-asset-backed" around line 50 (and any duplicate
instances), and apply the same hyphenation correction to the phrase at line 56
(and any other occurrences like "50-50") so all compound modifiers are
consistently hyphenated.
|
|
||
| For example, one option could be to implement mechanisms similar to those used by liquidity pools. In a liquidity pool between assets A1 and A2, it becomes progressively more expensive to swap A2 for A1 as the proportion of A2 in the pool increases. Similarly, we could make it progressively more expensive to mint stablecoins by depositing A2 as the proportion of A2 in the reserve increases. However, the equations used by liquidity pools nowadays are rather ad-hoc. | ||
|
|
||
| Independently of the algorithmic portfolio management approach that we choose (whether it is a propoer portfolio management approach when it becomes technically feasible on chain or a liquidity pool inspired approach), it would be more interesting to do it outside the stablecoin protocol, for the sake of simplicity and architectural compositionality. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix spelling error: "propoer" → "proper"
Line 48 contains a typo in the word "propoer" which should be "proper".
Apply this diff to fix the spelling:
-Independently of the algorithmic portfolio management approach that we choose (whether it is a propoer portfolio management approach when it becomes technically feasible on chain or a liquidity pool inspired approach), it would be more interesting to do it outside the stablecoin protocol, for the sake of simplicity and architectural compositionality.
+Independently of the algorithmic portfolio management approach that we choose (whether it is a proper portfolio management approach when it becomes technically feasible on-chain or a liquidity-pool-inspired approach), it would be more interesting to do it outside the stablecoin protocol, for the sake of simplicity and architectural compositionality.📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| Independently of the algorithmic portfolio management approach that we choose (whether it is a propoer portfolio management approach when it becomes technically feasible on chain or a liquidity pool inspired approach), it would be more interesting to do it outside the stablecoin protocol, for the sake of simplicity and architectural compositionality. | |
| Independently of the algorithmic portfolio management approach that we choose (whether it is a proper portfolio management approach when it becomes technically feasible on-chain or a liquidity-pool-inspired approach), it would be more interesting to do it outside the stablecoin protocol, for the sake of simplicity and architectural compositionality. |
🧰 Tools
🪛 LanguageTool
[grammar] ~48-~48: Ensure spelling is correct
Context: ...pproach that we choose (whether it is a propoer portfolio management approach when it b...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~48-~48: Use a hyphen to join words.
Context: ... when it becomes technically feasible on chain or a liquidity pool inspired appro...
(QB_NEW_EN_HYPHEN)
[grammar] ~48-~48: Use a hyphen to join words.
Context: ...ly feasible on chain or a liquidity pool inspired approach), it would be more int...
(QB_NEW_EN_HYPHEN)
🤖 Prompt for AI Agents
public/articles/basket-backing-challenges.md around line 48: fix the spelling
typo "propoer" to "proper" in the sentence so it reads "whether it is a proper
portfolio management approach..." — update that word only, keeping the rest of
the sentence unchanged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
♻️ Duplicate comments (4)
public/articles/basket-backing-challenges.md (4)
42-42: Fix missing hyphen in "on-chain" (duplicate issue).This issue was flagged in a prior review but remains unaddressed. Line 42 needs the hyphenation correction:
-And, even if they did, it would be too expensive to process all that data on chain, in a smart contract. +And, even if they did, it would be too expensive to process all that data on-chain, in a smart contract.
48-48: Fix spelling error and missing hyphens (duplicate issues).These issues were flagged in a prior review but remain unaddressed. Line 48 needs three corrections:
-Independently of the algorithmic portfolio management approach that we choose (whether it is a propoer portfolio management approach when it becomes technically feasible on chain or a liquidity pool inspired approach), it would be more interesting to do it outside the stablecoin protocol, for the sake of simplicity and architectural compositionality. +Independently of the algorithmic portfolio management approach that we choose (whether it is a proper portfolio management approach when it becomes technically feasible on-chain or a liquidity-pool-inspired approach), it would be more interesting to do it outside the stablecoin protocol, for the sake of simplicity and architectural compositionality.
50-50: Fix missing hyphens in compound adjectives (duplicate issue).This issue was flagged in a prior review but remains unaddressed. Line 50 needs two corrections:
-Let's suppose that we would like to have a stablecoin S backed by two assets A1 and A2. Instead of modifying a single asset backed stablecoin protocol to work as a two-asset backed stablecoin protocol with, let's say, a built-in liquidity-pool-like mechanism to manage the A1 and A2 portfolio, we could do one of the following two options: +Let's suppose that we would like to have a stablecoin S backed by two assets A1 and A2. Instead of modifying a single-asset-backed stablecoin protocol to work as a two-asset-backed stablecoin protocol with, let's say, a built-in liquidity-pool-like mechanism to manage the A1 and A2 portfolio, we could do one of the following two options:
56-56: Fix missing hyphen in compound adjective (duplicate issue).This issue was flagged in a prior review but remains unaddressed. Line 56 needs the correction:
-With both of these options, one can effectively have a stablecoin backed by multiple assets using just a single asset backed stablecoin protocol. +With both of these options, one can effectively have a stablecoin backed by multiple assets using just a single-asset-backed stablecoin protocol.
🧹 Nitpick comments (1)
public/articles/basket-backing-challenges.md (1)
40-40: Consider tightening wordiness for clarity.The phrases "for the benefit of" and "a majority of various entities" could be simplified without losing meaning. For example:
- "for the benefit of the system" → "for the system's benefit" or just "for the system"
- "by a majority of various entities" → "by the majority"
This is a style preference and not required, but would improve readability.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
public/articles/articles-index.json(1 hunks)public/articles/basket-backing-challenges.md(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- public/articles/articles-index.json
🧰 Additional context used
🪛 LanguageTool
public/articles/basket-backing-challenges.md
[style] ~40-~40: ‘for the benefit’ might be wordy. Consider a shorter alternative.
Context: ...for its own benefit instead of doing so for the benefit of the system. Decentralized governance...
(EN_WORDINESS_PREMIUM_FOR_THE_BENEFIT)
[style] ~40-~40: ‘a majority of’ might be wordy. Consider a shorter alternative.
Context: ... are not done by a single entity but by a majority of various entities (or even minority in c...
(EN_WORDINESS_PREMIUM_A_MAJORITY_OF)
[grammar] ~42-~42: Use a hyphen to join words.
Context: ...oo expensive to process all that data on chain, in a smart contract. Doing it off...
(QB_NEW_EN_HYPHEN)
[grammar] ~48-~48: Ensure spelling is correct
Context: ...pproach that we choose (whether it is a propoer portfolio management approach when it b...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~48-~48: Use a hyphen to join words.
Context: ... when it becomes technically feasible on chain or a liquidity pool inspired appro...
(QB_NEW_EN_HYPHEN)
[grammar] ~48-~48: Use a hyphen to join words.
Context: ...ly feasible on chain or a liquidity pool inspired approach), it would be more int...
(QB_NEW_EN_HYPHEN)
[grammar] ~50-~50: Use a hyphen to join words.
Context: ... A2. Instead of modifying a single asset backed stablecoin protocol to work as a ...
(QB_NEW_EN_HYPHEN)
[grammar] ~50-~50: Use a hyphen to join words.
Context: ...ablecoin protocol to work as a two-asset backed stablecoin protocol with, let's s...
(QB_NEW_EN_HYPHEN)
[grammar] ~56-~56: Use a hyphen to join words.
Context: ...ultiple assets using just a single asset backed stablecoin protocol. The second ...
(QB_NEW_EN_HYPHEN)
🔇 Additional comments (3)
public/articles/basket-backing-challenges.md (3)
1-9: Article structure and frontmatter look good.The metadata is properly formatted, and the title clearly communicates the article's focus.
11-39: Solid technical analysis of single-asset backing rationale.The introduction effectively motivates the question and explains the Gresham's Law challenge, laying a strong foundation for the subsequent discussion of portfolio management approaches.
52-60: Well-structured conclusion with practical architectural alternatives.The two proposed options elegantly solve the multi-asset backing problem while preserving protocol simplicity. The discussion of decentralization benefits in option 2 is particularly insightful and strengthens the argument.
This commit:
Summary by CodeRabbit