perps_test

package
v0.15.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 17, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PriceUpdateData added in v0.1.23

type PriceUpdateData struct {
	Data string `json:"data"`
}

type SettlementStrategy added in v0.1.23

type SettlementStrategy struct {
	StrategyType              int     `json:"strategy_type"`
	SettlementDelay           int     `json:"settlement_delay"`
	SettlementWindowDuration  int     `json:"settlement_window_duration"`
	PriceWindowDuration       int     `json:"price_window_duration"`
	PriceVerificationContract string  `json:"price_verification_contract"`
	FeedID                    []byte  `json:"feed_id"`
	FeedIDx                   string  `json:"feed_id_x"`
	URL                       string  `json:"url"`
	SettlementReward          float64 `json:"settlement_reward"`
	Disabled                  bool    `json:"disabled"`
}

func GetSettlementStrategy added in v0.1.23

func GetSettlementStrategy(market, strategy int) *SettlementStrategy

type TestPerpsMarket

type TestPerpsMarket struct {
	TestAddress common.Address

	TestAccount *big.Int
	// contains filtered or unexported fields
}

func GetTestPerpsMarket

func GetTestPerpsMarket(rpcUrl string, perpsMarketAddress string, sUSDTAddress string, chainID int) *TestPerpsMarket

func (*TestPerpsMarket) Close

func (m *TestPerpsMarket) Close()

func (*TestPerpsMarket) CommitOrder

func (m *TestPerpsMarket) CommitOrder(marketIDS string, sizeS string)

func (*TestPerpsMarket) CreateAccount

func (m *TestPerpsMarket) CreateAccount()

func (*TestPerpsMarket) GetApproval

func (m *TestPerpsMarket) GetApproval()

func (*TestPerpsMarket) GetCollateralAmount

func (m *TestPerpsMarket) GetCollateralAmount(marketIDS string)

func (*TestPerpsMarket) GetUSDTBalance

func (m *TestPerpsMarket) GetUSDTBalance()

func (*TestPerpsMarket) GrantPermission

func (m *TestPerpsMarket) GrantPermission(idS string, permissionS string, userS string)

func (*TestPerpsMarket) LiquidateAccount added in v0.1.22

func (m *TestPerpsMarket) LiquidateAccount(accountIDs string)

func (*TestPerpsMarket) ModifyCollateral

func (m *TestPerpsMarket) ModifyCollateral(marketIDS string, amountS string)

func (*TestPerpsMarket) SetApproval

func (m *TestPerpsMarket) SetApproval(amountS string)

func (*TestPerpsMarket) SettlePythOrder added in v0.1.23

func (m *TestPerpsMarket) SettlePythOrder(accountID *big.Int, maxPythTries int, pythDelay time.Duration) error

SettlePythOrder settles an order by fetching data from the Pyth price feed and submitting a transaction

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL