API
Minting and redeeming deUSD through Elixir's API is currently available only to whitelisted parties. Permissionless minting and redeeming deUSD will be enabled in December.
Addresses on Mainnet
deUSD token contract:
0x15700B564Ca08D9439C58cA5053166E8317aa138
Minting contract:
0x69088d25a635D22dcbe7c4A5C7707B9cc64bD114
Current supported tokens
USDT:
0xdAC17F958D2ee523a2206206994597C13D831ec7
Data structures
Quote
Field | Values | Description |
---|---|---|
collateral_asset | contract address (i.e | contract address of collateral asset |
collateral_amount | integer (i.e. 6 for USDT) | amount of collateral asset in native decimals |
deusd_amount | integer | amount of deUSD in 18 decimals |
timestamp | integer | UNIX timestamp in seconds |
expiry | integer | UNIX timestamp in seconds |
nonce | integer | any integer value |
quote_signature | signature (string) | signed EIP712 message with an Elixir address proving that we are sending the quotes |
Endpoints
Headers
Header | Value |
---|---|
X-API-KEY | API Key provided by Elixir |
Content-Type | application/json |
/quote
Request Body
Field | Values | Description |
---|---|---|
pair | string that looks like "AssetSymbol/deUSD" (i.e. "USDT/deUSD" or "WETH/deUSD" | available pairs for minting and redeeming |
Response Body
Field | Values | Description |
---|---|---|
pair | string that looks like "AssetSymbol/deUSD" (i.e. "USDT/deUSD" or "WETH/deUSD" | available pairs for minting and redeeming |
mint_quotes | Array of Quote | |
redeem_quotes | Array of Quote | |
gas_price | decimal | gas cost in USD |
/order
Request Body
Field | Values | Description |
---|---|---|
pair | string that looks like "AssetSymbol/deUSD" (i.e. "USDT/deUSD" or "WETH/deUSD" | Available pairs for minting and redeeming |
order_type | 0 or 1 | 0 for mint, 1 for redeem |
benefactor | address (string) | |
beneficiary | address (string) | |
quote | ||
order_expiry | integer | UNIX timestamp in seconds (majority of the time this will be the same as the expiry from quote) |
order_signature | signature (string) | signed EIP712 using hashOrder function from the Minting Contract |
Response Body
Field | Values | Description |
---|---|---|
order_id | integer | id of order |
/status
Request Body
Field | Values | Description |
---|---|---|
id | integer | order_id received after posting an /order |
Response Body
Field | Values | Description |
---|---|---|
order_id | integer | order_id from request body |
timestamp | integer | UNIX timestamp in milliseconds (when order was last updated) |
pair | string that looks like "AssetSymbol/deUSD" (i.e. "USDT/deUSD" or "WETH/deUSD" | |
order_type | OrderRequestType.MINT or OrderRequestType.REDEEM | |
collateral_asset | contract address (i.e | contract address of collateral asset |
collateral_amount | integer (i.e. 6 for USDT) | amount of collateral asset in native decimals |
deusd_amount | integer | amount of deUSD in 18 decimals |
timestamp | integer | UNIX timestamp in seconds |
expiry | integer | UNIX timestamp in seconds |
nonce | integer | any integer value |
benefactor | address | |
beneficiary | address | |
last_status | RECEIVED, NOT_RECEIVED, ACCEPTED, REJECTED, MINTING, MINTED, REDEEMING, REDEEMED, PENDING_REDEEM, PROCESSING, FAILED, COMPLETED | Possible status values as a string |
last_status_timestamp | integer | UNIX timestamp in seconds of when order was last updated |
txn_hash | string (transaction hash) | transaction hash of mint or redeem if accepted |
General minting and redeeming flow
Prerequisites:
For minting, make sure enough collateral is approved for Minting Contract to spend.
For redeeming, make sure enough deUSD is approved for Minting Contract to spend
Call /quote endpoint to receive a pricing ladder (mints and redeems) of Quote objects
Pick a generated Quote from /quote endpoint and construct an Order object
Sign the Order object using whitelisted wallet
Easiest way is to use call hashOrder on the Minting Contract
Send in an order with the Order object to /order endpoint and receive an order id
Query status of your order on the /status endpoint using the order id
Last updated