Bitcoin-Native Overcollateralized Stablecoin Protocol#1
Open
gid-ctl wants to merge 6 commits into
Open
Conversation
…stablecoin protocol - Define constants for error codes, collateral ratios, and minimum deposit amounts - Add data variables for contract owner, price oracle, total supply, BTC price, and last price update - Create data maps for user positions and liquidation history - Implement read-only functions to get user positions, collateral ratios, and current BTC price - Add private functions to check price freshness, minimum collateral, and position health
…lecoins - Implement `deposit-collateral` to allow users to deposit Bitcoin collateral. - Implement `mint-stablecoin` to allow users to mint stablecoins based on their collateral. - Ensure collateral and debt are updated correctly in user positions. - Validate minimum collateral amount and price freshness before processing transactions. - Update total supply of stablecoins upon successful minting.
…ateral, and liquidating positions - Implement `repay-stablecoin` to allow users to repay their stablecoin debt. - Implement `withdraw-collateral` to allow users to withdraw their Bitcoin collateral. - Implement `liquidate-position` to allow liquidation of undercollateralized positions. - Ensure collateral and debt are updated correctly in user positions. - Validate debt amount, collateral amount, and position health before processing transactions. - Record liquidation history and update total supply of stablecoins upon successful liquidation.
…ateral, and liquidating positions - Implement `repay-stablecoin` to allow users to repay their stablecoin debt. - Implement `withdraw-collateral` to allow users to withdraw their Bitcoin collateral. - Implement `liquidate-position` to allow liquidation of undercollateralized positions. - Ensure collateral and debt are updated correctly in user positions. - Validate debt amount, collateral amount, and position health before processing transactions. - Record liquidation history and update total supply of stablecoins upon successful liquidation.
…ice updates and position management - Ensure consistency by using stacks-block-height for last price update and position management. - Update block height references in public functions for depositing collateral, minting stablecoins, repaying stablecoins, withdrawing collateral, and liquidating positions.
…cations, and integration guide - Include an overview of the SatoshiStable protocol and its key features. - Provide technical specifications including collateralization parameters and smart contract functions. - Detail user operations such as depositing collateral, minting stablecoins, repaying stablecoins, and withdrawing collateral. - Explain the liquidation mechanism and read-only functions. - Outline administrative functions for setting price and price oracle. - List error codes and security considerations. - Offer an integration guide for initializing positions, managing risk, and preventing liquidation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR implements a comprehensive Bitcoin-native stablecoin protocol leveraging Stacks Layer 2 capabilities. The protocol enables users to mint USD-pegged stablecoins using native Bitcoin as collateral, with built-in security measures and efficient capital utilization.
Key Features
Technical Implementation
Core Infrastructure
Position Management
Security Features
Documentation
Next Steps
Review Focus
Please pay special attention to:
Checklist