Skip to content

Commit

Permalink
feat: integrate 1inch limit order v4 (#616)
Browse files Browse the repository at this point in the history
  • Loading branch information
piavgh authored Dec 6, 2024
1 parent 9900ae2 commit 1277574
Show file tree
Hide file tree
Showing 11 changed files with 1,330 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/liquidity-source/lo1inch/config.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package lo1inch

type Config struct {
DexID string `json:"dexID"`
ChainID uint `json:"chainID"`
}
24 changes: 24 additions & 0 deletions pkg/liquidity-source/lo1inch/constant.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package lo1inch

import "math/big"

const (
DexType = "lo1inch"

PoolIDPrefix = "lo1inch"
PoolIDSeparator = "_"
)

var (
// BasGas is base gas to executor a tx for LO.
BaseGas = 90000

// GasPerOrderExecutor is gas for executing an order.
GasPerOrderExecutor = 11100
// GasPerOrderRouter need to burn when sending in call data.
GasPerOrderRouter = 12208

// FallbackPercentageOfTotalMakingAmount is fallback percentage of total remain making amount with amount out.
// total remain making amount = total remain making amount(filled orders) + total remain making amount(fallback orders)
FallbackPercentageOfTotalMakingAmount = big.NewFloat(1.3)
)
9 changes: 9 additions & 0 deletions pkg/liquidity-source/lo1inch/errors.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package lo1inch

import "errors"

var (
ErrTokenInNotSupported = errors.New("tokenIn is not supported")
ErrNoOrderAvailable = errors.New("no order available")
ErrCannotFulfillAmountIn = errors.New("cannot fulfill amountIn")
)
Loading

0 comments on commit 1277574

Please sign in to comment.