Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions oracle/provider/gate_get_external_liquidity.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package provider

import (
"encoding/json"
"fmt"
"net/http"
"strconv"

Expand Down Expand Up @@ -35,7 +34,6 @@ func (p *GateProvider) GetExternalLiquidity(
}
//https://api.gateio.ws/api/v4/spot/order_book?currency_pair=BTC_USDT&limit=5000
route := p.endpoints.Rest + gateRestOrderBook + "?currency_pair=" + pair.Base + "_" + pair.Quote + "&limit=5000"
fmt.Println("external_liquidity_route", route)
resp, err := http.Get(route)
if err != nil {
p.logger.Err(err).
Expand Down
4 changes: 0 additions & 4 deletions usecase/calculate_external_liquidity.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ func CalculateExternalLiquidityUseCase(
lowestPrice = price
}

fmt.Println("highestPrice, lowestPrice, baseAmount, quoteAmount", highestPrice, lowestPrice, baseAmount, quoteAmount)
for _, ask := range depthData.Asks {
price, err := math.LegacyNewDecFromStr(fmt.Sprintf("%f", ask[0]))
if err != nil {
Expand All @@ -111,11 +110,8 @@ func CalculateExternalLiquidityUseCase(
baseAmount = baseAmount.Add(amount)
highestPrice = price
}
fmt.Println("highestPrice, lowestPrice, baseAmount, quoteAmount", highestPrice, lowestPrice, baseAmount, quoteAmount)
baseDepth := (highestPrice.Quo(price)).Sub(math.LegacyOneDec())
quoteDepth := math.LegacyOneDec().Sub(lowestPrice.Quo(price))
fmt.Println("baseDepth", baseDepth)
fmt.Println("quoteDepth", quoteDepth)

// Use decimals
externalLiquidityEntity := entity.ExternalLiquidity{
Expand Down