Documentation
API Reference

Transactions

Unsigned transactions for the user's own wallet to sign.

6 endpoints

#Build a supply transaction

POST/v1/tx/supply

Returns the unsigned transaction(s) for the user's wallet to send, in order (an ERC-20 approval first when needed). The action is simulated first: if it would revert, the API answers 422 ACTION_NOT_ALLOWED with the reasons instead of handing out a transaction that would fail.

Request body

accountrequiredstring

the wallet that will sign

assetrequiredstring

token address or symbol

amountrequiredstring

Token amount in base units

onBehalfOfstring

EVM address

Response

stepsrequiredobject[]

Unsigned transactions for the user's wallet, to be sent in order

steps[].kindrequiredstring
steps[].chainIdrequirednumber
steps[].torequiredstring

EVM address

steps[].datarequiredstring
steps[].valuerequiredstring
steps[].descriptionrequiredstring
previewrequiredobject
preview.actionrequiredstring
preview.assetrequiredstring

EVM address

preview.symbolrequiredstring
preview.amountrequiredstring

Token amount in base units

preview.allowedrequiredboolean
preview.problemsrequiredstring[]

why the action would fail, as stable codes

preview.beforerequiredobject
preview.afterrequiredobject

Errors

400422503
Request
curl -X POST "https://aethr-api.vercel.app/v1/tx/supply" \
  -H "content-type: application/json" \
  -d '{"account":"0x7a3F00000000000000000000000000000000c91E","asset":"WHYPE","amount":"1000000","onBehalfOf":"0x7a3F00000000000000000000000000000000c91E"}'
Response · 200
{
  "steps": [
    {
      "kind": "string",
      "chainId": 0,
      "to": "string",
      "data": "0x…",
      "value": "string",
      "description": "string"
    }
  ],
  "preview": {
    "action": "string",
    "asset": "WHYPE",
    "symbol": "WHYPE",
    "amount": "1000000",
    "allowed": true,
    "problems": [
      "string"
    ],
    "before": {
      "healthFactor": "0.0425",
      "status": "no_debt",
      "collateralUsd": "62.4317",
      "debtUsd": "62.4317",
      "borrowLimitUsd": "62.4317",
      "liquidationLimitUsd": "62.4317",
      "borrowLimitUsedBps": 6000,
      "netWorthUsd": "62.4317",
      "executableCollateralUsd": "62.4317",
      "pricesFresh": true
    },
    "after": {
      "healthFactor": "0.0425",
      "status": "no_debt",
      "collateralUsd": "62.4317",
      "debtUsd": "62.4317",
      "borrowLimitUsd": "62.4317",
      "liquidationLimitUsd": "62.4317",
      "borrowLimitUsedBps": 6000,
      "netWorthUsd": "62.4317",
      "executableCollateralUsd": "62.4317",
      "pricesFresh": true
    }
  }
}

#Build a withdraw transaction

POST/v1/tx/withdraw

Returns the unsigned transaction(s) for the user's wallet to send, in order (an ERC-20 approval first when needed). The action is simulated first: if it would revert, the API answers 422 ACTION_NOT_ALLOWED with the reasons instead of handing out a transaction that would fail. Use "amount": "max" to withdraw everything.

Request body

accountrequiredstring

the wallet that will sign

assetrequiredstring

token address or symbol

amountrequiredstring | "max"

Token amount in base units, or "max" for the whole balance

tostring

EVM address

Response

stepsrequiredobject[]

Unsigned transactions for the user's wallet, to be sent in order

steps[].kindrequiredstring
steps[].chainIdrequirednumber
steps[].torequiredstring

EVM address

steps[].datarequiredstring
steps[].valuerequiredstring
steps[].descriptionrequiredstring
previewrequiredobject
preview.actionrequiredstring
preview.assetrequiredstring

EVM address

preview.symbolrequiredstring
preview.amountrequiredstring

Token amount in base units

preview.allowedrequiredboolean
preview.problemsrequiredstring[]

why the action would fail, as stable codes

preview.beforerequiredobject
preview.afterrequiredobject

Errors

400422503
Request
curl -X POST "https://aethr-api.vercel.app/v1/tx/withdraw" \
  -H "content-type: application/json" \
  -d '{"account":"0x7a3F00000000000000000000000000000000c91E","asset":"WHYPE","amount":"1000000","to":"string"}'
Response · 200
{
  "steps": [
    {
      "kind": "string",
      "chainId": 0,
      "to": "string",
      "data": "0x…",
      "value": "string",
      "description": "string"
    }
  ],
  "preview": {
    "action": "string",
    "asset": "WHYPE",
    "symbol": "WHYPE",
    "amount": "1000000",
    "allowed": true,
    "problems": [
      "string"
    ],
    "before": {
      "healthFactor": "0.0425",
      "status": "no_debt",
      "collateralUsd": "62.4317",
      "debtUsd": "62.4317",
      "borrowLimitUsd": "62.4317",
      "liquidationLimitUsd": "62.4317",
      "borrowLimitUsedBps": 6000,
      "netWorthUsd": "62.4317",
      "executableCollateralUsd": "62.4317",
      "pricesFresh": true
    },
    "after": {
      "healthFactor": "0.0425",
      "status": "no_debt",
      "collateralUsd": "62.4317",
      "debtUsd": "62.4317",
      "borrowLimitUsd": "62.4317",
      "liquidationLimitUsd": "62.4317",
      "borrowLimitUsedBps": 6000,
      "netWorthUsd": "62.4317",
      "executableCollateralUsd": "62.4317",
      "pricesFresh": true
    }
  }
}

#Build a borrow transaction

POST/v1/tx/borrow

Returns the unsigned transaction(s) for the user's wallet to send, in order (an ERC-20 approval first when needed). The action is simulated first: if it would revert, the API answers 422 ACTION_NOT_ALLOWED with the reasons instead of handing out a transaction that would fail.

Request body

accountrequiredstring

the wallet that will sign

assetrequiredstring

token address or symbol

amountrequiredstring

Token amount in base units

tostring

EVM address

Response

stepsrequiredobject[]

Unsigned transactions for the user's wallet, to be sent in order

steps[].kindrequiredstring
steps[].chainIdrequirednumber
steps[].torequiredstring

EVM address

steps[].datarequiredstring
steps[].valuerequiredstring
steps[].descriptionrequiredstring
previewrequiredobject
preview.actionrequiredstring
preview.assetrequiredstring

EVM address

preview.symbolrequiredstring
preview.amountrequiredstring

Token amount in base units

preview.allowedrequiredboolean
preview.problemsrequiredstring[]

why the action would fail, as stable codes

preview.beforerequiredobject
preview.afterrequiredobject

Errors

400422503
Request
curl -X POST "https://aethr-api.vercel.app/v1/tx/borrow" \
  -H "content-type: application/json" \
  -d '{"account":"0x7a3F00000000000000000000000000000000c91E","asset":"WHYPE","amount":"1000000","to":"string"}'
Response · 200
{
  "steps": [
    {
      "kind": "string",
      "chainId": 0,
      "to": "string",
      "data": "0x…",
      "value": "string",
      "description": "string"
    }
  ],
  "preview": {
    "action": "string",
    "asset": "WHYPE",
    "symbol": "WHYPE",
    "amount": "1000000",
    "allowed": true,
    "problems": [
      "string"
    ],
    "before": {
      "healthFactor": "0.0425",
      "status": "no_debt",
      "collateralUsd": "62.4317",
      "debtUsd": "62.4317",
      "borrowLimitUsd": "62.4317",
      "liquidationLimitUsd": "62.4317",
      "borrowLimitUsedBps": 6000,
      "netWorthUsd": "62.4317",
      "executableCollateralUsd": "62.4317",
      "pricesFresh": true
    },
    "after": {
      "healthFactor": "0.0425",
      "status": "no_debt",
      "collateralUsd": "62.4317",
      "debtUsd": "62.4317",
      "borrowLimitUsd": "62.4317",
      "liquidationLimitUsd": "62.4317",
      "borrowLimitUsedBps": 6000,
      "netWorthUsd": "62.4317",
      "executableCollateralUsd": "62.4317",
      "pricesFresh": true
    }
  }
}

#Build a repay transaction

POST/v1/tx/repay

Returns the unsigned transaction(s) for the user's wallet to send, in order (an ERC-20 approval first when needed). The action is simulated first: if it would revert, the API answers 422 ACTION_NOT_ALLOWED with the reasons instead of handing out a transaction that would fail. Use "amount": "max" to clear the whole debt, including interest that accrues before it is mined.

Request body

accountrequiredstring

the wallet that will sign

assetrequiredstring

token address or symbol

amountrequiredstring | "max"

Token amount in base units, or "max" for the whole balance

onBehalfOfstring

EVM address

Response

stepsrequiredobject[]

Unsigned transactions for the user's wallet, to be sent in order

steps[].kindrequiredstring
steps[].chainIdrequirednumber
steps[].torequiredstring

EVM address

steps[].datarequiredstring
steps[].valuerequiredstring
steps[].descriptionrequiredstring
previewrequiredobject
preview.actionrequiredstring
preview.assetrequiredstring

EVM address

preview.symbolrequiredstring
preview.amountrequiredstring

Token amount in base units

preview.allowedrequiredboolean
preview.problemsrequiredstring[]

why the action would fail, as stable codes

preview.beforerequiredobject
preview.afterrequiredobject

Errors

400422503
Request
curl -X POST "https://aethr-api.vercel.app/v1/tx/repay" \
  -H "content-type: application/json" \
  -d '{"account":"0x7a3F00000000000000000000000000000000c91E","asset":"WHYPE","amount":"1000000","onBehalfOf":"0x7a3F00000000000000000000000000000000c91E"}'
Response · 200
{
  "steps": [
    {
      "kind": "string",
      "chainId": 0,
      "to": "string",
      "data": "0x…",
      "value": "string",
      "description": "string"
    }
  ],
  "preview": {
    "action": "string",
    "asset": "WHYPE",
    "symbol": "WHYPE",
    "amount": "1000000",
    "allowed": true,
    "problems": [
      "string"
    ],
    "before": {
      "healthFactor": "0.0425",
      "status": "no_debt",
      "collateralUsd": "62.4317",
      "debtUsd": "62.4317",
      "borrowLimitUsd": "62.4317",
      "liquidationLimitUsd": "62.4317",
      "borrowLimitUsedBps": 6000,
      "netWorthUsd": "62.4317",
      "executableCollateralUsd": "62.4317",
      "pricesFresh": true
    },
    "after": {
      "healthFactor": "0.0425",
      "status": "no_debt",
      "collateralUsd": "62.4317",
      "debtUsd": "62.4317",
      "borrowLimitUsd": "62.4317",
      "liquidationLimitUsd": "62.4317",
      "borrowLimitUsedBps": 6000,
      "netWorthUsd": "62.4317",
      "executableCollateralUsd": "62.4317",
      "pricesFresh": true
    }
  }
}

#Enable or disable an asset as collateral

POST/v1/tx/collateral

Returns the unsigned transaction(s) for the user's wallet to send, in order (an ERC-20 approval first when needed). The action is simulated first: if it would revert, the API answers 422 ACTION_NOT_ALLOWED with the reasons instead of handing out a transaction that would fail.

Request body

accountrequiredstring

the wallet that will sign

assetrequiredstring

token address or symbol

enabledrequiredboolean

Response

stepsrequiredobject[]

Unsigned transactions for the user's wallet, to be sent in order

steps[].kindrequiredstring
steps[].chainIdrequirednumber
steps[].torequiredstring

EVM address

steps[].datarequiredstring
steps[].valuerequiredstring
steps[].descriptionrequiredstring
previewrequiredobject
preview.actionrequiredstring
preview.assetrequiredstring

EVM address

preview.symbolrequiredstring
preview.amountrequiredstring

Token amount in base units

preview.allowedrequiredboolean
preview.problemsrequiredstring[]

why the action would fail, as stable codes

preview.beforerequiredobject
preview.afterrequiredobject

Errors

400422503
Request
curl -X POST "https://aethr-api.vercel.app/v1/tx/collateral" \
  -H "content-type: application/json" \
  -d '{"account":"0x7a3F00000000000000000000000000000000c91E","asset":"WHYPE","enabled":true}'
Response · 200
{
  "steps": [
    {
      "kind": "string",
      "chainId": 0,
      "to": "string",
      "data": "0x…",
      "value": "string",
      "description": "string"
    }
  ],
  "preview": {
    "action": "string",
    "asset": "WHYPE",
    "symbol": "WHYPE",
    "amount": "1000000",
    "allowed": true,
    "problems": [
      "string"
    ],
    "before": {
      "healthFactor": "0.0425",
      "status": "no_debt",
      "collateralUsd": "62.4317",
      "debtUsd": "62.4317",
      "borrowLimitUsd": "62.4317",
      "liquidationLimitUsd": "62.4317",
      "borrowLimitUsedBps": 6000,
      "netWorthUsd": "62.4317",
      "executableCollateralUsd": "62.4317",
      "pricesFresh": true
    },
    "after": {
      "healthFactor": "0.0425",
      "status": "no_debt",
      "collateralUsd": "62.4317",
      "debtUsd": "62.4317",
      "borrowLimitUsd": "62.4317",
      "liquidationLimitUsd": "62.4317",
      "borrowLimitUsedBps": 6000,
      "netWorthUsd": "62.4317",
      "executableCollateralUsd": "62.4317",
      "pricesFresh": true
    }
  }
}

#Build a rewards claim transaction

POST/v1/tx/claim-rewards

Claims everything currently claimable for one reward kind and token. Anyone may submit it; the tokens always go to account.

Request body

accountrequiredstring

EVM address

kindrequired"yield_booster" | "borrow_rebates"
tokenrequiredstring

Response

stepsrequiredobject[]

Unsigned transactions for the user's wallet, to be sent in order

steps[].kindrequiredstring
steps[].chainIdrequirednumber
steps[].torequiredstring

EVM address

steps[].datarequiredstring
steps[].valuerequiredstring
steps[].descriptionrequiredstring
previewrequiredobject
preview.actionrequiredstring
preview.assetrequiredstring

EVM address

preview.symbolrequiredstring
preview.amountrequiredstring

Token amount in base units

preview.allowedrequiredboolean
preview.problemsrequiredstring[]

why the action would fail, as stable codes

preview.beforerequiredobject
preview.afterrequiredobject

Errors

400422503
Request
curl -X POST "https://aethr-api.vercel.app/v1/tx/claim-rewards" \
  -H "content-type: application/json" \
  -d '{"account":"0x7a3F00000000000000000000000000000000c91E","kind":"yield_booster","token":"0x7a3F00000000000000000000000000000000c91E"}'
Response · 200
{
  "steps": [
    {
      "kind": "string",
      "chainId": 0,
      "to": "string",
      "data": "0x…",
      "value": "string",
      "description": "string"
    }
  ],
  "preview": {
    "action": "string",
    "asset": "WHYPE",
    "symbol": "WHYPE",
    "amount": "1000000",
    "allowed": true,
    "problems": [
      "string"
    ],
    "before": {
      "healthFactor": "0.0425",
      "status": "no_debt",
      "collateralUsd": "62.4317",
      "debtUsd": "62.4317",
      "borrowLimitUsd": "62.4317",
      "liquidationLimitUsd": "62.4317",
      "borrowLimitUsedBps": 6000,
      "netWorthUsd": "62.4317",
      "executableCollateralUsd": "62.4317",
      "pricesFresh": true
    },
    "after": {
      "healthFactor": "0.0425",
      "status": "no_debt",
      "collateralUsd": "62.4317",
      "debtUsd": "62.4317",
      "borrowLimitUsd": "62.4317",
      "liquidationLimitUsd": "62.4317",
      "borrowLimitUsedBps": 6000,
      "netWorthUsd": "62.4317",
      "executableCollateralUsd": "62.4317",
      "pricesFresh": true
    }
  }
}