Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/jordy25519/drift-account-indexer
- Owner: jordy25519
- Created: 2023-06-21T14:33:46.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-02-06T19:54:18.000Z (about 1 year ago)
- Last Synced: 2024-11-19T14:56:48.442Z (3 months ago)
- Topics: drift, solana
- Language: Rust
- Homepage:
- Size: 90.8 KB
- Stars: 5
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# drift-indexer
Monitor solana for Drift account events and persist them into storage.
```console
$> ./indexer --helpDrift 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