Redeeming Stablecoins
Last updated
Last updated
ERC20 aTerra tokens (e.g. aUST) can be redeemed to ERC20 stablecoins using the below endpoints:
POST
https://eth-api.anchorprotocol.com/api/v1/init_redeem_stable
POST /api/v1/init_redeem_stable
allows you to fabricate an unsigned Ethereum Tx payload that initiates a stablecoin redemption request. The client can sign and broadcast the resulting Tx payload with their Ethereum account key, or use a custodian API that supports the signing of a raw Tx payload.
Note that only one init_redeem_stable
operation can take place at the same time; even if you successfully broadcast the resulting Tx to the network, the EthAnchor Account contract will block any subsequent operations until an ongoing stablecoin redemption is finished with finish_redeem_stable
.
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
POST
https://eth-api.anchorprotocol.com/api/v1/finish_redeem_stable
POST /api/v1/finish_redeem_stable
allows you to finish a previously requested redeem_stable
operation.
This endpoint returns an unsigned Ethereum transaction payload. You can sign this transaction yourself and send to the network, or broadcast using any custodian API that supports signing a raw Tx payload.
GET
https://eth-api.anchorprotocol.com/api/v1/redeem_stable_status
GET /api/v1/redeem_stable_status
allows you to check the status of an ongoing redeem_stable
operation.
You may want to periodically check the progress of your redeem_stable
request, since an operation may take up to minutes to finish due to congestion on either side of the networks.
Note that status being "finished"
does NOT mean you have run a full cycle of redeem_stable
operation; you still need to send another transaction from POST /api/v1/finish_redeem_stable
to finalize your operation.This endpoint responds with HTTP 204 when there is no ongoing operation.
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Endpoint
Method
Description
POST
Initiates the redemption of ERC20 aTerra
POST
Claims redeemed ERC20 stablecoins
GET
Gets status of an ongoing stablecoin redemption request
Authentication
string
Anchor client key.
underlying_denom
string
Underlying stablecoin denomination of aTerra to redeem from Anchor.
Example: "uusd"
a_terra_amount
string
(uint256) amount of aTerra to redeem from Anchor in 18 decimals. If empty, redeems all aTerra holdings.
Authentication
string
Anchor client key.
Authentication
string
Anchor client access key.