Skip to content

Commit 4c2cbb2

Browse files
committed
#53 poc
1 parent a9e2672 commit 4c2cbb2

8 files changed

Lines changed: 28 additions & 26 deletions

File tree

SolBo/SolBo.Agent/SolBo.Agent.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
55
<TargetFramework>netcoreapp3.1</TargetFramework>
6-
<AssemblyVersion>0.3.2.0</AssemblyVersion>
7-
<FileVersion>0.3.2.0</FileVersion>
8-
<Version>0.3.2</Version>
6+
<AssemblyVersion>0.3.3.0</AssemblyVersion>
7+
<FileVersion>0.3.3.0</FileVersion>
8+
<Version>0.3.3</Version>
99
<Authors>Tomasz Kowalczyk</Authors>
1010
<Company>CryptoDev.TV</Company>
1111
<Product>SolBo</Product>

SolBo/SolBo.Agent/appsettings.solbo-runtime.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "0.3.2",
2+
"version": "0.3.3",
33
"filename": "solbo",
44
"intervalinminutes": 1,
55
"notifications": {

SolBo/SolBo.Agent/solbo.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@
55
"Available": [
66
{
77
"Id": 1,
8-
"Symbol": "ALGO-ETH",
9-
"BuyDown": 0.00000200,
10-
"SellUp": 0.00000300,
11-
"Average": 5,
12-
"StopLossDown": 0.00040000,
13-
"FundPercentage": 100,
8+
"Symbol": "UNI-USDT",
9+
"BuyDown": 4.2,
10+
"SellUp": 6.1,
11+
"Average": 3,
12+
"StopLossDown": 12,
13+
"FundPercentage": 90,
1414
"ClearOnStartup": false,
15-
"StopLossPauseCycles": 2,
16-
"AverageType": 0,
17-
"SellType": 0,
18-
"CommissionType": 0
15+
"StopLossPauseCycles": 3,
16+
"AverageType": 1,
17+
"SellType": 1,
18+
"CommissionType": 1
1919
}
2020
]
2121
},

SolBo/SolBo.Shared/Messages/Rules/SymbolMessage.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,15 @@ public class SymbolMessage
55
public string BaseAsset { get; set; }
66
public string QuoteAsset { get; set; }
77
public int QuoteAssetPrecision { get; set; }
8+
public int BaseAssetPrecision { get; set; }
89
public decimal MinNotional { get; set; }
910
public decimal StepSize { get; set; }
1011
public decimal MaxQuantity { get; set; }
1112
public decimal MinQuantity { get; set; }
1213
public decimal MaxPrice { get; set; }
1314
public decimal MinPrice { get; set; }
1415
public decimal TickSize { get; set; }
16+
public decimal QuotePrecision { get; set; }
17+
public decimal BasePrecision { get; set; }
1518
}
1619
}

SolBo/SolBo.Shared/Rules/Mode/Production/Exchange/KucoinAccountExchangeRule.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,17 @@ public IRuleResult RuleExecuted(Solbot solbot)
4040
basee = accountType.FirstOrDefault(q => q.Currency == solbot.Communication.Symbol.BaseAsset);
4141
}
4242

43+
var baseAvailable = basee != null ? basee.Available : 0m;
44+
4345
if (accountType.AnyAndNotNull())
4446
{
4547
solbot.Communication.AvailableAsset = new AvailableAssetMessage
4648
{
4749
Quote = quote.Available,
48-
Base = basee.Available
50+
Base = baseAvailable
4951
};
5052

51-
baseMsg = $"{solbot.Communication.Symbol.BaseAsset}:{basee.Available}";
53+
baseMsg = $"{solbot.Communication.Symbol.BaseAsset}:{baseAvailable}";
5254
quoteMsg = $"{solbot.Communication.Symbol.QuoteAsset}:{quote.Available}";
5355

5456
result = true;

SolBo/SolBo.Shared/Rules/Mode/Production/KucoinBuyExecuteMarketRule.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public IRuleResult RuleExecuted(Solbot solbot)
2828

2929
if (solbot.Communication.Buy.IsReady)
3030
{
31-
var funds = (solbot.Communication.Buy.AvailableFund * 0.95m).ToKucoinRound();
31+
var funds = solbot.Communication.Buy.AvailableFund;
3232

3333
var buyOrderResult = _kucoinClient.PlaceOrder(
3434
solbot.Strategy.AvailableStrategy.Symbol,

SolBo/SolBo.Shared/Rules/Sequence/KucoinSymbolSequenceRule.cs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,22 +31,19 @@ public IRuleResult RuleExecuted(Solbot solbot)
3131

3232
if (!(symbol is null) && symbol.EnableTrading)
3333
{
34-
int count = BitConverter.GetBytes(decimal.GetBits(symbol.PriceIncrement)[3])[2];
35-
3634
solbot.Communication = new Communication
3735
{
3836
Symbol = new SymbolMessage
3937
{
4038
BaseAsset = symbol.BaseCurrency,
4139
QuoteAsset = symbol.QuoteCurrency,
42-
QuoteAssetPrecision = count,
43-
//MinNotional = symbol.MinNotionalFilter.MinNotional,
40+
BasePrecision = symbol.BaseIncrement,
41+
QuotePrecision = symbol.QuoteIncrement,
42+
BaseAssetPrecision = BitConverter.GetBytes(decimal.GetBits(symbol.BaseIncrement)[3])[2],
43+
QuoteAssetPrecision = BitConverter.GetBytes(decimal.GetBits(symbol.QuoteIncrement)[3])[2],
4444
StepSize = symbol.PriceIncrement,
4545
MaxQuantity = symbol.QuoteMaxSize,
46-
MinQuantity = symbol.QuoteMinSize,
47-
TickSize = symbol.QuoteIncrement
48-
//MaxPrice = symbol.QuoteMaxSize,
49-
//MinPrice = symbol.QuoteMinSize
46+
MinQuantity = symbol.QuoteMinSize
5047
}
5148
};
5249
result.Success = true;

SolBo/SolBo.Shared/SolBo.Shared.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<TargetFramework>netcoreapp3.1</TargetFramework>
5-
<Version>0.3.2</Version>
5+
<Version>0.3.3</Version>
66
<RepositoryUrl>https://github.com/CryptoDevTV/SolBo</RepositoryUrl>
77
<PackageProjectUrl>https://cryptodev.tv</PackageProjectUrl>
88
<Copyright>Tomasz Kowalczyk</Copyright>

0 commit comments

Comments
 (0)