Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Changelog

## v7

- APY numbers have been changed to return proper percentages. (v6 value / 100)
7 changes: 7 additions & 0 deletions DEPENDENCIES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Dependencies

Log our important dependencies in here so that we know what should be updated when breaking changes are made for the
next version.

- https://github.com/OriginProtocol/oeth.com
- https://github.com/OriginProtocol/origin-defi
21 changes: 4 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,4 @@
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/subsquid/squid-evm-template)

# Minimal EVM squid

This is a starter template of a squid indexer for EVM networks (Ethereum, Polygon, BSC, etc.). See [Squid SDK docs](https://docs.subsquid.io/) for a complete reference.

To extract EVM logs and transactions by a topic or a contract address, use `EvmBatchProcessor.addLog()` and `EvmBatchProcessor.addTransaction()` methods of the `EvmBatchProcessor` instance defined in `src/processor.ts`.

The requested data is transformed in batches by a single handler provided to the `processor.run()` method.

For a full list of supported networks and config options,
check the [`EvmBatchProcessor` overview](https://docs.subsquid.io/develop-a-squid/evm-processor/) and the [configuration page](https://docs.subsquid.io/develop-a-squid/evm-processor/configuration/).

For a step-by-step migration guide from TheGraph, see [the dedicated docs page](https://docs.subsquid.io/migrate/migrate-subgraph/).

Dependencies: Node.js, Docker.
# Origin Subsquid

## Quickstart

Expand Down Expand Up @@ -78,7 +63,9 @@ See [docs on database migrations](https://docs.subsquid.io/basics/db-migrations)

### 4. Import ABI contract and generate interfaces to decode events

It is necessary to import the respective ABI definition to decode EVM logs. One way to generate a type-safe facade class to decode EVM logs is by placing the relevant JSON ABIs to `./abi`, then using `squid-evm-typegen(1)` via an `sqd` script:
It is necessary to import the respective ABI definition to decode EVM logs. One way to generate a type-safe facade class
to decode EVM logs is by placing the relevant JSON ABIs to `./abi`, then using `squid-evm-typegen(1)` via an `sqd`
script:

```bash
sqd typegen
Expand Down
4 changes: 1 addition & 3 deletions src/processors/oeth/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,10 @@ export async function createRebaseAPY(
((Number(lastApy.rebasingCreditsPerToken) /
Number(apy.rebasingCreditsPerToken) -
1) *
100 *
365.25) /
dayDiff
const periods_per_year = 365.25 / dayDiff
apy.apy =
((1 + apy.apr / periods_per_year / 100) ** periods_per_year - 1) * 100
apy.apy = (1 + apy.apr / periods_per_year) ** periods_per_year - 1

const last7daysDateId = {
key: 'apy7DayAvg' as const,
Expand Down