Skip to content

Commit

Permalink
[spooky-lp-sonic] Updated the network ID for the spooky-lp-sonic stra…
Browse files Browse the repository at this point in the history
…tegy and adjusted parameters in the example.json file. (#1683)

* Added spooky-lp-sonic strategy and updated index.ts

* removed pagination for request limit

* Update src/strategies/spooky-lp-sonic/index.ts

Co-authored-by: Chaitanya <[email protected]>

* Refactor error handling in `src/strategies/spooky-lp-sonic/index.ts`

* Remove try-catch block around subgraphRequest

* Update src/strategies/index.ts

* Update index.ts

Update network id

* network and params changes

* Revert to not passing poolIds as parameters.

---------

Co-authored-by: Chaitanya <[email protected]>
Co-authored-by: Aiden <[email protected]>
  • Loading branch information
3 people authored Jan 24, 2025
1 parent 515ed28 commit b986a9e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
4 changes: 4 additions & 0 deletions src/strategies/spooky-lp-sonic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@ This strategy calculates the liquidity position of users in pools where $BOO is
The strategy queries the following pools:

Pool 1: 0x686d873a9e0696afaca0bc163dcc95b577d9e3e8 wS/BOO

Pool 2: 0xf4dcfaa2711908a8c61d9516d84b24ffdae241db WETH/BOO

Pool 3: 0xb7228a39cdd2c734064fc95c54e75910ff06eed6 USDC.E/BOO

Pool 4: 0x84d4716c1cf4d7b1b1c247ad69b62fa72ccc46d7 wS/BOO

Pool 5: 0xaa4ee51f55f9baa7cf180fbaf2688cc35fdc8012 BOO/TONS

The strategy uses a subgraph to fetch mint and burn events, calculates the net liquidity position, and assigns scores to the provided addresses based on their activity.
7 changes: 4 additions & 3 deletions src/strategies/spooky-lp-sonic/examples.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@
{
"name": "Example query",
"strategy": {
"name": "spooky-lp-sonic"
"name": "spooky-lp-sonic",
"params": {}
},
"network": "1",
"network": "146",
"addresses": [
"0xf83e546bd2959c22f1715ecaffc03d39b8d0fa96",
"0x02fa5640f5D948f14C9195fB2873D832A49f0A5f",
"0xFE2fb8587760c8d5960CB7A5BA2f2299EdF10506",
"0x593B0c00078A741eB440c7B9Dde999bdD40Aa1F9",
"0x159b567635aea41170aafaf1f832185344c56fba"
],
"snapshot": 11437846
"snapshot": 5256661
}
]
6 changes: 3 additions & 3 deletions src/strategies/spooky-lp-sonic/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { subgraphRequest } from '../../utils';
import { getAddress } from '@ethersproject/address';

const MY_SUBGRAPH_URL = {
'1': 'https://api.0xgraph.xyz/api/public/28820bd2-ad8b-4d40-a142-ce8d7c786f66/subgraphs/spookyswap/v3/v0.0.1/gn'
'146': 'https://api.0xgraph.xyz/api/public/28820bd2-ad8b-4d40-a142-ce8d7c786f66/subgraphs/spookyswap/v3/v0.0.1/gn'

Check failure on line 5 in src/strategies/spooky-lp-sonic/index.ts

View workflow job for this annotation

GitHub Actions / lint / Lint

Insert `⏎···`
};

export const author = '0xaaiden';
Expand All @@ -21,8 +21,8 @@ export async function strategy(
"0xf4dcfaa2711908a8c61d9516d84b24ffdae241db",

Check failure on line 21 in src/strategies/spooky-lp-sonic/index.ts

View workflow job for this annotation

GitHub Actions / lint / Lint

Replace `"0xf4dcfaa2711908a8c61d9516d84b24ffdae241db"` with `'0xf4dcfaa2711908a8c61d9516d84b24ffdae241db'`
"0xb7228a39cdd2c734064fc95c54e75910ff06eed6",

Check failure on line 22 in src/strategies/spooky-lp-sonic/index.ts

View workflow job for this annotation

GitHub Actions / lint / Lint

Replace `"0xb7228a39cdd2c734064fc95c54e75910ff06eed6"` with `'0xb7228a39cdd2c734064fc95c54e75910ff06eed6'`
"0x84d4716c1cf4d7b1b1c247ad69b62fa72ccc46d7",

Check failure on line 23 in src/strategies/spooky-lp-sonic/index.ts

View workflow job for this annotation

GitHub Actions / lint / Lint

Replace `"0x84d4716c1cf4d7b1b1c247ad69b62fa72ccc46d7"` with `'0x84d4716c1cf4d7b1b1c247ad69b62fa72ccc46d7'`
"0xaa4ee51f55f9baa7cf180fbaf2688cc35fdc8012",
];
"0xaa4ee51f55f9baa7cf180fbaf2688cc35fdc8012"

Check failure on line 24 in src/strategies/spooky-lp-sonic/index.ts

View workflow job for this annotation

GitHub Actions / lint / Lint

Replace `"0xaa4ee51f55f9baa7cf180fbaf2688cc35fdc8012"` with `'0xaa4ee51f55f9baa7cf180fbaf2688cc35fdc8012'`
];

const subgraphURL = MY_SUBGRAPH_URL[network];
const score = {};
Expand Down

0 comments on commit b986a9e

Please sign in to comment.