You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**DeFi SDK** is an open-source system of smart contracts designed for precise DeFi portfolio accounting. To put it simply, DeFi SDK is the on-chain *balanceOf* for DeFi protocols.
13
+
**DeFi SDK** is an open-source system of smart contracts designed for precise DeFi portfolio accounting. To put it simply, DeFi SDK is the on-chain *balanceOf* for DeFi protocols.
14
14
15
15
If you have any questions about DeFi SDK, feel free to reach out to us on our [Discord server](https://go.zerion.io/discord).
16
16
17
17
## Features
18
18
19
+
19
20
#### 💥Query user assets and debt deposited in DeFi protocols like *Maker, Aave, dYdX*, etc.
20
-
> How much debt does `0xdead..beef` have on Compound?
21
+
> How much debt does `0xdead..beef` have on Compound?
21
22
#### 📊Get the underlying components of complex derivative ERC20 tokens
22
23
> How much `cUSDC` vs `ETH` does `ETHMACOAPY` have?
23
24
#### ✨Interact with multiple DeFi protocols in a unified way (coming soon)
24
25
> See [What’s next for DeFi SDK](#whats-next-for-defi-sdk-)
25
26
26
-
## Table of Contents
27
+
## Table of Contents
27
28
28
29
-[Examples](#examples)
29
30
-[DeFi SDK architecture](#defi-sdk-architecture)
@@ -32,7 +33,7 @@ If you have any questions about DeFi SDK, feel free to reach out to us on our [D
32
33
-[What’s next for DeFi SDK](#whats-next-for-defi-sdk-)
@@ -141,26 +142,27 @@ and obtain all balances for a given account. The response from the smart-contrac
141
142
142
143
## DeFi SDK architecture
143
144
144
-
-**ProtocolAdapter** is a special contract for every protocol. Its main purpose is to wrap all the protocol interactions.
145
+
-**ProtocolAdapter** is a special contract for every protocol. Its main purpose is to wrap all the protocol interactions.
145
146
There are different types of protocol adapters: "Asset" adapter returns the amount of the account's tokens held on the protocol and the "Debt" adapter returns the amount of the account's debt to the protocol. Some protocols do not use "simple" ERC20 tokens but instead have complex derivatives, for example the Compound protocol has CTokens. The **ProtocolAdapter** contract also provides information about the type of tokens used within it.
146
-
-**TokenAdapter** is a contract for every derivative token type (e.g cTokens, aTokens, yTokens, etc.)
147
+
-**TokenAdapter** is a contract for every derivative token type (e.g cTokens, aTokens, yTokens, etc.)
147
148
Its main purpose is to provide ERC20-style token metadata as well as information about the underlying ERC20 tokens (like DAI for cDAI). Namely, it provides addresses, types and rates of underlying tokens.
148
-
-**AdapterRegistry** is a contract that a) maintains a list of *ProtocolAdapters* and *TokenAdapters* and b) is called to fetch user balances.
149
+
-**AdapterRegistry** is a contract that a) maintains a list of *ProtocolAdapters* and *TokenAdapters* and b) is called to fetch user balances.
149
150
150
151
More detailed documentation about contracts can be found in [adapters](../../wiki/Adapters) and [AdapterRegistry](../../wiki/AdapterRegistry) documentation.
|[Curve](./contracts/adapters/curve)| Exchange liquidity pool for stablecoin trading. Supports Compound, Y, and BUSD pools. |[Asset adapter](./contracts/adapters/curve/CurveAdapter.sol)|["Curve pool token"](contracts/adapters/curve/CurveTokenAdapter.sol)|
159
160
|[dYdX](./contracts/adapters/dydx)| Decentralized trading platform. All 4 markets (WETH, SAI, USDC, DAI) are supported. |[Asset adapter](./contracts/adapters/dydx/DyDxAssetAdapter.sol) <br> [Debt adapter](./contracts/adapters/dydx/DyDxDebtAdapter.sol)| — |
161
+
|[Idle](./contracts/adapters/idle)| Yield aggregator for lending platforms. |[Asset adapter](./contracts/adapters/idle/IdleAdapter.sol)|["IdleToken"](./contracts/adapters/idle/IdleTokenAdapter.sol)|
160
162
|[iearn.finance (v2/v3)](./contracts/adapters/iearn)| Yield aggregator for lending platforms. Protocol adapter is duplicated for v2 and v3 versions of protocol. |[Asset adapter](./contracts/adapters/iearn/IearnAdapter.sol)|["YToken"](./contracts/adapters/iearn/IearnTokenAdapter.sol)|
161
163
|[Chai](./contracts/adapters/maker)| A simple ERC20 wrapper over the Dai Savings Rate. |[Asset adapter](./contracts/adapters/maker/ChaiAdapter.sol)|["Chai token"](./contracts/adapters/maker/ChaiTokenAdapter.sol)|
162
164
|[DSR](./contracts/adapters/maker)| Decentralized lending protocol by MakerDAO. |[Asset adapter](./contracts/adapters/maker/DSRAdapter.sol)| — |
|[Synthetix](./contracts/adapters/synthetix)| Synthetic assets protocol. Asset adapter returns amount of SNX locked as collateral. |[Asset adapter](./contracts/adapters/synthetix/SynthetixAssetAdapter.sol) <br> [Debt adapter](./contracts/adapters/synthetix/SynthetixDebtAdapter.sol)| — |
166
168
|[Uniswap V1](./contracts/adapters/uniswap)| Automated liquidity protocol. Top 30 pools are added to the **AdapterRegistry** contract, however adapter supports all Uniswap pools. |[Asset adapter](./contracts/adapters/uniswap/UniswapV1Adapter.sol) supports all Uniswap pools |["Uniswap V1 pool token"](./contracts/adapters/uniswap/UniswapV1TokenAdapter.sol)|
0 commit comments