-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: integrate 1inch limit order v4 (#616)
- Loading branch information
Showing
11 changed files
with
1,330 additions
and
0 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
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"` | ||
} |
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,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) | ||
) |
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,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") | ||
) |
Oops, something went wrong.