USDD 백서

bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 12쪽 중 5쪽

rocess 1. **Collateral Deposit and Minting**\ A user deposits collateral worth $1,500 and mints $1,000 USDD, maintaining a collateralization ratio of 150%. 2. **Market Downturn and Collateralization Ratio Drop**\ Due to a market downturn, the collateral value drops to $1,200, reducing the collateralization ratio to 120%, which is below the liquidation threshold of 130%. 3. **Liquidation Triggered**\ The system automatically flags the Vault for liquidation to protect the protocol from losses. 4. **Collateral Auction Begins** 1. The liquidation engine starts an auction for the $1,200 worth of collateral. 2. The auction follows a Dutch auction mechanism, where the price starts at a high initial value and gradually decreases over time until a bidder accepts the price or the auction ends. 5. **Keeper Participation** 1. Keepers, who are incentivized participants, place bids during the auction. 2. A Keeper bids an amount of USDD equal to the debt ($1,000) plus the liquidation penalty (10%), totaling $1,100. 3. The Keeper wins the auction by accepting the current auction price for the collateral. 6. **Collateral Settlement** 1. The protocol retains $1,100 worth of USDD to cover the debt and liquidation penalty. 2. Any remaining collateral value (after deducting the amount sold during the auction) is refunded to the user. 7. **Auction Outcome** 1. The Keeper receives the collateral at the auction price. For example, if the auction price is $0.95 per unit of collateral, the Keeper receives collateral valued at $1,157.89 ($1,100 ÷ $0.95). 2. The user retains any excess collateral that wasn't required to cover the debt and penalty. This process ensures the protocol remains solvent while providing opportunities for Keepers to acquire collateral at competitive prices and protecting users by refunding surplus collateral. \\ # Benefits * **Protects the Protocol Against Bad Debt**\ By swiftly addressing under-collateralized positions, the liquidation process safeguards the system from accumulating unmanageable debt, ensuring its financial health and sustainability. * **Maintains Trust in the System**\ Adhering to strict collateralization requirements reinforces user confidence in the stability and reliability of the USDD ecosystem. * **Stabilizes the USDD Peg**\ Liquidation and auction processes help maintain USDD’s 1:1 peg to the dollar by ensuring that collateral backing the stablecoin remains sufficient, even during market downturns. * **Enables Efficient Collateral Redistribution**\ Auctions redistribute liquidated collateral efficiently to market participants (Keepers) who value and purchase it, allowing for rapid system stabilization and collateral recirculation. * **Incentivizes Market Participation**\ Keepers are rewarded for participating in liquidations and auctions, creating an active ecosystem that enhances the protocol's responsiveness and liquidity. * **Strengthens System Resilience**\ The liquidation and auction mechanism enhances the protocol's ability to withstand extreme market volatility, ensuring decentralized, secure, and robust operations. This comprehensive process not only preserves the protocol’s integrity but also creates a self-sustaining loop of stability, transparency, and trust, which are critical to USDD’s long-term success in the DeFi ecosystem. \\ # Oracle An oracle module is deployed for each collateral type, feeding it the price data for a corresponding collateral type to the `Vat`. Every oracle module contains three main contracts: `Median, OSM, Spot`. ### Procedure 1. Median computes a price from a list of supported price feeds. 2. OSM updates the current price and the next price according to the price from Median. 3. Spot reads the current price from OSM and updates `ilk.spot` in `vat`. *USDD use Chainlink and WinkLink Data Feeds as its primary Oracles.* # USDD Public API USDD exposes a set of public, read-only REST APIs for protocol data — supply, yield, collateral, Vaults and Smart Allocator allocations. All endpoints are free to use, require no API key, and support CORS. *** ### 1. Common — Network & Auth <a href="#id-1" id="id-1"></a> <table><thead><tr><th width="188.87890625">Item</th><th>Value</th></tr></thead><tbody><tr><td>Base URL</td><td><mark style="color:blue;"><code>https://openapi.usdd.io</code></mark></td></tr><tr><td>Method</td><td><code>GET</code> only</td></tr><tr><td>Authentication</td><td>None — all endpoints are public, no API key</td></tr><tr><td>Content-Type</td><td><code>application/json</code> (except the two bare-number endpoints, §6.1 / §6.2)</td></tr><tr><td>CORS</td><td>Enabled — callable directly from browsers</td></tr><tr><td>Rate limit</td><td>No documented per-key limit; treat as best-effort and cache where possible</td></tr></tbody></table> All request examples below use the absolute Base URL, so they are copy-pasteable without consulting this table. *** ### 2. Common — Conventions <a href="#id-2" id="id-2"></a> #### 2.1 Response envelope <a href="#id-3" id="id-3"></a> Most endpoints return a standard JSON envelope: ```json { "code": 0, "message": "SUCCESS", "data": { ... } } ``` <table><thead><tr><th width="130.31640625">Field</th><th width="150.0703125">Type</th><th width="129.91796875">Existence</th><th>Description</th></tr></thead><tbody><tr><td>code</td><td>integer</td><td>always</td><td><code>0</code> = success; non-zero = error (see §3)</td></tr><tr><td>message</td><td>string</td><td>always</td><td><code>SUCCESS</code>, or an error description when <code>code != 0</code></td></tr><tr><td>data</td><td>object | array</td><td>always</td><td>Payload; shape depends on the endpoint</td></tr></tbody></table> Two endpoints — `GET /totalSupply` and `GET /circulatingSupply` — return a **bare numeric value** with no envelope. #### 2.2 Data conventions <a href="#id-4" id="id-4"></a> <table><thead><tr><th width="210.2109375">Topic</th><th>Convention</th></tr></thead><tbody><tr><td>Number types</td><td>Numeric fields may be returned as <code>number</code> or <code>string</code>; string-encoded numbers are exact and can be parsed safely as high-precision decimals</td></tr><tr><td>Precision</td><td>Some APY fields carry up to 29 digits of precision — transport them as strings and truncate (typically to 4 decimal places) for display</td></tr><tr><td><code>*DailyChange</code> fields</td><td>Change versus the previous day, based on the 00:00 UTC+8 daily snapshot; the value can be negative</td></tr><tr><td>Field stability</td><td>Published field names are not renamed within a version; new fields are added in a non-breaking way</td></tr></tbody></table> #### 2.3 Units <a href="#id-5" id="id-5"></a> Every response field table includes a `Unit` column. The possible values: <table><thead><tr><th width="160.3046875">Unit</th><th>Where it appears</th><th>How to read it</th></tr></thead><tbody><tr><td><code>USDD</code> / <code>sUSDD</code></td><td><code>totalSupply</code>, <code>mintedUSDD</code>, <code>curMinted</code>, <code>debt</code>, <code>line</code>, <code>usdd[]</code>, <code>susdd[]</code>, etc.</td><td>Token amount, already de-scaled. Use as-is; USDD and sUSDD are each ≈ 1 USD</td></tr><tr><td><code>USD</code></td><td><code>tvl</code>, <code>totalCollateralValue</code>, <code>earnTvl</code>, <code>earnSa</code>, <code>lockedValue</code>, <code>holdingAmount</code>, <code>*DailyChange</code>, etc.</td><td>Already de-scaled US dollars. Use as-is</td></tr><tr><td><code>decimal</code></td><td><code>tronApy</code>, <code>ethApy</code>, <code>bscApy</code>, <code>currentApy</code>, <code>stabilityFee</code>, <code>psmFee</code>, <code>earnApy</code>, etc.</td><td>Annualized rate as a decimal. <code>0.045</code> means 4.5% — multiply by 100 for a percentage</td></tr><tr><td><code>percent</code></td><td><code>apy</code> of <code>smart-allocator/detail-overview</code> only</td><td>Already a percentage. <code>3.4268</code> means 3.4268% — use as-is</td></tr><tr><td><code>ratio</code></td><td><code>collateralRatio</code>, <code>minCollateralRatio</code></td><td>A multiple. <code>2.6</code> means 260%; <code>1.2</code> means 120%</td></tr><tr><td><code>epoch ms</code></td><td><code>statisticTime</code></td><td>Millisecond Unix timestamp</td></tr><tr><td><code>datetime</code></td><td><code>time</code></td><td>Human-readable date-time string (UTC+8)</td></tr><tr><td><code>address</code></td><td><code>contractAddress</code>, <code>operatorAddress</code></td><td>Blockchain address — TRON Base58 or EVM hex depending on chain</td></tr><tr><td><code>enum</code></td><td><code>chain</code></td><td>One value from a fixed set, e.g. <code>tron</code> / <code>eth</code> / <code>bsc</code></td></tr><tr><td><code>text</code></td><td><code>symbol</code>, <code>ilk</code>, <code>vaultType</code>, <code>platform</code>, <code>gemSymbol</code>, <code>strategy</code>, <code>tag</code></td><td>Free-form string identifier</td></tr><tr><td><code>—</code></td><td><code>items[]</code> and other array containers</td><td>The row is a container, not a value — it has no unit</td></tr></tbody></table> #### 2.4 Existence column <a href="#id-6" id="id-6"></a> Response field tables include an `Existence` column so an agent knows whether a missing or null value is normal: <table><thead><tr><th width="169.91015625">Existence</th><th>Meaning</th></tr></thead><tbody><tr><td><code>always</code></td><td>The field is always present with a non-null value</td></tr><tr><td><code>nullable</code></td><td>The field is always present, but its value may be <code>null</code></td></tr><tr><td><code>conditional</code></td><td>The field is present only when a stated condition holds</td></tr></tbody></table> #### 2.5 Empty result ≠ error <a href="#id-7" id="id-7"></a> An empty or zero-valued result is a **successful** response, not an error.\ Examples: a Vault with no debt returns `curMinted: "0"` and `totalCollateral: "0"`; a chain with no Earn deployment returns `earnTvl: 0`. Do not treat these as failures or retry them. #### 2.6 Context tips <a href="#id-8" id="id-8"></a> Several endpoints return long arrays — the APY history (§6.8), supply history (§6.9), collateral history (§6.10) and per-chain history (§6.13). When only the latest point is needed, read the last array element instead of loading the full series, and prefer the snapshot endpoints (§6.1, §6.6, §6.12) over history endpoints. *** ### 3. Common — Errors <a href="#id-9" id="id-9"></a> **Error model.** Business-level errors are returned as **HTTP 200** with a non-zero `code` in the JSON envelope; the HTTP status is not used to signal business errors. The only exception is an unknown URL path, which returns a real **HTTP 404** with a non-JSON nginx page. An agent should therefore branch on the `code` field, not on the HTTP status (except for routing 404s). #### 3.1 Code table <a href="#id-10" id="id-10"></a> <table><thead><tr><th width="140.203125">code</th><th width="249.56640625">message</th><th>Meaning</th></tr></thead><tbody><tr><td>0</td><td><code>SUCCESS</code></td><td>Request succeeded</td></tr><tr><td>1</td><td><code>FAIL</code></td><td>Request failed</td></tr><tr><td>404</td><td><code>NOT_FOUND</code></td><td>URI does not exist</td></tr><tr><td>500</td><td><code>INTERNAL_SERVER_ERROR</code></td><td>Internal server error</td></tr><tr><td>10001</td><td><code>PARAMETER_MISSING</code></td><td>A required parameter is missing</td></tr><tr><td>10002</td><td><code>PARAMETER_ERROR</code></td><td>A parameter value is invalid</td></tr></tbody></table> #### 3.2 Common error cases <a href="#id-11" id="id-11"></a> <table><thead><tr><th width="235.06640625">Case</th><th>Trigger</th><th>Actual response</th></tr></thead><tbody><tr><td>Missing required parameter</td><td>Omit <code>chain</code> on §6.12, or <code>chain</code>/<code>interval</code> on §6.13</td><td>HTTP 200, <code>code: 1</code>, message <code>Required request parameter '...' is not present</code></td></tr><tr><td>Invalid parameter value</td><td>Unsupported <code>chain</code> (e.g. <code>solana</code>) or <code>interval</code></td><td>HTTP 200, <code>code: 10002</code>, message <code>Invalid chain.</code> / <code>Invalid interval.</code></td></tr><tr><td>Unknown path</td><td>Request a path that does not exist</td><td>HTTP 404, non-JSON nginx page</td></tr></tbody></table> > Note: code `10001 PARAMETER_MISSING` is defined, but a fully absent required query parameter currently returns `code: 1` via framework-level validation. *** ### 4. Endpoint Index <a href="#id-12" id="id-12"></a> <table><thead><tr><th width="99.95703125">#</th><th width="99.83203125">Group</th><th>Name</th><th>Path</th></tr></thead><tbody><tr><td>6.1</td><td>A</td><td>Total Supply</td><td><code>GET /totalSupply</code></td></tr><tr><td>6.2</td><td>A</td><td>Circulating Supply</td><td><code>GET /circulatingSupply</code></td></tr><tr><td>6.3</td><td>A</td><td>Earn APY</td><td><code>GET /api/v1/external/earn-apy</code></td></tr><tr><td>6.4</td><td>A</td><td>USDD Supply by Chain</td><td><code>GET /api/v1/external/total-supply/usdd</code></td></tr><tr><td>6.5</td><td>A</td><td>sUSDD Supply by Chain</td><td><code>GET /api/v1/external/total-supply/susdd</code></td></tr><tr><td>6.6</td><td>B</td><td>Protocol Overview</td><td><code>GET /api/v1/market-site/overview</code></td></tr><tr><td>6.7</td><td>B</td><td>Protocol Overview (with 24h change)</td><td><code>GET /api/v1/data-platform/overview/info</code></td></tr><tr><td>6.8</td><td>B</td><td>DSR APY (current / average / history)</td><td><code>GET /api/v1/market-site/overview/apy</code></td></tr><tr><td>6.9</td><td>B</td><td>USDD Total Supply History</td><td><code>GET /api/v1/data-platform/overview/supply-value-history</code></td></tr><tr><td>6.10</td><td>B</td><td>Total Collateral Value History</td><td><code>GET /api/v1/data-platform/overview/collateral-value-history</code></td></tr><tr><td>6.11</td><td>B</td><td>Vault Configuration List</td><td><code>GET /api/v1/vault/collaterals</code></td></tr><tr><td>6.12</td><td>B</td><td>Per-chain Collateral Snapshot</td><td><code>GET /api/v1/data-platform/latest-collateral</code></td></tr><tr><td>6.13</td><td>B</td><td>Per-chain Historical Series</td><td><code>GET /api/v1/data-platform/collateral-history</code></td></tr><tr><td>6.14</td><td>B</td><td>Smart Allocator Detail</td><td><code>GET /api/v1/smart-allocator/detail-overview</code></td></tr></tbody></table> *** ### 5. Endpoint Reference <a href="#id-13" id="id-13"></a> ### 6.1 Total Supply <a href="#id-14" id="id-14"></a> **Overview.** True total supply of USDD: USDD in circulation + sUSDD.\ Typical use: a single headline supply figure.\ When not to use: for a per-chain breakdown use §6.4 / §6.5; for USD value use §6.6. **Endpoint.** `GET /totalSupply` — Base URL & auth see §1. **Request parameters.** None. **Request example.** ```bash curl "https://openapi.usdd.io/totalSupply" ``` **Response.** A bare numeric value (no JSON envelope), unit `USDD`. ```json 1541470086 ``` **Errors.** See §3. This endpoint takes no parameters, so only routing 404 or 5xx apply. *** ### 6.2 Circulating Supply <a href="#id-15" id="id-15"></a> **Overview.** True circulating supply of USDD: USDD in circulation + sUSDD.\ Typical use: a single headline circulating-supply figure.\ When not to use: same as §6.1. **Endpoint.** <mark style="color:blue;">`GET /circulatingSupply`</mark> — Base URL & auth see §1. **Request parameters.** None. **Request example.** ```bash curl "https://openapi.usdd.io/circulatingSupply" ``` **Response.** A bare numeric value (no JSON envelope), unit `USDD`. ```json 1541470086 ``` **Errors.** See §3. *** ### 6.3 Earn APY <a href="#id-16" id="id-16"></a> **Overview.** Current Earn (DSR) annual yield for each chain.\ Typical use: show the current savings rate per chain.\ When not to use: for historical APY use §6.8. **Endpoint.** <mark style="color:blue;">`GET /api/v1/external/earn-apy`</mark> — Base URL & auth see §1. **Request parameters.** None. **Request example.** ```bash curl "https://openapi.usdd.io/api/v1/external/earn-apy" ``` **Response fields.** <table><thead><tr><th width="105.4765625">Field</th><th width="110.29296875">Type</th><th width="114.95703125">Existence</th><th width="110.49609375">Unit</th><th>Description</th></tr></thead><tbody><tr><td>tronApy</td><td>string</td><td>always</td><td>decimal</td><td>Earn APY on TRON, 4 decimal places (<code>0.0400</code> = 4.00%)</td></tr><tr><td>ethApy</td><td>string</td><td>always</td><td>decimal</td><td>Earn APY on Ethereum, 4 decimal places</td></tr><tr><td>bscApy</td><td>string</td><td>always</td><td>decimal</td><td>Earn APY on BNB Chain, 4 decimal places</td></tr></tbody></table> **Response example.** ```json { "code": 0, "message": "SUCCESS", "data": { "tronApy": "0.0400", "ethApy": "0.0400", "bscApy": "0.0400" } } ``` **Errors.** See §3. *** ### 6.4 USDD Supply by Chain <a href="#id-17" id="id-17"></a> **Overview.** USDD circulating supply (excluding sUSDD), broken down by chain. Refreshes every 5 minutes.\ Typical use: per-chain USDD distribution.\ When not to use: for the combined supply use §6.1; for sUSDD use §6.5. **Endpoint.** <mark style="color:blue;">`GET /api/v1/external/total-supply/usdd`</mark> — Base URL & auth see §1. **Request parameters.** None. **Request example.** ```json curl "https://openapi.usdd.io/api/v1/external/total-supply/usdd" ``` **Response fields.** <table><thead><tr><th width="120.14453125">Field</th><th width="104.63671875">Type</th><th width="115.29296875">Existence</th><th width="110.453125">Unit</th><th>Description</th></tr></thead><tbody><tr><td>symbol</td><td>string</td><td>always</td><td>text</td><td>Always <code>USDD</code></td></tr><tr><td>totalSupply</td><td>number</td><td>always</td><td>USDD</td><td>USDD in circulation across all chains, excluding sUSDD</td></tr><tr><td>tron</td><td>number</td><td>always</td><td>USDD</td><td>USDD supply on TRON</td></tr><tr><td>eth</td><td>number</td><td>always</td><td>USDD</td><td>USDD supply on Ethereum</td></tr><tr><td>bsc</td><td>number</td><td>always</td><td>USDD</td><td>USDD supply on BNB Chain</td></tr></tbody></table> **Response example.** ```json { "code": 0, "message": "SUCCESS", "data": { "symbol": "USDD", "totalSupply": 1251507751.55, "tron": 1188091183.19, "eth": 59487923.50, "bsc": 3928644.86 } } ``` **Errors.** See §3. *** ### 6.5 sUSDD Supply by Chain <a href="#id-18" id="id-18"></a> **Overview.** sUSDD supply broken down by chain. Refreshes every 5 minutes.\ Typical use: per-chain sUSDD distribution.\ When not to use: for USDD use §6.4. **Endpoint.** <mark style="color:blue;">`GET /api/v1/external/total-supply/susdd`</mark> — Base URL & auth see §1. **Request parameters.** None. **Request example.** ```bash curl "https://openapi.usdd.io/api/v1/external/total-supply/susdd" ``` **Response fields.** <table><thead><tr><th width="119.640625">Field</th><th width="120.1640625">Type</th><th width="116.8671875">Existence</th><th width="109.59765625">Unit</th><th>Description</th></tr></thead><tbody><tr><td>symbol</td><td>string</td><td>always</td><td>text</td><td>Always <code>sUSDD</code></td></tr><tr><td>totalSupply</td><td>number</td><td>always</td><td>sUSDD</td><td>sUSDD supply across all chains</td></tr><tr><td>tron</td><td>number</td><td>always</td><td>sUSDD</td><td>sUSDD supply on TRON</td></tr><tr><td>eth</td><td>number</td><td>always</td><td>sUSDD</td><td>sUSDD supply on Ethereum</td></tr><tr><td>bsc</td><td>number</td><td>always</td><td>sUSDD</td><td>sUSDD supply on BNB Chain</td></tr></tbody></table> **Response example.** ```json { "code": 0, "message": "SUCCESS", "data": { "symbol": "sUSDD", "totalSupply": 275673868.67, "tron": 0, "eth": 260154414.60, "bsc": 15519454.07 } } ``` **Errors.** See §3. A chain with no sUSDD returns `0` — empty ≠ error (§2.5). *** ### 6.6 Protocol Overview <a href="#id-19" id="id-19"></a>
프로젝트로 돌아가기