Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jordy25519/drift-account-indexer

Index drift account events
https://github.com/jordy25519/drift-account-indexer

drift solana

Last synced: 18 days ago
JSON representation

Index drift account events

Awesome Lists containing this project

README

        

# drift-indexer

Monitor solana for Drift account events and persist them into storage.

```console
$> ./indexer --help

Drift account indexing service 🏎️

Usage: indexer [OPTIONS]

Options:
--accounts List of accounts to monitor
--db Db connection string
--rpc Solana RPC endpoint
--poll Polling interval (seconds) [default: 3]
-h, --help Print help
```

## Usage
```console
$> indexer \
--accounts BTDXiRzG1QBP7bfK4A33RcSP5mmZx8mGJ9YC5maetoD6,GontTwDeBduvbW85oHyC8A7GekuT8X1NkZHDDdUWWvsV
--poll 10
--rpc
--db mongodb://localhost:27017
```

## Build & Run
```console
docker-compose up --build
```
NB: if quickly hits rate limits on free RPC, try increasing `--poll` seconds, or use a 3rd party provider

## Future work
- Add client side rate-limiting
- db tuning needs some work (indexes, data model), test under more load
- at some point subscribing to _N_ accounts is going to be less efficient than simply subscribing to all drift trades