Skip to content

Commit

Permalink
fix: deal with chainflip bug of not having outgoing usdc amount
Browse files Browse the repository at this point in the history
  • Loading branch information
CumpsD committed Aug 28, 2024
1 parent 008aa5e commit 200fb14
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion chainflip-insights/Feeders/PastVolume/PastFeeInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ public PastFeeInfo(PastFeesInfoResponse response)

(_, _, "Usdc", "Ethereum") =>
// Take network fee from swapOutputValueUsd
response.SwapOutputValue / 100 * 0.10,
response.SwapOutputValue.HasValue
? response.SwapOutputValue.Value / 100 * 0.10
: 0,

_ =>
// Take network fee from intermediateValueUsd
Expand Down
2 changes: 1 addition & 1 deletion chainflip-insights/Feeders/PastVolume/PastFeesResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class PastFeesInfoResponse
public double? IntermediateValue { get; set; }

[JsonPropertyName("swapOutputValueUsd")]
public double SwapOutputValue { get; set; }
public double? SwapOutputValue { get; set; }

[JsonPropertyName("destinationAsset")]
public string DestinationAsset { get; set; }
Expand Down
4 changes: 2 additions & 2 deletions chainflip-insights/Feeders/PastVolume/PastVolumeFeeder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,8 @@ private async Task<string> GetLastPastVolume(CancellationToken cancellationToken
return await File.ReadAllTextAsync(_configuration.LastPastVolumeLocation, cancellationToken);

await using var file = File.CreateText(_configuration.LastPastVolumeLocation);
await file.WriteAsync("2024-03-04");
return "2024-03-04";
await file.WriteAsync("2024-08-26");
return "2024-08-26";
}

private async Task StoreLastPastVolume(string lastVolume)
Expand Down

0 comments on commit 200fb14

Please sign in to comment.