Synthetixio / synthetix-subgraph

All sources for the handful of Synthetix subgraphs indexed by The Graph
https://docs.synthetix.io/historical-data/#subgraphs
MIT License
62 stars 63 forks source link

fix / account for LoanClosedByRepayment event in shorts subgraph #153

Closed kmeraz closed 2 years ago

kmeraz commented 2 years ago

The shorts subgraph is currently not updating the status of a Short when the short has been closed via the loanClosedByRepayment method:

https://github.com/Synthetixio/synthetix/blob/develop/contracts/Collateral.sol#L377

i.e., the subgraph isn't listening for the LoanClosedByRepayment event:

https://github.com/Synthetixio/synthetix/blob/develop/contracts/Collateral.sol#L393

This PR adds both a listener and a handler to handle the aforementioned event.

kmeraz commented 2 years ago

@dbeal-eth @noahlitvin looks like the ABI for CollateralShort is old/out of date. Thoughts?

https://github.com/Synthetixio/synthetix/blob/develop/contracts/CollateralShort.sol

I'm not seeing the closeWithCollateral function within the ABI that's in this repo:

https://github.com/Synthetixio/synthetix-subgraph/blob/main/abis/CollateralShort.json

dbeal-eth commented 2 years ago

you have to run node prepare-abi script, can you run that now?