Overview
Ethena’s public API consists of 3 main endpoints. We offer the ability to stream indicative quotes, perform a formal RFQ and finally submitting of signed orders.
Only whitelisted users are able to successfully interact with the API interface. We recommend reaching out in our discord if you would like to be whitelisted.
Addresses on Ethereum mainnet
USDe: 0x4c9EDD5852cd905f086C759E8383e09bff1E68B3
Ethena Mint and Redeem Smart Contract: 0xe3490297a08d6fC8Da46Edb7B6142E4F461b62D3
These addresses are the production USDe and minting contract. Care should be taken using them as real value will be transferred.
Mint & Redeem Smart Contract ABI
Server location
Ethena's infrastructure is hosted on AWS Asia Pacific (Hong Kong) region, ap-east-1. Low latency with our infrastructure is necessary to algorithmically mint or redeem with Ethena as quotes are valid for limited time.
Connection URLs
Whitelisted users are able to use either https://public.api.ethena.fi
or https://private.api.ethena.fi
You must provide an IP address to be whitelisted if you wish to use the private.api.ethena.fi
connection URL. There is no difference in priority, performance, or rate limits between the two connection URLs.
SDKs
There are both Python and TypeScript SDKs available.
Approvals Added to Whitelisted Addresses
Ensure you have approved the Mint & Redeem Smart Contract for your whitelisted wallet addresses.
Pair Availability Endpoint
This endpoint returns the pairs available to directly mint & redeem with.
No parameters required
Our response
key
Possible values
Description
mint
["USDT/USDE", "USDC/USDE"]
The available pairs to directly mint with.
redeem
["USDT/USDE", "USDC/USDE"]
The available pairs to directly redeem with.
Example request
https://public.api.ethena.fi/asset-availability
Example response
RFQ Request Endpoint
Call the RFQ endpoint to receive a formal mint/redeem quote. Quotes are valid for 500 milliseconds upon us sending our response.
Your request
Key
Required
Possible values
Description
pair
true
USDT/USDe, USDC/USDe
collateral/usde pairs we support
side
true
mint,redeem
size
true
21.2918
size of asset you will send us. stETH for mint, USDe for redeem
benefactor
true
{benefactor_address}
String of the ETH wallet address
Our response
key
Possible values
Description
rfq_id
RFQ-B7MT6QD2JKFFC
Unique ID to be sent back to us when submitting order
pair
USDT/USDe, USDC/USDe
side
mint, redeem
size
1
size of asset you will send us. stETH for mint, USDe for redeem.
amount
1552.2695
amount of asset you will receive, before gas. USDe for mint, stETH for redeem.
collateral_asset_address
0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84
The non-USDe asset in the transaction
usde_address
0x8191DC3053Fe4564c17694cB203663d3C07B8960
Address of USDe
collateral_amount
1000000000000000000
Use this value for EIP712 signature. For mints, this is the same as size
but in 18 decimals. For redeems, this is amount
minus gas converted to stETH in 18 decimals
usde_amount
1550198770000000000000
Use this value for EIP712 signature. For redeems, this is the same as size
but in 18 decimals. For mint, this is amount
minus gas in 18 decimals
gas
2.070727513
the gas price of this tx in USD.
Example mint RFQ request
Response
Example redeem RFQ request
Response
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 500 milliseconds 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.
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
Response
The tx that went onchain
https://etherscan.io/tx/0xb0e5aad7c1e905b3dfe27dea73327eec6e31d89081e78e4442cd34aa5f9e41ae
EIP712 signature ORDER_TYPE
bytes32 private constant ORDER_TYPE = keccak256( "Order(uint8 order_type, uint256 expiry, uint256 nonce, address benefactor, address beneficiary, address collateral_asset, uint256 collateral_amount, uint256 usde_amount)" );
order key
values
Notes
order_type
0 or 1
0 for mint, 1 for redeem
expiry
1697334256
Use an expiry of current time + 45s
nonce
256
Use a unique int for each order. eg timestamp
benefactor
0x796Ee28CE42BF7bd43A09aCd43FAd0aACD7C3b29
address of signer. address where the asset is taken from (stETH for mint, USDe for redeem)
beneficiary
0x796Ee28CE42BF7bd43A09aCd43FAd0aACD7C3b29
address that receives funds. (USDe for mint, stETH for redeem).
collateral_asset
0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84
stETH address
collateral_amount
2369467000000000
Amount of stETH in 18 decimals. Use the exact value provided in RFQ
usde_amount
1645047190000000000
Amount of USDe in 18 decimals. Use the exact value provided in RFQ
Example raw order (before signing)
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.
Last updated