Skip to content

Commit

Permalink
changed as requested
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberliem committed Nov 16, 2023
1 parent c6b8ad0 commit b922e8b
Show file tree
Hide file tree
Showing 59 changed files with 20 additions and 212 deletions.
4 changes: 0 additions & 4 deletions pkg/liquidity-source/uniswap-v2/pool_simulator.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@ type (
}
)

func (p *PoolSimulator) CalculateLimit() map[string]*big.Int {
return nil
}

func NewPoolSimulator(entityPool entity.Pool) (*PoolSimulator, error) {
var staticExtra StaticExtra
if err := json.Unmarshal([]byte(entityPool.StaticExtra), &staticExtra); err != nil {
Expand Down
4 changes: 0 additions & 4 deletions pkg/source/algebrav1/pool_simulator.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ type PoolSimulator struct {
tickSpacing int
}

func (p *PoolSimulator) CalculateLimit() map[string]*big.Int {
return nil
}

func NewPoolSimulator(entityPool entity.Pool, defaultGas int64) (*PoolSimulator, error) {
var extra Extra
if err := json.Unmarshal([]byte(entityPool.Extra), &extra); err != nil {
Expand Down
4 changes: 0 additions & 4 deletions pkg/source/balancer-composable-stable/pool_simulator.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ type PoolSimulator struct {
mapTokenAddressToIndex map[string]int
}

func (p *PoolSimulator) CalculateLimit() map[string]*big.Int {
return nil
}

func NewPoolSimulator(entityPool entity.Pool) (*PoolSimulator, error) {
var staticExtra StaticExtra
if err := json.Unmarshal([]byte(entityPool.StaticExtra), &staticExtra); err != nil {
Expand Down
4 changes: 0 additions & 4 deletions pkg/source/balancer/stable/pool_simulator.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ type StablePool struct {
gas balancer.Gas
}

func (p *StablePool) CalculateLimit() map[string]*big.Int {
return nil
}

func NewPoolSimulator(entityPool entity.Pool) (*StablePool, error) {
var staticExtra balancer.StaticExtra
if err := json.Unmarshal([]byte(entityPool.StaticExtra), &staticExtra); err != nil {
Expand Down
4 changes: 0 additions & 4 deletions pkg/source/balancer/weighted/pool_simulator.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ type WeightedPool2Tokens struct {
gas balancer.Gas
}

func (p *WeightedPool2Tokens) CalculateLimit() map[string]*big.Int {
return nil
}

func NewPoolSimulator(entityPool entity.Pool) (*WeightedPool2Tokens, error) {
var staticExtra balancer.StaticExtra
if err := json.Unmarshal([]byte(entityPool.StaticExtra), &staticExtra); err != nil {
Expand Down
4 changes: 0 additions & 4 deletions pkg/source/camelot/pool_simulator.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ type (
}
)

func (p *PoolSimulator) CalculateLimit() map[string]*big.Int {
return nil
}

func NewPoolSimulator(entityPool entity.Pool) (*PoolSimulator, error) {
var extra Extra
if err := json.Unmarshal([]byte(entityPool.Extra), &extra); err != nil {
Expand Down
4 changes: 0 additions & 4 deletions pkg/source/curve/aave/pool_simulator.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ type Gas struct {
Exchange int64
}

func (p *AavePool) CalculateLimit() map[string]*big.Int {
return nil
}

func NewPoolSimulator(entityPool entity.Pool) (*AavePool, error) {
var staticExtra curve.PoolAaveStaticExtra
if err := json.Unmarshal([]byte(entityPool.StaticExtra), &staticExtra); err != nil {
Expand Down
4 changes: 0 additions & 4 deletions pkg/source/curve/base/pool_simulator.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ type Gas struct {
Exchange int64
}

func (p *PoolBaseSimulator) CalculateLimit() map[string]*big.Int {
return nil
}

func NewPoolSimulator(entityPool entity.Pool) (*PoolBaseSimulator, error) {
var staticExtra curve.PoolBaseStaticExtra
if err := json.Unmarshal([]byte(entityPool.StaticExtra), &staticExtra); err != nil {
Expand Down
4 changes: 0 additions & 4 deletions pkg/source/curve/compound/pool_simulator.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ type Gas struct {
ExchangeUnderlying int64
}

func (p *CompoundPool) CalculateLimit() map[string]*big.Int {
return nil
}

func NewPoolSimulator(entityPool entity.Pool) (*CompoundPool, error) {
var staticExtra curve.PoolCompoundStaticExtra
if err := json.Unmarshal([]byte(entityPool.StaticExtra), &staticExtra); err != nil {
Expand Down
4 changes: 0 additions & 4 deletions pkg/source/curve/meta/pool_simulator.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,6 @@ type Gas struct {
ExchangeUnderlying int64
}

func (p *Pool) CalculateLimit() map[string]*big.Int {
return nil
}

func NewPoolSimulator(entityPool entity.Pool, basePool ICurveBasePool) (*Pool, error) {
var staticExtra curve.PoolMetaStaticExtra
if err := json.Unmarshal([]byte(entityPool.StaticExtra), &staticExtra); err != nil {
Expand Down
4 changes: 0 additions & 4 deletions pkg/source/curve/plain-oracle/pool_simulator.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ type Gas struct {
Exchange int64
}

func (p *Pool) CalculateLimit() map[string]*big.Int {
return nil
}

func NewPoolSimulator(entityPool entity.Pool) (*Pool, error) {
var staticExtra curve.PoolPlainOracleStaticExtra
if err := json.Unmarshal([]byte(entityPool.StaticExtra), &staticExtra); err != nil {
Expand Down
4 changes: 0 additions & 4 deletions pkg/source/curve/tricrypto/pool_simulator.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@ type Gas struct {
Exchange int64
}

func (p *Pool) CalculateLimit() map[string]*big.Int {
return nil
}

func NewPoolSimulator(entityPool entity.Pool) (*Pool, error) {
var staticExtra curve.PoolTricryptoStaticExtra
if err := json.Unmarshal([]byte(entityPool.StaticExtra), &staticExtra); err != nil {
Expand Down
4 changes: 0 additions & 4 deletions pkg/source/curve/two/pool_simulator.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ type Gas struct {
Exchange int64
}

func (p *Pool) CalculateLimit() map[string]*big.Int {
return nil
}

func NewPoolSimulator(entityPool entity.Pool) (*Pool, error) {
var staticExtra curve.PoolTwoStaticExtra
if err := json.Unmarshal([]byte(entityPool.StaticExtra), &staticExtra); err != nil {
Expand Down
4 changes: 0 additions & 4 deletions pkg/source/dmm/pool_simulator.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ type PoolSimulator struct {
gas Gas
}

func (p *PoolSimulator) CalculateLimit() map[string]*big.Int {
return nil
}

func NewPoolSimulator(entityPool entity.Pool) (*PoolSimulator, error) {
var extra Extra
if err := json.Unmarshal([]byte(entityPool.Extra), &extra); err != nil {
Expand Down
4 changes: 0 additions & 4 deletions pkg/source/dodo/pool_simulator.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ type PoolSimulator struct {
gas Gas
}

func (p *PoolSimulator) CalculateLimit() map[string]*big.Int {
return nil
}

func NewPoolSimulator(entityPool entity.Pool) (*PoolSimulator, error) {
if len(entityPool.StaticExtra) == 0 {
return nil, ErrStaticExtraEmpty
Expand Down
4 changes: 0 additions & 4 deletions pkg/source/elastic/pool_simulator.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ type PoolSimulator struct {
tickMax int
}

func (p *PoolSimulator) CalculateLimit() map[string]*big.Int {
return nil
}

func NewPoolSimulator(entityPool entity.Pool, chainID valueobject.ChainID) (*PoolSimulator, error) {
var extra Extra
if err := json.Unmarshal([]byte(entityPool.Extra), &extra); err != nil {
Expand Down
4 changes: 0 additions & 4 deletions pkg/source/equalizer/pool_simulator.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ type PoolSimulator struct {
gas Gas
}

func (p *PoolSimulator) CalculateLimit() map[string]*big.Int {
return nil
}

func NewPoolSimulator(entityPool entity.Pool) (*PoolSimulator, error) {
var swapFeeFl = new(big.Float).Mul(big.NewFloat(entityPool.SwapFee), bignumber.BoneFloat)
var swapFee, _ = swapFeeFl.Int(nil)
Expand Down
4 changes: 0 additions & 4 deletions pkg/source/fraxswap/pool_simulator.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ type (
}
)

func (p *PoolSimulator) CalculateLimit() map[string]*big.Int {
return nil
}

func NewPoolSimulator(entityPool entity.Pool) (*PoolSimulator, error) {
var extra Extra
if err := json.Unmarshal([]byte(entityPool.Extra), &extra); err != nil {
Expand Down
4 changes: 0 additions & 4 deletions pkg/source/fxdx/pool_simulator.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ type PoolSimulator struct {
gas Gas
}

func (p *PoolSimulator) CalculateLimit() map[string]*big.Int {
return nil
}

func NewPoolSimulator(entityPool entity.Pool) (*PoolSimulator, error) {
var extra Extra
if err := json.Unmarshal([]byte(entityPool.Extra), &extra); err != nil {
Expand Down
4 changes: 0 additions & 4 deletions pkg/source/gmx-glp/pool_simulator.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ type PoolSimulator struct {
swapInfo *gmxGlpSwapInfo
}

func (p *PoolSimulator) CalculateLimit() map[string]*big.Int {
return nil
}

func NewPoolSimulator(entityPool entity.Pool) (*PoolSimulator, error) {
var extra Extra
if err := json.Unmarshal([]byte(entityPool.Extra), &extra); err != nil {
Expand Down
4 changes: 0 additions & 4 deletions pkg/source/gmx/pool_simulator.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ type PoolSimulator struct {
gas Gas
}

func (p *PoolSimulator) CalculateLimit() map[string]*big.Int {
return nil
}

func NewPoolSimulator(entityPool entity.Pool) (*PoolSimulator, error) {
var extra Extra
if err := json.Unmarshal([]byte(entityPool.Extra), &extra); err != nil {
Expand Down
4 changes: 0 additions & 4 deletions pkg/source/iziswap/pool_simulator.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ type PoolSimulator struct {
PoolInfo swap.PoolInfo
}

func (p *PoolSimulator) CalculateLimit() map[string]*big.Int {
return nil
}

func NewPoolSimulator(entityPool entity.Pool) (*PoolSimulator, error) {
var extra Extra
if err := json.Unmarshal([]byte(entityPool.Extra), &extra); err != nil {
Expand Down
4 changes: 0 additions & 4 deletions pkg/source/kokonut-crypto/pool_simulator.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,6 @@ type Gas struct {
Exchange int64
}

func (p *PoolSimulator) CalculateLimit() map[string]*big.Int {
return nil
}

func NewPoolSimulator(entityPool entity.Pool) (*PoolSimulator, error) {
var staticExtra StaticExtra
if err := json.Unmarshal([]byte(entityPool.StaticExtra), &staticExtra); err != nil {
Expand Down
1 change: 1 addition & 0 deletions pkg/source/kyber-pmm/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ var (
ErrEmptyPriceLevels = errors.New("empty price levels")
ErrInsufficientLiquidity = errors.New("insufficient liquidity")
ErrInvalidFirmQuoteParams = errors.New("invalid firm quote params")
ErrNoSwapLimit = errors.New("swap limit is required for PMM pools")
)
4 changes: 3 additions & 1 deletion pkg/source/kyber-pmm/pool_simulator.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ func NewPoolSimulator(entityPool entity.Pool) (*PoolSimulator, error) {
func (p *PoolSimulator) CalcAmountOut(
param pool.CalcAmountOutParams,
) (result *pool.CalcAmountOutResult, err error) {
if param.Limit == nil {
return nil, ErrNoSwapLimit
}
var (
tokenAmountIn = param.TokenAmountIn
tokenOut = param.TokenOut
Expand All @@ -126,7 +129,6 @@ func (p *PoolSimulator) CalcAmountOut(
}

var inventoryLimit *big.Int

if swapDirection == SwapDirectionBaseToQuote {
inventoryLimit = limit.GetLimit(p.quoteToken.Address)
} else {
Expand Down
4 changes: 0 additions & 4 deletions pkg/source/lido-steth/pool_simulator.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ type PoolSimulator struct {
chainID valueobject.ChainID
}

func (p *PoolSimulator) CalculateLimit() map[string]*big.Int {
return nil
}

func NewPoolSimulator(entityPool entity.Pool, chainID valueobject.ChainID) (*PoolSimulator, error) {
numTokens := len(entityPool.Tokens)
if numTokens != 2 || !isWrappedEther(entityPool.Tokens[0].Address, chainID) {
Expand Down
4 changes: 0 additions & 4 deletions pkg/source/lido/pool_simulator.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ type Gas struct {
Unwrap int64
}

func (p *PoolSimulator) CalculateLimit() map[string]*big.Int {
return nil
}

func NewPoolSimulator(entityPool entity.Pool) (*PoolSimulator, error) {
var numTokens = len(entityPool.Tokens)
var tokens = make([]string, numTokens)
Expand Down
4 changes: 0 additions & 4 deletions pkg/source/limitorder/pool_simulator.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ type (
}
)

func (p *PoolSimulator) CalculateLimit() map[string]*big.Int {
return nil
}

func NewPoolSimulator(entityPool entity.Pool) (*PoolSimulator, error) {
var numTokens = len(entityPool.Tokens)
var tokens = make([]string, numTokens)
Expand Down
4 changes: 0 additions & 4 deletions pkg/source/liquiditybookv20/pool_simulator.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ type PoolSimulator struct {
bins []bin
}

func (p *PoolSimulator) CalculateLimit() map[string]*big.Int {
return nil
}

func NewPoolSimulator(entityPool entity.Pool) (*PoolSimulator, error) {
var (
tokens = make([]string, 2)
Expand Down
4 changes: 0 additions & 4 deletions pkg/source/liquiditybookv21/pool_simulator.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ type PoolSimulator struct {
bins []bin
}

func (p *PoolSimulator) CalculateLimit() map[string]*big.Int {
return nil
}

func NewPoolSimulator(entityPool entity.Pool) (*PoolSimulator, error) {
var (
tokens = make([]string, 2)
Expand Down
4 changes: 0 additions & 4 deletions pkg/source/madmex/pool_simulator.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ type PoolSimulator struct {
gas Gas
}

func (p *PoolSimulator) CalculateLimit() map[string]*big.Int {
return nil
}

func NewPoolSimulator(entityPool entity.Pool) (*PoolSimulator, error) {
var extra Extra
if err := json.Unmarshal([]byte(entityPool.Extra), &extra); err != nil {
Expand Down
4 changes: 0 additions & 4 deletions pkg/source/makerpsm/pool_simulator.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ type PoolSimulator struct {
gas Gas
}

func (p *PoolSimulator) CalculateLimit() map[string]*big.Int {
return nil
}

func NewPoolSimulator(entityPool entity.Pool) (*PoolSimulator, error) {
var extra Extra
if err := json.Unmarshal([]byte(entityPool.Extra), &extra); err != nil {
Expand Down
5 changes: 0 additions & 5 deletions pkg/source/mantisswap/pool_simulator.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package mantisswap
import (
"encoding/json"
"fmt"
"math/big"

"github.com/KyberNetwork/logger"

Expand All @@ -17,10 +16,6 @@ type PoolSimulator struct {
gas Gas
}

func (p *PoolSimulator) CalculateLimit() map[string]*big.Int {
return nil
}

func NewPoolSimulator(entityPool entity.Pool) (*PoolSimulator, error) {
var extra Extra
if err := json.Unmarshal([]byte(entityPool.Extra), &extra); err != nil {
Expand Down
4 changes: 0 additions & 4 deletions pkg/source/maverickv1/pool_simulator.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ type Pool struct {
gas Gas
}

func (p *Pool) CalculateLimit() map[string]*big.Int {
return nil
}

func NewPoolSimulator(entityPool entity.Pool) (*Pool, error) {
var extra Extra
if err := json.Unmarshal([]byte(entityPool.Extra), &extra); err != nil {
Expand Down
4 changes: 0 additions & 4 deletions pkg/source/metavault/pool_simulator.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ type PoolSimulator struct {
gas Gas
}

func (p *PoolSimulator) CalculateLimit() map[string]*big.Int {
return nil
}

func NewPoolSimulator(entityPool entity.Pool) (*PoolSimulator, error) {
var extra Extra
if err := json.Unmarshal([]byte(entityPool.Extra), &extra); err != nil {
Expand Down
Loading

0 comments on commit b922e8b

Please sign in to comment.