-
Notifications
You must be signed in to change notification settings - Fork 6
/
types.go
70 lines (62 loc) · 2.28 KB
/
types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
package smartalpha
import (
"math/big"
"github.com/barnbridge/meminero/types"
)
type Pool struct {
PoolName string `json:"poolName"`
PoolAddress string `json:"poolAddress"`
PoolToken types.Token
JuniorTokenAddress string `json:"juniorTokenAddress"`
JuniorTokenSymbol string `json:"juniorTokenSymbol"`
SeniorTokenAddress string `json:"seniorTokenAddress"`
SeniorTokenSymbol string `json:"seniorTokenSymbol"`
OracleAddress string `json:"oracleAddress"`
OracleAssetSymbol string `json:"oracleAssetSymbol"`
SeniorRateModelAddress string `json:"seniorRateModelAddress"`
AccountingModelAddress string `json:"accountingModelAddress"`
Epoch1Start int64 `json:"epoch1Start"`
EpochDuration int64 `json:"epochDuration"`
StartAtBlock int64 `json:"startAtBlock"`
}
const JuniorTranche = "JUNIOR"
const SeniorTranche = "SENIOR"
type TxType string
const (
JuniorEntry TxType = "JUNIOR_ENTRY"
JuniorRedeemTokens TxType = "JUNIOR_REDEEM_TOKENS"
JuniorExit TxType = "JUNIOR_EXIT"
JuniorRedeemUnderlying TxType = "JUNIOR_REDEEM_UNDERLYING"
SeniorEntry TxType = "SENIOR_ENTRY"
SeniorRedeemTokens TxType = "SENIOR_REDEEM_TOKENS"
SeniorExit TxType = "SENIOR_EXIT"
SeniorRedeemUnderlying TxType = "SENIOR_REDEEM_UNDERLYING"
JtokenSend TxType = "JTOKEN_SEND"
JtokenReceive TxType = "JTOKEN_RECEIVE"
StokenSend TxType = "STOKEN_SEND"
StokenReceive TxType = "STOKEN_RECEIVE"
)
type State struct {
PoolAddress string
QueuedJuniorsUnderlyingIn *big.Int
QueuedJuniorsUnderlyingOut *big.Int
QueuedJuniorTokensBurn *big.Int
QueuedSeniorsUnderlyingIn *big.Int
QueuedSeniorsUnderlyingOut *big.Int
QueuedSeniorTokensBurn *big.Int
EstimatedJuniorLiquidity *big.Int
EstimatedSeniorLiquidity *big.Int
EstimatedJuniorTokenPrice *big.Int
EstimatedSeniorTokenPrice *big.Int
}
type EpochInfo struct {
PoolAddress string
Epoch *big.Int
SeniorLiquidity *big.Int
JuniorLiquidity *big.Int
UpsideExposureRate *big.Int
DownsideProtectionRate *big.Int
JuniorTokenPrice *big.Int
SeniorTokenPrice *big.Int
EpochEntryPrice *big.Int
}