Ethena 백서

Ethena

원문

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

| Type\_ value is not supported. | ## Fees Endpoint Call the Fees endpoint to retrieve the fee schedule. The endpoint returns the applicable fees (in basis points) for each supported token. ### Your Request | Key | Type | Required | Description | | ------------ | ------ | -------- | ----------------------------------------------------------------------------------- | | `benefactor` | string | Yes | The Ethereum wallet address to check fees for. Must be a valid checksummed address. | ### Our Response | Key | Type | Description | | ----------------------- | ------ | ---------------------------------------------------------------------------------------------------------------- | | `benefactor` | string | The checksummed Ethereum address that was queried. | | `fees` | array | Array of fee objects for each supported token. | | `fees[].token` | string | The token symbol (e.g., "USDT", "USDC"). | | `fees[].fee_bps` | float | The fee in basis points (1 bps = 0.01%). NOTE: this field is deprecated and will be removed in a future release. | | `fees[].mint_fee_bps` | float | The fee in basis points (1 bps = 0.01%). | | `fees[].redeem_fee_bps` | float | The fee in basis points (1 bps = 0.01%). | ### Example Request ``` GET https://public.api.ethena.fi/fees?benefactor=0x0000000000000000000000000000000000000020 ``` ### Example Response ```json { "benefactor": "0x0000000000000000000000000000000000000020", "fees": [ { "token": "USDT", "fee_bps": 10.0, "mint_fee_bps": 10.0, "redeem_fee_bps": 10.0 }, { "token": "USDC", "fee_bps": 10, "mint_fee_bps": 10.0, "redeem_fee_bps": 10.0 }, { "token": "DAI", "fee_bps": 15, "mint_fee_bps": 15.0, "redeem_fee_bps": 10.0 } ] } ``` ### Fee Calculation * Fees are expressed in **basis points (bps)**, where 1 bps = 0.01% * For example, a fee of `10` bps means a 0.10% fee will be applied * Different tokens may have different fee rates ### Error Codes | Error Code | Error Name | HTTP Status | Description | | ---------- | ------------------------------------------ | ----------- | ----------------------------------------------------------------------------------------------------- | | `1` | Temporarily unavailable, please try again. | 400 | No fee data is currently available, or there was an error retrieving fees. Please retry your request. | | `29` | Invalid payload | 400 | The `benefactor` parameter is missing or the provided address is not a valid Ethereum address. | ### Orders Submission Endpoint After receiving the RFQ response, if you wish to execute the order as quoted, sign an EIP-712 signature using the usde\_amount and collateral\_amount values. Our system only accepts orders with matching values for the 2 fields, and if the order is submitted and received within 15 minutes of our previous RFQ response. The order process has no interaction with the smart contracts as Ethena receives your orders, passes them through checks, then submits the order onchain. For EIP-1271 users, you must add the signature\_type parameter with the value EIP1271 to the request. The default is EIP712 so the former is only required if you're using EIP-1271. `url = {ethena_url}order?signature={signature_hex}&signature_type=EIP1271` **Example payload** | key | value | Description | | --------- | ------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------- | | signature | 0xf80a44c799d13f257fa25459a9e2d36dadfea48a78f699de3f09fc3009a0e92d63b51ce85003c95cd7f4b80c271659092b898192d83fcd0dc1e3aae7483d59931b | Resulting signature from signing the order | | order | See EIP712 signature ORDER\_TYPE below | The order in plain json that they used to sign and create the signature | {% code overflow="wrap" %} ``` curl -d '{ "order_id": "RFQ-N9Y9T2Z6MXFNS", "benefactor": "0x0000000000000000000000000000000000000020", "beneficiary": "0x0000000000000000000000000000000000000020", "collateral_amount": "8995495840000", "collateral_asset": "0xdAC17F958D2ee523a2206206994597C13D831ec7", "expiry": 1764067729, "nonce": 1727791471438686, "order_type": "MINT", "usde_amount": "8999996000000000000000000" }' -H "Content-Type: application/json" -X POST "https://public.api.ethena.fi/order?signature=0xd7c436757d3b7f6fc0c7a3adb2a68d7b48a4bbf08daff521629e0a081466e15f0b8a08bab0a67e90d9d2e0307e021b2530abea5c71b36ba21a2982a6f5d855e31c" ``` {% endcode %} **Response** ``` { "tx":"0xbf4d5dce0e482b7cfd3e0ac714a0bb1b67d2c777668048e257b7fd3e9fb68980" } ``` **The tx that went onchain** `https://etherscan.io/tx/0xbf4d5dce0e482b7cfd3e0ac714a0bb1b67d2c777668048e257b7fd3e9fb68980` **EIP712 signature ORDER\_TYPE** `bytes32 private constant ORDER_TYPE = keccak256( "Order(string order_id, uint8 order_type, uint256 expiry, uint256 nonce, address benefactor, address beneficiary, address collateral_asset, uint256 collateral_amount, uint256 usde_amount)" );` **Comment** | order key | values | Notes | | ------------------ | ------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | | order\_id | RFQ-N9Y9T2Z6MXFNS | Unique identifier returned in the RFQ endpoint response. This ID must be included when submitting the order. | | order\_type | 0 or 1 | 0 for mint, 1 for redeem | | expiry | 1764067729 | Use an expiry of current time + 45s | | nonce | 256 | Use a unique int for each order. eg timestamp | | benefactor | 0x0000000000000000000000000000000000000020 | Address of signer. address where the asset is taken from (USDT for mint, USDe for redeem) | | beneficiary | 0x0000000000000000000000000000000000000020 | Address that receives funds. (USDe for mint, USDT for redeem). | | collateral\_asset | 0xdAC17F958D2ee523a2206206994597C13D831ec7 | USDT address | | collateral\_amount | 8995495840000 | Amount of USDT in 18 decimals. Use the exact value provided in RFQ | | usde\_amount | 8999996000000000000000000 | Amount of USDe in 18 decimals. Use the exact value provided in RFQ | **Example raw order (before signing)** ``` { "order_id": "RFQ-N9Y9T2Z6MXFNS" "benefactor":"0x0000000000000000000000000000000000000020", "beneficiary":"0x0000000000000000000000000000000000000020", "collateral_amount":"8995495840000", "collateral_asset":"0xdAC17F958D2ee523a2206206994597C13D831ec7", "expiry":1764067729, "nonce":1727791471438686, "order_type":"MINT", "usde_amount":"8999996000000000000000000" } ``` **Our response** We will either respond with a tx hash, where your order passed our checks and is sent to the blockchain or a failure message with a reason for failure. The most common failure reasons include an invalid EIP-712 signature, submitting an order after the quote has expired or not having sufficient assets in your address for the mint or redeem. **One Order per RFQ** Each RFQ is **single-use**. Once an RFQ id has been used to execute an order, it is consumed and cannot be reused — even if you re-sign the quote with a new nonce or expiry. Submitting a second order against a consumed RFQ is rejected with **409 Conflict** (error code 37). #### Error Codes | Error Code | HTTP Status Code | Message | | ---------- | ---------------- | ------------------------------------------------------------------------------------------------------------ | | 1 | 400 | Temporarily unavailable | | 10 | 400 | Wallet address not whitelisted. Please contact Ethena. | | 11 | 400 | Insufficient collateral asset in wallet. | | 12 | 400 | Insufficient collateral asset approval for Ethena to transfer. | | 13 | 400 | Insufficient usde balance in wallet. | | 14 | 400 | Insufficient usde approval for Ethena to transfer. | | 15 | 400 | Invalid signature. | | 16 | 400 | Order payload invalid or does not match RFQ. | | 17 | 400 | Size greater than available capacity for this block. | | 18 | 400 | RFQ expired. | | 19 | 400 | Invalid RFQ. | | 20 | 400 | Please try again. The market moved too much. | | 21 | 400 | Execution request already being processed. | | 22 | 400 | Already successfully executed this block. | | 23 | 400 | Present time greater than order expiry. Execution not submitted to blockchain. | | 24 | 400 | Duplicate nonce | | 25 | 400 | Benefactor not whitelisted | | 26 | 400 | Beneficiary not whitelisted. User on-chain transaction required. | | 27 | 400 | Incorrect USDe minter. Switch Minting API | | 28 | 429 | Benefactor has reached throttle limit. Please wait until the limit resets or contact support for assistance. | | 29 | 400 | Invalid payload | | 30 | 400 | Invalid address | | 31 | 400 | Fees not applicable | | 32 | 400 | Slippage is too high for delegate-signed order | | 33 | 400 | No pricing source found for validating asset price with alternative source | | 34 | 400 | Insufficient minting contract balance | | 35 | 404 | Order not found. Please verify the order ID is correct. | | 36 | 202 | Order submitted but transaction not yet mined. Please wait and try again. | | 37 | 409 | This RFQ has already been used to execute an order. Each RFQ is single-use — please request a new quote. | ### Order Confirmation Endpoint After submitting an order, you can check its execution status using the order confirmation endpoint. This is useful for: * Confirming your order was executed on-chain * Checking if a transaction is still pending * Understanding why an order was rejected before execution **Your request** | Key | Required | Possible Values | Description | | --------- | -------- | ----------------- | ------------------------------------------------------------ | | order\_id | true | RFQ-ABC123XYZ4567 | The RFQ ID returned from the RFQ endpoint. Case-insensitive. | **Note:** The `order_id` can be provided with or without the `RFQ-` prefix. Both `RFQ-ABC123XYZ4567` and `ABC123XYZ4567` are accepted and normalized to uppercase. **Example request** <https://public.api.ethena.fi/order-confirmation?order_id=RFQ-ABC123XYZ4567> **Our response** The response varies based on the order status: | Status | HTTP Code | Description | | ---------- | --------- | ----------------------------------------------------------- | | executed | 200 | Order was successfully executed on-chain | | reverted | 200 | Order was submitted but reverted on-chain | | pending | 202 | Order submitted but transaction not yet mined | | rejected | 400 | Order failed validation and was not submitted to blockchain | | not\_found | 404 | No order found with this ID | **Example response: Executed order** ``` { "order_id": "RFQ-ABC123XYZ4567", "tx_hash": "0xbf4d5dce0e482b7cfd3e0ac714a0bb1b67d2c777668048e257b7fd3e9fb68980", "status": "executed", "etherscan_link": "https://etherscan.io/tx/0xbf4d5dce0e482b7cfd3e0ac714a0bb1b67d2c777668048e257b7fd3e9fb68980" } ``` **Example response: Pending order** ``` { "error": { "error_name": "Order submitted but transaction not yet mined. Please wait and try again.", "error_code": "36" }, "order_id": "RFQ-ABC123XYZ4567", "tx_hash": "0xbf4d5dce0e482b7cfd3e0ac714a0bb1b67d2c777668048e257b7fd3e9fb68980", "status": "pending", "etherscan_link": "https://etherscan.io/tx/0xbf4d5dce0e482b7cfd3e0ac714a0bb1b67d2c777668048e257b7fd3e9fb68980" } ``` **Example response: Rejected order (failed validation)** ``` { "error": { "error_name": "Insufficient collateral asset in wallet.", "error_code": "11" }, "order_id": "RFQ-ABC123XYZ4567", "status": "rejected" } ``` **Example response: Order not found** ``` { "error": { "error_name": "Order not found. Please verify the order ID is correct.", "error_code": "35" }, "order_id": "RFQ-NOTFOUND12345", "status": "not_found" } ``` **Example response: Invalid order\_id format** HTTP Status: 400 ``` { "error": "Order ID is malformed or incorrect. Expected format: RFQ-XXXXXXXXXXXXX", "order_id": "INVALID" } ``` **Error Codes** | Error Code | HTTP Status Code | Message | | ---------- | ---------------- | ------------------------------------------------------------------------- | | 1 | 400 | Temporarily unavailable | | 29 | 400 | Invalid payload (missing order\_id) | | 35 | 404 | Order not found. Please verify the order ID is correct. | | 36 | 202 | Order submitted but transaction not yet mined. Please wait and try again. | **Recommended Polling Strategy** For programmatic usage, we recommend: 1. After submitting an order, wait 5-10 seconds before first poll 2. Poll the endpoint every 5 seconds 3. Stop polling when status is `executed`, `reverted`, or `rejected` 4. Timeout after 5 minutes if order remains `pending` <br> # How to Buy USDe USDe can be acquired on the secondary market or minted directly through the Ethena protocol. {% embed url="<https://youtu.be/Bp-zX3Q0FE0>" %} [Using the UI](https://app.ethena.fi/swap), non-whitelisted users are able to exchange stablecoins for USDe by accessing external liquidity pools available:<br> 1. The user requests to ***buy*** USDe via the dApp interface by selecting a stablecoin asset to exchange for USDe.&#x20; 2. This transaction is routed using MEV protection through CowSwap to various onchain liquidity pools in exchange for USDe. 3. This abstracts away the complexity for all users allowing stablecoins as an input asset, and causes small imbalances in the onchain AMM pools which triggers an opportunity for market makers to proceed with the mint workflow outlined below. Users may also exchange fiat for USDe using our partners [Alchemy Pay](https://ramp.alchemypay.org/?appId=VmpUX9X3MIL36oJ3) and [Transak](https://global.transak.com/?apiKey=39b3a98c-bf84-4f37-a523-472e9777fdb7\&cryptoCurrencyCode=USDE). Minting USDe is the process of sending backing assets to the Ethena protocol in exchange for USDe. Redeeming USDe is the process of burning USDe in exchange for backing assets. Whitelisted users can ***mint*** or ***redeem*** USDe via our API or through the "Mint" tab in the app, which is only visible to whitelisted users. # How to Stake USDe Staking USDe enables holders to receive the protocol's generated rewards *The information contained in the following video or on this website is not directed at persons with their habitual residence or registered office in the European Union, European Economic Area, or United Kingdom.* {% embed url="<https://www.youtube.com/watch?v=sXXflLyuqDg>" %} Users in permitted jurisdictions can [**stake** & **unstake**](https://app.ethena.fi/) *USDe*/*sUSDe* via the UI. Using the UI, the **staking & unstaking** *USDe*/*sUSDe* user workflow is: 1. The user requests to **stake/unstake** *USDe*/*sUSDe* via the dApp interface by clicking "Stake"/"Unstake", which pops up their selected wallet to sign the requested transaction. 2. After the user signs the transaction with their wallet, the transaction is submit to the blockchain. 3. Upon successful confirmation of the transaction, the user receives *sUSDe*/*USDe* as their *USDe*/*sUSDe* is atomically swapped via autonomous smart contract.&#x20; #### Important to Note * Users do NOT need to do anything but hold *sUSDe* to accrue rewards. &#x20; * Rewards aren’t earned directly by *sUSDe* holders; rather, they accumulate within the staking contract, which results in the "value" of *sUSDe* rising over time in USDe terms. Users are able to unstake their s*USDe* at any time, at which point they receive an amount *USDe* reflecting the staked amount plus any increase from the time the user staked until unstaking. * The amount of *sUSDe* a user will receive when staking *USDe* will depend on the current value of *sUSDe.* At launch the value was 1 *sUSDe* = 1 *USDe*, and *sUSDe* is expected to slowly increase in value in USDe terms as protocol discretionary rewards are transferred into the Staking smart contract. * This is because *sUSDe* was implemented using a token vault mechanism to provide protocol level incentive rewards to permitted users. This mechanic is similar to [Rocketpool's rETH](https://docs.rocketpool.net/guides/staking/overview.html#the-reth-token). * Therefore, while a staker might receive less *sUSDe* than *USDe* staked, the value of the *sUSDe* in USDe terms will always be equal to or greater than the *USDe* staked. * sUSDe is subject to a cooldown period before USDe can be withdrawn. The cooldown is dynamic (currently between 1 and 7 days) depending on reserve conditions; the current parameters are set by governance. {% hint style="info" %} Users can only receive a positive or zero rewards holding *sUSDe*. The value of *sUSDe* will NOT decline, even in periods where the protocol is earning negative income, as the protocol does not and cannot remove assets from the staking contract. Such periods are expected to be covered by the Reserve Fund, to be discussed later. {% endhint %} # How to Stake ENA Staking ENA enables holders to receive the protocol's generated rewards Users in permitted jurisdictions can **stake** & **unstake** *ENA*/*sENA* with Ethena via the UI. Using the UI, the **staking & unstaking** *ENA*/*sENA* user workflow is: 1. The user requests to **stake/unstake** *ENA*/*sENA* via the dApp interface by clicking "Stake"/"Unstake", which pops up their selected wallet to sign the requested transaction. 2. After the user signs the transaction with their wallet, the transaction is submit to the blockchain. 3. Upon successful confirmation of the transaction, the user receives *sENA*/*ENA* as their *ENA*/*sENA* is atomically swapped.&#x20; #### Important to Note * Users do NOT need to do anything but hold *sENA* to receive incentive rewards. &#x20; * Rewards aren’t earned directly by *sENA* holders; rather, it accumulates within the staking contract, which results in the "value" of *sENA* rising over time in *ENA* terms. Users are able to unstake their *sENA* at any time, at which point they receive an amount *sENA* reflecting the staked amount plus any increase in value of *sENA* in ENA terms from the time the user staked until unstaking. * The amount of *sENA* a user will receive when staking *sENA* will depend on the current value of *sENA.* At launch the value was 1 *sENA* = 1 *ENA*, but *sENA* is expected to slowly increase in value as distributions are transferred into the staking smart contract. * This is because *sENA* was implemented using a token vault mechanism to provide protocol level rewards to permitted users. This mechanic is similar to [Rocketpool's rETH](https://docs.rocketpool.net/guides/staking/overview.html#the-reth-token). * Therefore, while a staker might receive less *sENA* than *ENA* staked, the value of the *sENA* will always be equal to or greater than the *ENA* you staked in *ENA* terms. * There is a cooldown period of 7 days after unstaking *sENA, ENA* will be available to withdraw after that period. * Distributions of ENA to the sENA contract are purely discretionary. In late 2024 and early 2025, unclaimed ENA grants from Ethena's Season 1 airdrop were distributed to sENA. As of September 2025, however, no distributions are in effect or announced. # How to \[Un]lock positions Locking tokens and positions enables holders to receive the protocol's generated rewards Users in permitted jurisdictions can [**lock** & **unlock**](https://app.ethena.fi/overview) positions with Ethena via the UI. Using the UI, the **locking & unlocking** positions user workflow is: 1. The user requests to **lock/unlock** positions via the dApp interface by clicking "Lock"/"Unlock", which pops up their selected wallet to sign the requested transaction. 2. After the user signs the transaction with their wallet, the transaction is submit to the blockchain, if successful, the cooldown period starts. 3. Once the cooldown period ends, the user now needs to click on "Withdraw" and sign a second transaction. 4. Upon successful confirmation of the transaction, the user receives unlocked tokens. #### Important to Note * There is a cooldown period of 7 days after unlocking *USDe, USDe* will be ava
프로젝트로 돌아가기