Skip to content

Latest commit

 

History

History
99 lines (76 loc) · 3.07 KB

sip-343.md

File metadata and controls

99 lines (76 loc) · 3.07 KB
sip network title author status created type proposal
343
Ethereum & Optimism
Add extra fields to existing Market Events to track market debt changes
Noisekit (@noisekit)
Implemented
2023-10-03
Governance

Simple Summary

In order to facilitate market's debt tracking over time, this proposal targets to extend existing market events in the Synthetix core system.

Motivation

The primary motivation behind this proposal is to provide a more comprehensive tracking system for changes in the market's debt. The added fields will enable analytics capabilities and in subgrapts to power UI, benefiting both developers and users.

Specification

Overview

Under this proposal, creditCapacity, netIssuance, depositedCollateralValue and reportedDebt fields would be added to MarketUsdDeposited, MarketUsdWithdrawn, MarketCollateralDeposited and MarketCollateralWithdrawn events, which will store the market's debt-relaeted data at the time of each event.

This will prevent the need to recalculate these values in the subgraph processor, thereby averting potential data discrepancies.

Technical Specification

The proposal suggests additions to existing events by introducing new fields. The enhanced event signatures would appear as follows:

    event MarketCollateralDeposited(
        uint128 indexed marketId
        address indexed collateralType
        uint256 tokenAmount
        address indexed sender
+       int128 creditCapacity
+       int128 netIssuance
+       uint256 depositedCollateralValue
+       uint256 reportedDebt
    );
    event MarketCollateralWithdrawn(
        uint128 indexed marketId
        address indexed collateralType
        uint256 tokenAmount
        address indexed sender
+       int128 creditCapacity
+       int128 netIssuance
+       uint256 depositedCollateralValue
+       uint256 reportedDebt
    );
    event MarketUsdDeposited(
        uint128 indexed marketId
        address indexed target
        uint256 amount
        address indexed market
+       int128 creditCapacity
+       int128 netIssuance
+       uint256 depositedCollateralValue
+       uint256 reportedDebt
    );
    event MarketUsdWithdrawn(
        uint128 indexed marketId
        address indexed target
        uint256 amount
        address indexed market
+       int128 creditCapacity
+       int128 netIssuance
+       uint256 depositedCollateralValue
+       uint256 reportedDebt
    );

Test Case

While this SIP doesn't necessitate additional test cases as it is non-breaking and just expands existing events with new fields, it's important that existing test cases receive updates to incorporate these extra properties.

Moreover, it's crucial to note that the UI and subgraphs consuming these events must be modified to accommodate these changes.

Configurable Values (Via SCCP)

N/A

Copyright

Copyright and related rights waived via CC0.