earn

package
v0.0.0-...-eb215bf Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APREstimate

type APREstimate struct {
	// Maximal yield percentage for one year
	High string `json:"high"`
	// Minimal yield percentage for one year
	Low string `json:"low"`
}

Estimate for the revenues from the strategy.

The estimate is based on previous revenues from the strategy.

type AllocateEarnFundsRequestParameters

type AllocateEarnFundsRequestParameters struct {
	// The amount to allocate.
	Amount string `json:"amount"`
	// A unique identifier of the chosen earn strategy, as returned from ListEarnStrategies.
	StrategyId string `json:"strategy_id"`
}

Request parameters for AllocateEarnFunds

type AllocateEarnFundsResponse

type AllocateEarnFundsResponse struct {
	common.KrakenSpotRESTResponse
	Result bool `json:"result"`
}

Response for AllocateEarnFunds

type AllocatedAmount

type AllocatedAmount struct {
	Reward
	// The total number of allocations in this state for this asset.
	AllocationCount int `json:"allocation_count"`
	// Details about when each allocation will expire and move to the next state
	Allocations []AllocationDetails `json:"allocations"`
}

Amount allocated to a state

type AllocationDetails

type AllocationDetails struct {
	Reward
	// The date and time which a request to either allocate or deallocate was received and processed.
	//
	// For a deallocation request to a strategy with an exit-queue, this will be the time the funds
	// joined the exit queue. For a deallocation request to a strategy without exit queue, this
	// will be the time the funds started unbonding.
	CreatedAt string `json:"created_at"`
	// The date/time the funds will be unbonded.
	Expires string `json:"expires"`
}

Details about when each allocation will expire and move to the next state.

type Allocations

type Allocations struct {
	// Amount allocated in bonding status.
	Bonding *AllocatedAmount `json:"bonding,omitempty"`
	// Amount allocated in the exit-queue status
	ExitQueue *AllocatedAmount `json:"exit_queue,omitempty"`
	// Pending allocation amount - can be negative if the pending operation is deallocation
	Pending *Reward `json:"pending,omitempty"`
	// Amount allocated in unbonding status.
	Unbonding *AllocatedAmount `json:"unbonding,omitempty"`
	// Total amount allocated to this Earn strategy
	Total Reward `json:"total"`
}

Amounts allocated per state.

type AutoCompound

type AutoCompound struct {
	// Autocompound type
	//
	// Cf AutoCompoundType for values
	Type string `json:"type"`
	// Default behavior when auto compound is optional.
	//
	// Use that value only if type is optional.
	Default bool `json:"default"`
}

Auto compound choices for the earn strategy.

type AutoCompoundType

type AutoCompoundType string

Enum for AutoCompound.Type

const (
	Enabled  AutoCompoundType = "enabled"
	Disabled AutoCompoundType = "disabled"
	Optional AutoCompoundType = "optional"
)

Values for AutoCompoundType

type BondedLockType

type BondedLockType struct {
	// Duration of the bonding period, in seconds
	BondingPeriod int64 `json:"bonding_period,omitempty"`
	// Is the bonding period length variable (true) or static (false; default)
	BondingPeriodVariable bool `json:"bonding_period_variable,omitempty"`
	// Whether rewards are earned during the bonding period (payouts occur after bonding is complete).
	BondingRewards bool `json:"bonding_rewards,omitempty"`
	// In order to remove funds, if this value is greater than 0, funds will first have to enter an
	//  exit queue and will have to wait for the exit queue period to end. Once ended, her funds
	// will then follow and respect the unbonding_period.
	//
	// If the value of the exit queue period is 0, then no waiting will have to occur and the exit
	// queue will be skipped.
	//
	// Rewards are always paid out for the exit queue
	ExitQueuePeriod int64 `json:"exit_queue_period,omitempty"`
	// Duration of the unbonding period in seconds. In order to remove funds, you must wait for
	// the unbonding period to pass after requesting removal before funds become available in
	// her spot wallet.
	UnbondingPeriod int64 `json:"unbonding_period,omitempty"`
	// Is the unbonding period length variable (true) or static (false; default)
	UnbondingPeriodVariable bool `json:"unbonding_period_variable,omitempty"`
	// Whether rewards are earned and payouts are done during the unbonding period.
	UnbondingRewards bool `json:"unbonding_rewards,omitempty"`
}

Additional data of a bonded lock type

type DeallocateEarnFundsRequestParameters

type DeallocateEarnFundsRequestParameters struct {
	// The amount to deallocate.
	Amount string `json:"amount"`
	// A unique identifier of the chosen earn strategy, as returned from ListEarnStrategies.
	StrategyId string `json:"strategy_id"`
}

Request parameters for DeallocateEarnFunds

type DeallocateEarnFundsResponse

type DeallocateEarnFundsResponse struct {
	common.KrakenSpotRESTResponse
	Result bool `json:"result"`
}

Response for DeallocateEarnFunds

type EarnAllocation

type EarnAllocation struct {
	// Amounts allocated to this Earn strategy
	AmountAllocated Allocations `json:"amount_allocated"`
	// The asset of the native currency of this allocation
	NativeAsset string `json:"native_asset"`
	// Information about the current payout period (if any)
	Payout *Payout `json:"payout,omitempty"`
	// Unique ID for Earn Strategy
	StrategyId string `json:"strategy_id"`
	// Amount earned using the strategy during the whole lifetime of user account
	TotalRewarded Reward `json:"total_rewarded"`
}

Amounts allocated to an earn strategy.

type EarnStrategy

type EarnStrategy struct {
	// Fee applied when allocating to this strategy.
	AllocationFee json.Number `json:"allocation_fee"`
	// Reason list why user is not eligible for allocating to the strategy.
	AllocationRestrictionInfo []string `json:"allocation_restriction_info"`
	// Estimate for the revenues from the strategy.
	//
	// The estimate is based on previous revenues from the strategy.
	APREstimate *APREstimate `json:"apr_estimate,omitempty"`
	// The asset to invest for this earn strategy
	Asset string `json:"asset"`
	// Auto compound choices for the earn strategy.
	AutoCompound AutoCompound `json:"auto_compound"`
	// Is allocation available for this strategy
	CanAllocate bool `json:"can_allocate"`
	// Is deallocation available for this strategy
	CanDeallocate bool `json:"can_deallocate"`
	// Fee applied when deallocating from this strategy
	DeallocationFee json.Number `json:"deallocation_fee"`
	// The unique identifier for this strategy
	Id string `json:"id"`
	// lock_type
	LockType LockType `json:"lock_type"`
	// The maximum amount of funds that any given user may allocate to an account. Absence of value
	// means there is no limit. Zero means that all new allocations will return an error (though
	// auto-compound is unaffected).
	UserCap string `json:"user_cap,omitempty"`
	// Minimum amount (in USD) for an allocation or deallocation
	UserMinAllocation string `jsoon:"user_min_allocation,omitempty"`
	// Yield generation mechanism of this strategy
	YieldSource YieldSource `json:"yield_source"`
}

Data of a single earn strategy

type GetAllocationStatusRequestParameters

type GetAllocationStatusRequestParameters struct {
	// A unique identifier of the chosen earn strategy, as returned from ListEarnStrategies.
	StrategyId string `json:"strategy_id"`
}

Request parameters for GetAllocationStatus

type GetAllocationStatusResponse

type GetAllocationStatusResponse struct {
	common.KrakenSpotRESTResponse
	Result *GetAllocationStatusResult `json:"result,omitempty"`
}

Response for GetAllocationStatus

type GetAllocationStatusResult

type GetAllocationStatusResult struct {
	// true if an operation is still in progress on the same strategy.
	Pending bool `json:"pending"`
}

Result for GetAllocationStatus

type GetDeallocationStatusRequestParameters

type GetDeallocationStatusRequestParameters struct {
	// A unique identifier of the chosen earn strategy, as returned from ListEarnStrategies.
	StrategyId string `json:"strategy_id"`
}

Request parameters for GetDeallocationStatus

type GetDeallocationStatusResponse

type GetDeallocationStatusResponse struct {
	common.KrakenSpotRESTResponse
	Result *GetDeallocationStatusResult `json:"result,omitempty"`
}

Response for GetDeallocationStatus

type GetDeallocationStatusResult

type GetDeallocationStatusResult struct {
	// true if an operation is still in progress on the same strategy.
	Pending bool `json:"pending"`
}

Result for GetDeallocationStatus

type ListEarnAllocationsRequestOptions

type ListEarnAllocationsRequestOptions struct {
	// true to sort ascending, false (the default) for descending.
	Ascending bool `json:"ascending"`
	// A secondary currency to express the value of your allocations (the default is USD).
	//
	// An empty value triggers the default behavior.
	ConvertedAsset string `json:"converted_asset,omitempty"`
	// Omit entries for strategies that were used in the past but now they don't hold any allocation (the default is false).
	HideZeroAllocations bool `json:"hide_zero_allocations"`
}

Request options for ListEarnAllocations request.

type ListEarnAllocationsResponse

type ListEarnAllocationsResponse struct {
	common.KrakenSpotRESTResponse
	Result *ListEarnAllocationsResult `json:"result,omitempty"`
}

Response for ListEarnAllocations

type ListEarnAllocationsResult

type ListEarnAllocationsResult struct {
	// A secondary asset to show the value of allocations. (Eg. you also want to see the value of
	// your allocations in USD). Choose this in the request parameters.
	ConvertedAsset string `json:"converted_asset"`
	// Earn allocations by startegy.
	Items []EarnAllocation `json:"items"`
	// The total amount allocated across all strategies, denominated in the converted_asset currency.
	TotalAllocated string `json:"total_allocated"`
	// Amount earned across all strategies during the whole lifetime of user account, denominated
	// in converted_asset currency.
	TotalRewarded string `json:"total_rewarded"`
}

Result for ListEarnAllocations

type ListEarnStrategiesRequestOptions

type ListEarnStrategiesRequestOptions struct {
	// True to sort ascending, false (the default) for descending.
	Ascending bool `json:"ascending"`
	// Filter strategies by asset name.
	//
	// An empty value means no filter.
	Asset string `json:"asset"`
	// Empty to start at beginning/end, otherwise next page ID.
	Cursor string `json:"cursor"`
	// How many items to return per page. Note that the limit may be cap'd to lower value in the
	// application code.
	//
	// A zero value triggers the default behavior.
	Limit int `json:"limit"`
	// Filter strategies by lock type.
	//
	// An empty value means no filter.
	LockType []string `json:"lock_type"`
}

Request options for ListEarnStrategies

type ListEarnStrategiesResponse

type ListEarnStrategiesResponse struct {
	common.KrakenSpotRESTResponse
	Result *ListEarnStrategiesResult `json:"result,omitempty"`
}

Response for ListEarnStrategies

type ListEarnStrategiesResult

type ListEarnStrategiesResult struct {
	// Index to send into Cursor for next page, absence of value or an empty value means you've
	// reached the end.
	NextCursor string `json:"next_cursor,omitempty"`
	// Listed earn strategies.
	Items []EarnStrategy `json:"items"`
}

Result for ListEarnStrategies

type LockType

type LockType struct {
	// Lock type.
	//
	// Cf LockTypeEnum for values.
	Type string `json:"type"`
	BondedLockType
	TimedLockType
	// At what intervals are rewards distributed and credited to the user’s ledger.
	// If 0 or absent, then the payout happens at the end of lock duration, in seconds.
	//
	// Used by both instant, bonded and timed lock types.
	PayoutFrequency int64 `json:"payout_frequency,omitempty"`
}

Lock type data. Additional data will be available in the corresponding embedded structs in case type is instant, timed or bonded. Other structs will remain nil.

type LockTypeEnum

type LockTypeEnum string

Enum for LockType

const (
	Instant LockTypeEnum = "instant"
	Bonded  LockTypeEnum = "bonded"
	Timed   LockTypeEnum = "timed"
	Flex    LockTypeEnum = "flex"
)

Values for LockTypeEnum

type Payout

type Payout struct {
	// Reward accumulated in the payout period until now.
	AccumulatedReward Reward `json:"accumulated_reward"`
	// Estimated reward from now until the payout.
	EstimatedReward Reward `json:"estimated_reward"`
	// Tentative date of the next reward payout.
	PeriodEnd string `json:"period_end"`
	// When the current payout period started. Either the date of the last payout or when it was enabled.
	PeriodStart string `json:"period_start"`
}

Information about the current payout period.

type Reward

type Reward struct {
	// Amount converted into the requested asset.
	Converted string `json:"converted"`
	// Amount in the native asset.
	Native string `json:"native"`
}

Amount earned using the strategy during the whole lifetime of user account.

type TimedLockType

type TimedLockType struct {
	// Funds are locked for this duration, in seconds
	Duration int64 `json:"duration,omitempty"`
}

Additional data of a timed lock type

type YieldSource

type YieldSource struct {
	Type string `json:"type"`
}

Yield generation mechanism of an earn strategy

type YieldSourceEnum

type YieldSourceEnum string

Enum for yield source

const (
	OffChain YieldSourceEnum = "off_chain"
	Staking  YieldSourceEnum = "staking"
)

Values for YieldSource

Jump to

Keyboard shortcuts

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