Mapping to Tesseract data model

Understand how make all Tesseract products available for your end users

In beginning of integration project Tesseract delivers you 2 set of credentials and both credentials are needed to make both DeFI and Lending products available for end users. In other words you access DeFI products and associated accounts using different credentials than the Lending ones.

Figure 1. illustrates the simple datamodel on Earn Api side. Each user has multiple accounts to store transactions related to a particular product. Caveat is that your data model and code must be able to map to accessing Earn Api using multiple credentials.

Figure 1. Tesseract data model is simple. However partner data model has to be designed with caveat of accessing different type of products with different Earn Api authentication token.

Example: Product list

Product list displayed for your end users is union of 2 calls to GET /v1/products.

Example: Creating users

For each end user on your side you create 2 users on Earn Api by calling POST /v1/users with token for both DeFI and Lending. You need to store user id received as response with its mapping to your end user because you need the mapping for other use cases e.g. creating the accounts.

Example: Partner data model

This is very much indicative and details up to partner to design. You can copy paste the dbml code to some online tool for easier viewing of comments associated.

Figure 2. Example of partner data model.

Last updated