Overview of the SDK

The Satoshi Protocol SDK is a comprehensive toolkit for developers to integrate and interact with the Satoshi Protocol, a DeFi platform on the blockchain. This SDK is structured to facilitate various operations such as borrowing, earning, staking, and cross-chain functionality. Here’s a brief overview of the main components and their functions:

Directory Structure:

  • /src: Contains the source code for the SDK.

    • abi: Holds ABI files necessary for smart contract interactions.

    • api: Functions for direct API calls to the Satoshi Protocol.

    • config: Configuration files that specify chain parameters and protocol settings.

    • core: Core functionalities such as borrow, deposit, repay, and withdraw operations.

    • core/utils: Utility functions that support various features like calculations, hints, and total debt amounts.

    • types: TypeScript type definitions for assets and configurations.

Key Features:

Trove Operations:

  • OpenTrove

    • Purpose: Borrow SAT stable coins by depositing collateral into a new trove.

    • Usage: Used to initiate participation in the lending system, allowing users to lock in collateral in exchange for stable coins.

  • Deposit

    • Purpose: Add additional collateral to an existing trove to increase the collateral ratio.

    • Usage: Helps maintain a safe buffer against price fluctuations, potentially allowing for further borrowing without reducing safety margins.

  • Withdraw

    • Purpose: Remove collateral from a trove while maintaining the required minimum collateral ratio.

    • Usage: Permits users to retrieve excess collateral, useful when the collateral's value increases or the debt is partially repaid.

  • Borrow

    • Purpose: Borrow more SAT stable coins against the existing collateral in the trove.

    • Usage: Enables further leveraging of investments by increasing stable coins borrowings against secured collateral.

  • Repay

    • Purpose: Pay back borrowed SAT stable coins to reduce the trove’s debt.

    • Usage: Reduces interest liabilities and risk of liquidation by improving the collateral-to-debt ratio.

  • Close

    • Purpose: Close the trove by repaying all debts and reclaiming all collateral.

    • Usage: Ends participation in the borrowing system and liquidates the position, returning all collateral to the user.

  • Redeem

    • Purpose: Let users redeem SAT for collateral, ensuring the stability of the peg to the USD.

Stability Pool Operations:

  • Deposit

    • Purpose: Users deposit SAT stable coins into the Stability Pool to participate in covering liquidations and earning returns from the pool's operations.

    • Usage:

      1. Enhance Pool Stability: By contributing to the pool, users help maintain overall system stability.

      2. Earn Returns: Participants can earn rewards based on the pool's performance and their contribution.

  • Withdraw

    • Purpose: Allows users to withdraw their deposited SAT stable coins from the Stability Pool, reducing their involvement but also their potential earnings.

    • Usage:

      1. Retrieve Liquidity: Users can withdraw their contributions for personal liquidity needs.

      2. Adjust Investment: Manage exposure to the Stability Pool based on market conditions or personal strategy changes.

  • Claim

    • Purpose: Allows users to claim accumulated collateral gains from the Stability Pool.

    • Usage: This function is crucial for users who have contributed to the pool and have earned returns as the pool liquidates troves that fall below the required collateral-to-debt ratio.

This SDK is built with flexibility in mind, supporting multiple blockchain networks and providing a rich set of features to engage with decentralized finance applications.

If you have any problems while developing, please don't hesitate to let us know. Contact us on Discord or Telegram.

Last updated