🧞‍♂️Technical Architecture

Terminology

  • Collateralized Debt Position (CDP)

    • A position where a Borrower gains access to a specified amount of stablecoin, such as a USD-equivalent token.

  • Cross-Chain CDP

    • A CDP where the collateral is securely stored on one network while the stablecoin is issued on a different network.

  • Loan-To-Value (LTV)

    • The ratio of the borrowed debt to the deposited collateral, expressed as a percentage. It represents how much debt a user has taken compared to the value of the collateral provided.

  • Maximum LTV

    • The highest allowable ratio of debt to collateral (after USD conversion of both) before the position is considered under-collateralized and subject to liquidation.

Actors

  • Depositor

    • A user who deposits $XLM tokens on the Stellar network.

  • Borrower

    • A Depositor who opens a borrow position on a target network using their collateral stored on Stellar.

  • Provider

    • A participant who supplies liquidity on target network(s) and earns protocol fees as compensation.

  • Liquidator

    • An actor that monitors under-collateralized debt positions and executes liquidation transactions on-chain. The Liquidator repays the stablecoin debt on the target network and receives the corresponding collateral on the source network.

  • Price Resolver

    • Monitors deposit events on the Stellar network and converts the deposited $XLM amount to its USD equivalent in real time, utilizing an oracle for accurate pricing.

Borrow Flow

  1. The Depositor places a specified amount of $XLM tokens on the Stellar network.

  2. The logic or proxy contract on Stellar updates the internal mapping and emits an event.

  3. The event is handled by an off-chain Price Resolver, which tracks current Depositor collateral balances and monitors networks, functioning as the first Liquidator.

  4. The Depositor claims stablecoins (loan) on the target network, thus becoming a Borrower.

  5. The Borrower pays back the loan plus interest, closing the borrow position.

  6. Interest accumulates proportionally across all Providers.

Supply Flow

  1. A Provider supplies $pUSD on the target network.

  2. The Provider earns interest based on the repaid borrow positions on the target network.

  3. The Provider can withdraw their supply position along with the accumulated interest as of the moment of withdrawal on the target network.

Liquidation Flow

  1. The Liquidator actively monitors the state of current debt positions, ensuring no position is undercollateralized.

  2. If the Liquidator identifies one or more undercollateralized positions, they call the batchLiquidate(positionId[]) method, repaying the debt on the target network.

  3. The Liquidator can then claim the collateral on the Stellar network, providing proof that the debt has been repaid on the target network.

Liquidation Models & Scenarios

  • Partial Liquidation: If a Borrower’s LTV crosses the maximum threshold, the protocol (or any Liquidator) sells only a portion of the user’s XLM to bring the LTV back to a safe range.

  • Full Liquidation: In severe conditions or if the ratio becomes extremely unsafe, the protocol may liquidate the entire position.

  • Oracle & Fallback: Multiple price feeds reduce the risk of inaccurate pricing. Should an oracle fail, Polariz reverts to secondary sources or pauses further liquidations until accurate data is restored.

  • Emergency Shutdown (Planned Feature): Governance (multisig with Stellar foundation and other community trusted parties) can pause minting or forcibly unwind positions in catastrophic scenarios, safeguarding the stablecoin’s overall health.

Last updated