KlimaDAO / klima-subgraph

MIT License
2 stars 9 forks source link

Carbonmark V1 breaks FIFO for provenance #112

Open cujowolf opened 7 months ago

cujowolf commented 7 months ago

The current implementation of FIFO logic for provenance records works well for both pooled and native transfers of credits on chain. During the time Carbonmark V1 was live, if multiple listings were made for the same credit, there was not a guaranteed way to treat that pooled balance FIFO based on transfer order.

Say one user listed 2 tons, followed by one listing 8, then the 8 ton listing is purchased first. In the current implementation this would leave the transfer in of 8 tons with a remaining amount of 2, which is incorrect in this case.

Atmosfearful commented 1 month ago

As discussed on a call you will double check if this is still a problem