Skip to content

Commit

Permalink
GitBook: [master] 20 pages and 12 assets modified
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeth authored and gitbook-bot committed Apr 23, 2021
1 parent cf6eed5 commit 2499186
Show file tree
Hide file tree
Showing 28 changed files with 1,292 additions and 1,269 deletions.
File renamed without changes
File renamed without changes
Binary file removed .gitbook/assets/image-3-.png
Binary file not shown.
Binary file removed .gitbook/assets/image-5- (1).png
Binary file not shown.
Binary file removed .gitbook/assets/image-5-.png
Binary file not shown.
File renamed without changes
File renamed without changes
Binary file added .gitbook/assets/new-cover_full (4).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,15 @@ description: >-

Hey! Glad to see you are interested in integrating with Zerion. We've built an [interface](https://app.zerion.io?utm_medium=docs&utm_source=docs&utm_campaign=api&utm_content=external&utm_term=web) that offers the easiest and simplest way for DeFi investors to manage their portfolio, and we're happy to share the tools that made that possible. Find some options below on how we can work together. If you need some inspiration, check out our [Featured Partners](featured-partners.md) section.

### Integrate Zerion API in your app
## Integrate Zerion API in your app

If you are looking to integrate Zerion's API into your dapp or application, head over to the [Websocket API](websockets/getting-started/) section. There, you will find examples of how to connect to Zerion and fetch information for Ethereum wallet addresses, protocols and tokens.
If you are looking to integrate Zerion's API into your dapp or application, head over to the [Websocket API](websockets/getting-started/) section. There, you will find examples of how to connect to Zerion and fetch information for Ethereum wallet addresses, protocols and tokens.

{% page-ref page="websockets/getting-started/" %}

### Integrate your protocol to Zerion

If you are looking to integrate your protocol to Zerion, navigate to the [DeFi SDK](defi-sdk/defi-sdk.md) section of this documentation.

### Looking to get your token listed on Zerion? Submit your request [here](https://roadmap.zerion.io/b/token-requests/)!
## Integrate your protocol to Zerion

If you are looking to integrate your protocol to Zerion, navigate to the [DeFi SDK](defi-sdk/defi-sdk.md) section of this documentation.

## Looking to get your token listed on Zerion? Submit your request [here](https://roadmap.zerion.io/b/token-requests/)!

12 changes: 5 additions & 7 deletions defi-sdk/creating-your-adapters/README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
# Creating your adapters

#### **Great to see that you want your protocol to be integrated with Zerion, and we would love to support you!**
### **Great to see that you want your protocol to be integrated with Zerion, and we would love to support you!**

The fastest way for Zerion app to support your protocol is to create a DeFi SDK adapter. There are two types of adapters in the [DeFi SDK](../defi-sdk.md): read-only adapters and interactive.
The fastest way for Zerion app to support your protocol is to create a DeFi SDK adapter. There are two types of adapters in the [DeFi SDK](../defi-sdk.md): read-only adapters and interactive.

### **Create a read-only adapter**
## **Create a read-only adapter**

Read-only adapters help Zerion track your protocol's data on-chain. By creating a read-only adapter, your protocol token and positions would be visible for all Zerion users. If you just need to integrate tracking of your protocol in Zerion, head over to the guide [here](read-only-adapters.md).
Read-only adapters help Zerion track your protocol's data on-chain. By creating a read-only adapter, your protocol token and positions would be visible for all Zerion users. If you just need to integrate tracking of your protocol in Zerion, head over to the guide [here](read-only-adapters.md).

{% page-ref page="read-only-adapters.md" %}

### Create an interactive adapter
## Create an interactive adapter

If you want to create a full support for your protocol in Zerion, you might want to create an interactive adapter for the DeFi SDK. Once you implement it and our team enables it on our side, Zerion users will be able to deposit and withdraw money from your protocol. Ready to get your protocol in front of all Zerion users? [Jump right in](interactive-adapters.md).

{% page-ref page="interactive-adapters.md" %}



10 changes: 4 additions & 6 deletions defi-sdk/creating-your-adapters/interactive-adapters.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ To create new token adapter, one has to implement [**InteractiveAdapter**](https

```bash
function deposit(TokenAmount[] calldata tokenAmounts, bytes calldata data)
external
payable
override
returns (address[] memory tokensToBeWithdrawn)
external
payable
override
returns (address[] memory tokensToBeWithdrawn)
```

`tokenAmounts` — tokens that will be used in the action \(e.g. DAI in case of deposit to Compound\).
Expand Down Expand Up @@ -72,5 +72,3 @@ Use `npx prettier ./contracts/**/*.sol --write` to fix linter issues.

Add tests for interactions it `test/` directory, use Uniswap, Weth, and other required adapters.



10 changes: 5 additions & 5 deletions defi-sdk/creating-your-adapters/read-only-adapters.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# Read-only adapters

### How to add your protocol to DeFi SDK
## How to add your protocol to DeFi SDK

Once a protocol is added to **ProtocolAdapterRegistry** contract, it will immediately appear in all the interfaces that use DeFi SDK \(including Zerion\). In order to add protocol to to DeFi SDK one has to implement the following contracts.

#### `ProtocolAdapter`
### `ProtocolAdapter`

```text
getBalance(address token, address account) returns (int256)
```

The function has two arguments of `address` type: the first one is token address and the second one is account address. The function MUST return balance of given asset held on the protocol for the given account.

#### `TokenAdapter`
### `TokenAdapter`

To create new protocol adapter, one has to implement [TokenAdapter](https://github.com/zeriontech/defi-sdk/blob/master/contracts/adapters/TokenAdapter.sol) interface.

Expand All @@ -37,11 +37,11 @@ The function has the only argument – token address. The function MUST return a

After the adapters are deployed and tested, one can contact Zerion team in order to add the adapters to **AdapterRegistry** contract.

#### Tests
### Tests

To get a PR merged, one should write tests for all the functions implemented. Examples may be found in the [repo](https://github.com/zeriontech/defi-sdk/tree/master/test).

#### Migrations scripts
### Migrations scripts

In case ProtocolAdapter should work with the short list of tokens, these tokens should be added to the list of supported tokens in ProtocolAdapterRegistry contract. In order to do that, one should add tokens in PR's comments.

4 changes: 2 additions & 2 deletions defi-sdk/defi-sdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ If you have any questions about DeFi SDK, feel free to reach out to us on our [D

![](../.gitbook/assets/twitter_final.png)

### Features
## Features

**💥Query user assets and debt deposited in DeFi protocols like Maker, Aave, dYdX, etc.**

Expand All @@ -22,5 +22,5 @@ If you have any questions about DeFi SDK, feel free to reach out to us on our [D
**✨Interact with multiple DeFi protocols in a unified way**

> See [Router]() contract description.
> See [Router](defi-sdk.md) contract description.
10 changes: 5 additions & 5 deletions featured-partners.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ description: Explore how other teams use Zerion's API to power their amazing app

## Rainbow Wallet

[Rainbow](https://rainbow.me/) leverages Zerion's [Websocket API](websockets/getting-started/) to power the most simple non-custodial Ethereum wallet. Rainbow was our very first integration partner, and they have been using Zerion for more than a year now.
[Rainbow](https://rainbow.me/) leverages Zerion's [Websocket API](websockets/getting-started/) to power the most simple non-custodial Ethereum wallet. Rainbow was our very first integration partner, and they have been using Zerion for more than a year now.

![](.gitbook/assets/image.png)

## Stake DAO
## Stake DAO

[Stake DAO](https://stakedao.org/) uses [Zerion's API](websockets/getting-started/) to focus on what they do best: automated investment strategies.
[Stake DAO](https://stakedao.org/) uses [Zerion's API](websockets/getting-started/) to focus on what they do best: automated investment strategies.

![](.gitbook/assets/image%20%284%29.png)

Expand All @@ -24,11 +24,11 @@ description: Explore how other teams use Zerion's API to power their amazing app

## DeFi Market Cap

[DeFi Market Cap](https://defimarketcap.io/) features the top 100 DeFi tokens by market capitalization. It uses Zerion's [Websocket API](websockets/getting-started/) to fetch the prices and market capitalizations of DeFi assets in real-time.
[DeFi Market Cap](https://defimarketcap.io/) features the top 100 DeFi tokens by market capitalization. It uses Zerion's [Websocket API](websockets/getting-started/) to fetch the prices and market capitalizations of DeFi assets in real-time.

![](.gitbook/assets/image%20%283%29.png)

And many more, including:
And many more, including:

* [https://open-orgs.info/](https://open-orgs.info/)
* [https://mask.io/](https://mask.io/)
Expand Down
Loading

0 comments on commit 2499186

Please sign in to comment.