-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move a lot of calculations from flipside into backend
- Loading branch information
Playwo
committed
Sep 14, 2022
1 parent
b3374c0
commit edd8431
Showing
7 changed files
with
137 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using System.Globalization; | ||
|
||
namespace Thorsight.Models.QueryObjects; | ||
|
||
public class LiquidityUpdate : FlipsideObject | ||
{ | ||
public DateTimeOffset BlockTimestamp { get; private set; } | ||
public string Action { get; private set; } = null!; | ||
public string PoolName { get; private set; } = null!; | ||
|
||
public decimal PricePerUnit { get; private set; } | ||
public long Units { get; private set; } | ||
|
||
public decimal DepositRuneValue { get; private set; } | ||
public decimal DepositAssetValue { get; private set; } | ||
|
||
public long WithdrawBasisPoints { get; private set; } | ||
|
||
public override void SetValues(string[] rawValues) | ||
{ | ||
BlockTimestamp = DateTimeOffset.Parse(rawValues[0]); | ||
Action = rawValues[1]; | ||
PoolName = rawValues[2]; | ||
|
||
PricePerUnit = decimal.Parse(rawValues[3], NumberStyles.Float); | ||
Units = long.Parse(rawValues[4]); | ||
|
||
DepositRuneValue = decimal.Parse(rawValues[5], NumberStyles.Float); | ||
DepositAssetValue = decimal.Parse(rawValues[6], NumberStyles.Float); | ||
|
||
WithdrawBasisPoints = long.Parse(rawValues[7]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters