⚙️API Integrations for Flexible Term Vaults (V4)

Learn more about how to integrate to the Flexible Term Vault via API

Getting Started

API Types

OpenTrade offers users two different types of API. Both enable users to query the protocol and platform and retrieve data on vaults, loans, transactions, and accounts.

REST API

The REST API can be used to make queries that return the latest state of vaults, loans, transactions and accounts.

GraphQL API

The GraphQL API enables users to build complex queries and retrieve data over a historical period of time e.g. between June 1, 2024 and September 1, 2024.

To learn more about the difference between REST and graphQL APIs, read more here.

API Status & Monitoring

OpenTrade monitors the APIs' statuses continuosly and provides a status page which customers can access at anytime to check for and track issues, incidents, planned upgrades, and downtime.

You can access the status page here.

Authentication

Both APIs require API keys to authenticate, in the sandbox and in production.

To request an API key, please inquire with your account manager.

Full Documentation & Test Environments

For the REST API, we provide a Swagger collection that enables you to review and test the API.

For the GraphQL API, we provide a Postman collection that enables you to review the API, manually build queries, and test them.

To access the graphQL Postman collection, please inquire with your account manager. We require the email addresses of the team members you would like to have access to the Postman collection. They will then receive invitations via email to join our Postman partner workspace.

Terminology

OpenTrade implements many of the ERC-4626 and ERC-20 standards. In some cases, the terminology we use in the product is different from those in the code. They are primarily

Term in Code
Display Name

Pool

Vault

Shares

Vault Tokens

Assets

USDC, EURC

Decimals / Formatting

The API returns numerical data types that should be rounded using the following conventions to calculate the display value.

For example, stablecoin values in the API should be rounded to 6 decimal places, where totalOutstandingLoanPrincipal of 1000000 would be equal to 1 USDC.

Type
Decimals
Example in Code
Example in Display

assets

6

1000000

1 USDC/EURC

shares

6

1000000

1 Vault Token

exchangeRate

18

1000261149376738066

1.000261

interestRate

2

500

5.00%

Last updated