Skip to content

Commit

Permalink
add default gas
Browse files Browse the repository at this point in the history
  • Loading branch information
minhnhathoang committed Nov 28, 2024
1 parent 421eb5a commit a99fa5b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/liquidity-source/mx-trading/constant.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ package mxtrading
const DexType = "mx-trading"

var (
defaultGas = Gas{FillOrderArgs: 0}
defaultGas = Gas{FillOrderArgs: 180000}
)
2 changes: 1 addition & 1 deletion pkg/liquidity-source/mx-trading/pool_simulator.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ func (p *PoolSimulator) CalculateLimit() map[string]*big.Int {
for i, token := range tokens {
inventory[token] = new(big.Int).Set(reserves[i])
}

return inventory
}

Expand All @@ -153,7 +154,6 @@ func findFillPrice(amountInF float64, levels []PriceLevel) (float64, error) {
var sizeFilled, price float64
for _, level := range levels {
partFillSize := amountInF - sizeFilled

if level.Size >= partFillSize {
price += (level.Price * partFillSize) / amountInF
sizeFilled += partFillSize
Expand Down

0 comments on commit a99fa5b

Please sign in to comment.