Documentation ¶
Index ¶
- func GetExcessAssetKey(poolAddress string, assetID int) (key []byte, err error)
- type BurnQuote
- type MintQuote
- type Pool
- func (s *Pool) Address() (poolAddress string, err error)
- func (s *Pool) Asset1Price() float64
- func (s *Pool) Asset2Price() float64
- func (s *Pool) Convert(amount *assets.AssetAmount) (assetAmount *assets.AssetAmount)
- func (s *Pool) FetchBurnQuote(liquidityAssetIn *assets.AssetAmount, slippage float64) (quote *BurnQuote, err error)
- func (s *Pool) FetchBurnQuoteWithDefaultSlippage(liquidityAssetIn *assets.AssetAmount) (quote *BurnQuote, err error)
- func (s *Pool) FetchExcessAmounts(userAddress string) (excessAmounts map[int]string, err error)
- func (s *Pool) FetchExcessAmountsStr(userAddress string) (excessAmountsStr string, err error)
- func (s *Pool) FetchFixedInputSwapQuote(amountIn *assets.AssetAmount, slippage float64) (quote *SwapQuote, err error)
- func (s *Pool) FetchFixedInputSwapQuoteWithDefaultSlippage(amountIn *assets.AssetAmount) (quote *SwapQuote, err error)
- func (s *Pool) FetchFixedOutputSwapQuote(amountOut *assets.AssetAmount, slippage float64) (quote *SwapQuote, err error)
- func (s *Pool) FetchFixedOutputSwapQuoteWithDefaultSlippage(amountOut *assets.AssetAmount) (quote *SwapQuote, err error)
- func (s *Pool) FetchMintQuote(amountA, amountB *assets.AssetAmount, slippage float64) (quote *MintQuote, err error)
- func (s *Pool) FetchMintQuoteWithDefaultSlippage(amountA, amountB *assets.AssetAmount) (quote *MintQuote, err error)
- func (s *Pool) FetchPoolPosition(poolerAddress string) (poolPosition map[string]string, err error)
- func (s *Pool) FetchPoolPositionStr(poolerAddress string) (poolPositionStr string, err error)
- func (s *Pool) FetchState() (validatorAppState map[string]models.TealValue, err error)
- func (s *Pool) FetchStateStr() (validatorAppStateStr string, err error)
- func (s *Pool) FetchStateWithKey(key interface{}) (state int, err error)
- func (s *Pool) GetLogicsig() (poolLogicsig *types.LogicSig, err error)
- func (s *Pool) GetMinimumBalance() int
- func (s *Pool) Info() (poolInfo *PoolInfo, err error)
- func (s *Pool) PrepareBootstrapTransactions(poolerAddress string) (txnGroup *utils.TransactionGroup, err error)
- func (s *Pool) PrepareBurnTransactions(liquidityAssetAmount *assets.AssetAmount, amountsOutStr, poolerAddress string) (txnGroup *utils.TransactionGroup, err error)
- func (s *Pool) PrepareBurnTransactionsFromQuote(quote *BurnQuote, poolerAddress string) (txnGroup *utils.TransactionGroup, err error)
- func (s *Pool) PrepareLiquidityAssetOptinTransactions(userAddress string) (txnGroup *utils.TransactionGroup, err error)
- func (s *Pool) PrepareMintTransactions(amountsInStr string, liquidityAssetAmount *assets.AssetAmount, ...) (txnGroup *utils.TransactionGroup, err error)
- func (s *Pool) PrepareMintTransactionsFromQuote(quote *MintQuote, poolerAddress string) (txnGroup *utils.TransactionGroup, err error)
- func (s *Pool) PrepareRedeemFeesTransactions(amount, creatorAddress, userAddress string) (txnGroup *utils.TransactionGroup, err error)
- func (s *Pool) PrepareRedeemTransactions(amountOut *assets.AssetAmount, userAddress string) (txnGroup *utils.TransactionGroup, err error)
- func (s *Pool) PrepareSwapTransactions(amountIn, amountOut *assets.AssetAmount, swapType string, ...) (txnGroup *utils.TransactionGroup, err error)
- func (s *Pool) PrepareSwapTransactionsFromQuote(quote *SwapQuote, swapperAddress string) (txnGroup *utils.TransactionGroup, err error)
- func (s *Pool) Refresh() (err error)
- func (s *Pool) UpdateFromInfo(info *PoolInfo)
- type PoolInfo
- type SwapQuote
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BurnQuote ¶
type BurnQuote struct { LiquidityAssetAmount *assets.AssetAmount Slippage float64 // contains filtered or unexported fields }
func (*BurnQuote) AmountsOutWithSlippage ¶
func (*BurnQuote) GetAmountsOut ¶
func (*BurnQuote) GetAmountsOutStr ¶
type MintQuote ¶
type MintQuote struct { LiquidityAssetAmount *assets.AssetAmount Slippage float64 // contains filtered or unexported fields }
TODO: in python code AmountsIn is dict[AssetAmount]
func (*MintQuote) GetAmountsIn ¶
func (*MintQuote) GetAmountsInStr ¶
func (*MintQuote) LiquidityAssetAmountWithSlippage ¶
func (s *MintQuote) LiquidityAssetAmountWithSlippage() (assetAmount *assets.AssetAmount, err error)
TODO: in python code it return int
type Pool ¶
type Pool struct { Client *client.TinymanClient ValidatorAppId int Asset1 *assets.Asset Asset2 *assets.Asset Exists bool LiquidityAsset *assets.Asset Asset1Reserves string Asset2Reserves string IssuedLiquidity string UnclaimedProtocolFees string OutstandingAsset1Amount string OutstandingAsset2Amount string OutstandingLiquidityAssetAmount string LastRefreshedRound int AlgoBalance string MinBalance int }
func NewPool ¶
func NewPool(client *client.TinymanClient, assetA, assetB *assets.Asset, info *PoolInfo, fetch bool, validatorAppId int) (pool *Pool, err error)
TODO: is validatorID == 0 a valid ID
func NewPoolFromAccountInfo ¶
func NewPoolFromAccountInfo(accountInfo models.Account, client *client.TinymanClient) (pool *Pool, err error)
not compatible with go-mobile
func (*Pool) Asset1Price ¶
func (*Pool) Asset2Price ¶
func (*Pool) Convert ¶
func (s *Pool) Convert(amount *assets.AssetAmount) (assetAmount *assets.AssetAmount)
func (*Pool) FetchBurnQuote ¶
func (*Pool) FetchBurnQuoteWithDefaultSlippage ¶
func (s *Pool) FetchBurnQuoteWithDefaultSlippage(liquidityAssetIn *assets.AssetAmount) (quote *BurnQuote, err error)
func (*Pool) FetchExcessAmounts ¶
func (*Pool) FetchExcessAmountsStr ¶
func (*Pool) FetchFixedInputSwapQuote ¶
func (*Pool) FetchFixedInputSwapQuoteWithDefaultSlippage ¶
func (s *Pool) FetchFixedInputSwapQuoteWithDefaultSlippage(amountIn *assets.AssetAmount) (quote *SwapQuote, err error)
func (*Pool) FetchFixedOutputSwapQuote ¶
func (*Pool) FetchFixedOutputSwapQuoteWithDefaultSlippage ¶
func (s *Pool) FetchFixedOutputSwapQuoteWithDefaultSlippage(amountOut *assets.AssetAmount) (quote *SwapQuote, err error)
func (*Pool) FetchMintQuote ¶
func (*Pool) FetchMintQuoteWithDefaultSlippage ¶
func (s *Pool) FetchMintQuoteWithDefaultSlippage(amountA, amountB *assets.AssetAmount) (quote *MintQuote, err error)
func (*Pool) FetchPoolPosition ¶
func (*Pool) FetchPoolPositionStr ¶
func (*Pool) FetchState ¶
func (*Pool) FetchStateStr ¶
func (*Pool) FetchStateWithKey ¶
not compatible with go-mobile
func (*Pool) GetMinimumBalance ¶
func (*Pool) PrepareBootstrapTransactions ¶
func (s *Pool) PrepareBootstrapTransactions(poolerAddress string) (txnGroup *utils.TransactionGroup, err error)
func (*Pool) PrepareBurnTransactions ¶
func (s *Pool) PrepareBurnTransactions(liquidityAssetAmount *assets.AssetAmount, amountsOutStr, poolerAddress string) (txnGroup *utils.TransactionGroup, err error)
func (*Pool) PrepareBurnTransactionsFromQuote ¶
func (*Pool) PrepareLiquidityAssetOptinTransactions ¶
func (s *Pool) PrepareLiquidityAssetOptinTransactions(userAddress string) (txnGroup *utils.TransactionGroup, err error)
func (*Pool) PrepareMintTransactions ¶
func (s *Pool) PrepareMintTransactions(amountsInStr string, liquidityAssetAmount *assets.AssetAmount, poolerAddress string) (txnGroup *utils.TransactionGroup, err error)
TODO: type dic[Asset] is dict[Asset,AssetAmount] in python code
func (*Pool) PrepareMintTransactionsFromQuote ¶
func (*Pool) PrepareRedeemFeesTransactions ¶
func (s *Pool) PrepareRedeemFeesTransactions(amount, creatorAddress, userAddress string) (txnGroup *utils.TransactionGroup, err error)
func (*Pool) PrepareRedeemTransactions ¶
func (s *Pool) PrepareRedeemTransactions(amountOut *assets.AssetAmount, userAddress string) (txnGroup *utils.TransactionGroup, err error)
func (*Pool) PrepareSwapTransactions ¶
func (s *Pool) PrepareSwapTransactions(amountIn, amountOut *assets.AssetAmount, swapType string, swapperAddress string) (txnGroup *utils.TransactionGroup, err error)
func (*Pool) PrepareSwapTransactionsFromQuote ¶
func (*Pool) UpdateFromInfo ¶
type PoolInfo ¶
type PoolInfo struct { Address string Asset1Id int Asset2Id int Asset1UnitName string Asset2UnitName string LiquidityAssetId int LiquidityAssetName string Asset1Reserves string Asset2Reserves string IssuedLiquidity string UnclaimedProtocolFees string OutstandingAsset1Amount string OutstandingAsset2Amount string OutstandingLiquidityAssetAmount string ValidatorAppId int AlgoBalance string Round int LastRefreshedRound int }
func GetPoolInfo ¶
func GetPoolInfo(client *client.TinymanClient, validatorAppID, asset1ID, asset2ID int) (poolInfo *PoolInfo, err error)
type SwapQuote ¶
type SwapQuote struct { SwapType string AmountIn *assets.AssetAmount AmountOut *assets.AssetAmount SwapFees *assets.AssetAmount Slippage float64 }
func (*SwapQuote) AmountInWithSlippage ¶
func (s *SwapQuote) AmountInWithSlippage() (assetAmount *assets.AssetAmount, err error)
func (*SwapQuote) AmountOutWithSlippage ¶
func (s *SwapQuote) AmountOutWithSlippage() (assetAmount *assets.AssetAmount, err error)
func (*SwapQuote) PriceWithSlippage ¶
Click to show internal directories.
Click to hide internal directories.