/
models.go
840 lines (716 loc) · 26.8 KB
/
models.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
// Code generated by github.com/99designs/gqlgen, DO NOT EDIT.
package gql
import (
"fmt"
"io"
"strconv"
"github.com/elysiumstation/fury/protos/data-node/api/v2"
"github.com/elysiumstation/fury/protos/fury"
"github.com/elysiumstation/fury/protos/fury/data/v1"
)
// One of the possible asset sources
type AssetSource interface {
IsAssetSource()
}
type DataSourceKind interface {
IsDataSourceKind()
}
// Union type for wrapped events in stream PROPOSAL is mapped to governance data, something to keep in mind
type Event interface {
IsEvent()
}
type ExternalDataSourceKind interface {
IsExternalDataSourceKind()
}
type InternalDataSourceKind interface {
IsInternalDataSourceKind()
}
type Oracle interface {
IsOracle()
}
type Product interface {
IsProduct()
}
type ProposalChange interface {
IsProposalChange()
}
type RiskModel interface {
IsRiskModel()
}
type SignerKind interface {
IsSignerKind()
}
type TransferKind interface {
IsTransferKind()
}
// One of the possible asset sources for update assets proposals
type UpdateAssetSource interface {
IsUpdateAssetSource()
}
type UpdateMarketRiskParameters interface {
IsUpdateMarketRiskParameters()
}
type WithdrawalDetails interface {
IsWithdrawalDetails()
}
// An auction duration is used to configure 3 auction periods:
// 1. `duration > 0`, `volume == 0`:
// The auction will last for at least N seconds.
// 2. `duration == 0`, `volume > 0`:
// The auction will end once the given volume will match at uncrossing.
// 3. `duration > 0`, `volume > 0`:
// The auction will take at least N seconds, but can end sooner if the market can trade a certain volume.
type AuctionDuration struct {
// Duration of the auction in seconds
DurationSecs int `json:"durationSecs"`
// Target uncrossing trading volume
Volume int `json:"volume"`
}
// A Fury builtin asset, mostly for testing purpose
type BuiltinAsset struct {
// Maximum amount that can be requested by a party through the built-in asset faucet at a time
MaxFaucetAmountMint string `json:"maxFaucetAmountMint"`
}
func (BuiltinAsset) IsAssetSource() {}
type BusEvent struct {
// The ID for this event
ID string `json:"id"`
// The block hash
Block string `json:"block"`
// The type of event
Type BusEventType `json:"type"`
// The payload - the wrapped event
Event Event `json:"event"`
}
// A mode where Fury tries to execute orders as soon as they are received
type ContinuousTrading struct {
// Size of an increment in price in terms of the quote currency
TickSize string `json:"tickSize"`
}
// A data source contains the data sent by a data source
type Data struct {
// signers is the list of public keys/ETH addresses that signed the data
Signers []*Signer `json:"signers"`
// properties contains all the properties sent by a data source
Data []*v1.Property `json:"data"`
// List of all the data specs that matched this source data.
// When the array is empty, it means no data spec matched this source data.
MatchedSpecIds []string `json:"matchedSpecIds"`
// RFC3339Nano formatted date and time for when the data was broadcast to the markets
// with a matching data spec.
// It has no value when the source data does not match any data spec.
BroadcastAt int64 `json:"broadcastAt"`
}
// DataSourceDefinition represents the top level object that deals with data sources.
// DataSourceDefinition can be external or internal, with whatever number of data sources are defined
// for each type in the child objects below.
type DataSourceDefinition struct {
SourceType DataSourceKind `json:"sourceType"`
}
// DataSourceDefinitionExternal is the top level object used for all external data sources.
// It contains one of any of the defined `SourceType` variants.
type DataSourceDefinitionExternal struct {
SourceType ExternalDataSourceKind `json:"sourceType"`
}
func (DataSourceDefinitionExternal) IsDataSourceKind() {}
// DataSourceDefinitionInternal is the top level object used for all internal data sources.
// It contains one of any of the defined `SourceType` variants.
type DataSourceDefinitionInternal struct {
SourceType InternalDataSourceKind `json:"sourceType"`
}
func (DataSourceDefinitionInternal) IsDataSourceKind() {}
// An data source specification describes the data source data that a product (or a risk model)
// wants to get from the oracle engine.
type DataSourceSpec struct {
// ID is a hash generated from the DataSourceSpec data.
ID string `json:"id"`
// RFC3339Nano creation date time
CreatedAt int64 `json:"createdAt"`
// RFC3339Nano last updated timestamp
UpdatedAt *int64 `json:"updatedAt"`
Data *DataSourceDefinition `json:"data"`
// Status describes the status of the data source spec
Status DataSourceSpecStatus `json:"status"`
}
// DataSourceSpecConfigurationTime is the internal data source used for emitting timestamps.
type DataSourceSpecConfigurationTime struct {
Conditions []*v1.Condition `json:"conditions"`
}
func (DataSourceSpecConfigurationTime) IsInternalDataSourceKind() {}
// Frequent batch auctions trading mode
type DiscreteTrading struct {
// Duration of the discrete trading batch in nanoseconds. Maximum 1 month.
Duration int `json:"duration"`
// Size of an increment in price in terms of the quote currency
TickSize string `json:"tickSize"`
}
// Dispatch strategy for a recurring transfer
type DispatchStrategy struct {
// Defines the data that will be used to compare markets so as to distribute rewards appropriately
DispatchMetric fury.DispatchMetric `json:"dispatchMetric"`
// The asset to use for measuring contribution to the metric
DispatchMetricAssetID string `json:"dispatchMetricAssetId"`
// Scope the dispatch to this market only under the metric asset
MarketIdsInScope []string `json:"marketIdsInScope"`
}
// An asset originated from an Ethereum ERC20 Token
type Erc20 struct {
// The address of the ERC20 contract
ContractAddress string `json:"contractAddress"`
// The lifetime limits deposit per address
// Note: this is a temporary measure that can be changed by governance
LifetimeLimit string `json:"lifetimeLimit"`
// The maximum you can withdraw instantly. All withdrawals over the threshold will be delayed by the withdrawal delay.
// There is no limit on the size of a withdrawal
// Note: this is a temporary measure that can be changed by governance
WithdrawThreshold string `json:"withdrawThreshold"`
}
func (Erc20) IsAssetSource() {}
type ERC20MultiSigSignerAddedBundleEdge struct {
Node *v2.ERC20MultiSigSignerAddedBundle `json:"node"`
Cursor string `json:"cursor"`
}
// Response for the signature bundle to add a particular validator to the signer list of the multisig contract
type ERC20MultiSigSignerAddedConnection struct {
Edges []*ERC20MultiSigSignerAddedBundleEdge `json:"edges"`
PageInfo *v2.PageInfo `json:"pageInfo"`
}
type ERC20MultiSigSignerRemovedBundleEdge struct {
Node *v2.ERC20MultiSigSignerRemovedBundle `json:"node"`
Cursor string `json:"cursor"`
}
// Response for the signature bundle to remove a particular validator from the signer list of the multisig contract
type ERC20MultiSigSignerRemovedConnection struct {
// The list of signer bundles for that validator
Edges []*ERC20MultiSigSignerRemovedBundleEdge `json:"edges"`
// The pagination information
PageInfo *v2.PageInfo `json:"pageInfo"`
}
// Response for the signature bundle to update the token limits (maxLifetimeDeposit and withdrawThreshold) for a given ERC20 token (already allowlisted) in the collateral bridge
type ERC20SetAssetLimitsBundle struct {
// The address of the asset on ethereum
AssetSource string `json:"assetSource"`
// The ID of the fury asset
FuryAssetID string `json:"furyAssetId"`
// The nonce, which is actually the internal reference for the proposal
Nonce string `json:"nonce"`
// The lifetime limit deposit for this asset
LifetimeLimit string `json:"lifetimeLimit"`
// The threshold withdraw for this asset
Threshold string `json:"threshold"`
// The signatures bundle as hex encoded data, forward by 0x
// e.g: 0x + sig1 + sig2 + ... + sixN
Signatures string `json:"signatures"`
}
type ETHAddress struct {
Address *string `json:"address"`
}
func (ETHAddress) IsSignerKind() {}
// Summary of a node's rewards for a given epoch
type EpochParticipation struct {
Epoch *fury.Epoch `json:"epoch"`
// RFC3339 timestamp
Offline *int64 `json:"offline"`
// RFC3339 timestamp
Online *int64 `json:"online"`
// Total amount rewarded for participation in the given epoch
TotalRewards *float64 `json:"totalRewards"`
}
// Response for the signature bundle to allowlist an ERC20 token in the collateral bridge
type Erc20ListAssetBundle struct {
// The source asset in the ethereum network
AssetSource string `json:"assetSource"`
// The ID of the fury asset
FuryAssetID string `json:"furyAssetId"`
// The nonce to be used in the request
Nonce string `json:"nonce"`
// Signature aggregate from the nodes, in the following format:
// 0x + sig1 + sig2 + ... + sigN
Signatures string `json:"signatures"`
}
// All the data related to the approval of a withdrawal from the network
type Erc20WithdrawalApproval struct {
// The source asset in the ethereum network
AssetSource string `json:"assetSource"`
// The amount to be withdrawn
Amount string `json:"amount"`
// The nonce to be used in the request
Nonce string `json:"nonce"`
// Signature aggregate from the nodes, in the following format:
// 0x + sig1 + sig2 + ... + sigN
Signatures string `json:"signatures"`
// The target address that will receive the funds
TargetAddress string `json:"targetAddress"`
// Timestamp at which the withdrawal was created
Creation string `json:"creation"`
}
// Specific details for an erc20 withdrawal
type Erc20WithdrawalDetails struct {
// The ethereum address of the receiver of the asset funds
ReceiverAddress string `json:"receiverAddress"`
}
func (Erc20WithdrawalDetails) IsWithdrawalDetails() {}
// An Ethereum data source
type EthereumEvent struct {
// The ID of the ethereum contract to use (string)
ContractID string `json:"contractId"`
// Name of the Ethereum event to listen to. (string)
Event string `json:"event"`
}
func (EthereumEvent) IsOracle() {}
type ExternalData struct {
Data *Data `json:"data"`
}
// externalDataSourceSpec is the type that wraps the DataSourceSpec type in order to be further used/extended
// by the OracleSpec
type ExternalDataSourceSpec struct {
Spec *DataSourceSpec `json:"spec"`
}
// An estimate of the fee to be paid for the order
type FeeEstimate struct {
// The estimated fees if the order was to trade
Fees *TradeFee `json:"fees"`
// The total estimated amount of fees if the order was to trade
TotalFeeAmount string `json:"totalFeeAmount"`
}
// Configuration of a market liquidity monitoring parameters
type LiquidityMonitoringParameters struct {
// Specifies parameters related to target stake calculation
TargetStakeParameters *TargetStakeParameters `json:"targetStakeParameters"`
// Specifies the triggering ratio for entering liquidity auction
TriggeringRatio string `json:"triggeringRatio"`
// Specifies by how many seconds an auction should be extended if leaving the auction were to trigger a liquidity auction
AuctionExtensionSecs int `json:"auctionExtensionSecs"`
}
// The equity like share of liquidity fee for each liquidity provider
type LiquidityProviderFeeShare struct {
// The liquidity provider party ID
Party *fury.Party `json:"party"`
// The share owned by this liquidity provider (float)
EquityLikeShare string `json:"equityLikeShare"`
// The average entry valuation of the liquidity provider for the market
AverageEntryValuation string `json:"averageEntryValuation"`
// The average liquidity score
AverageScore string `json:"averageScore"`
}
type LossSocialization struct {
// The market ID where loss socialization happened
MarketID string `json:"marketId"`
// The party that was part of the loss socialization
PartyID string `json:"partyId"`
// The amount lost
Amount string `json:"amount"`
}
// The liquidity commitments for this market
type MarketDataCommitments struct {
// A set of liquidity sell orders to meet the liquidity provision obligation.
Sells []*fury.LiquidityOrderReference `json:"sells"`
// A set of liquidity buy orders to meet the liquidity provision obligation.
Buys []*fury.LiquidityOrderReference `json:"buys"`
}
type MarketDepthTrade struct {
// ID of the trade for the given market (if available)
ID string `json:"id"`
// Price of the trade
Price string `json:"price"`
// Size of the trade
Size string `json:"size"`
}
type MarketEvent struct {
// The market ID
MarketID string `json:"marketId"`
// The message - market events are used for logging
Payload string `json:"payload"`
}
type MarketTick struct {
// The market ID
MarketID string `json:"marketId"`
// The block time
Time string `json:"time"`
}
// Details on the collection of nodes for particular validator status
type NodeSet struct {
// Total number of nodes in the node set
Total int `json:"total"`
// Number of nodes in the node set that had a performance score of 0 at the end of the last epoch
Inactive int `json:"inactive"`
// IDs of the nodes that were promoted into this node set at the start of the epoch
Promoted []string `json:"promoted"`
// IDs of the nodes that were demoted into this node set at the start of the epoch
Demoted []string `json:"demoted"`
// Total number of nodes allowed in the node set
Maximum *int `json:"maximum"`
}
// The equity like share of liquidity fee for each liquidity provider
type ObservableLiquidityProviderFeeShare struct {
// The liquidity provider party ID
PartyID string `json:"partyId"`
// The share owned by this liquidity provider (float)
EquityLikeShare string `json:"equityLikeShare"`
// The average entry valuation of the liquidity provider for the market
AverageEntryValuation string `json:"averageEntryValuation"`
// The average liquidity score
AverageScore string `json:"averageScore"`
}
type OrderByMarketAndPartyIdsFilter struct {
Order *v2.OrderFilter `json:"order"`
MarketIds []string `json:"marketIds"`
PartyIds []string `json:"partyIds"`
}
type OrderByMarketIdsFilter struct {
Order *v2.OrderFilter `json:"order"`
MarketIds []string `json:"marketIds"`
}
type OrderByPartyIdsFilter struct {
Order *v2.OrderFilter `json:"order"`
PartyIds []string `json:"partyIds"`
}
// An estimate of the fee to be paid by the order
type OrderEstimate struct {
// The estimated fee if the order was to trade
Fee *TradeFee `json:"fee"`
// The total estimated amount of fee if the order was to trade
TotalFeeAmount string `json:"totalFeeAmount"`
// The margin requirement for this order
MarginLevels *fury.MarginLevels `json:"marginLevels"`
}
// Basic description of an order
type OrderInfo struct {
// Whether the order is to buy or sell
Side fury.Side `json:"side"`
// Price for the order
Price string `json:"price"`
// Number of units remaining of the total that have not yet been bought or sold (uint64)
Remaining string `json:"remaining"`
// Boolean indicating a market order
IsMarketOrder bool `json:"isMarketOrder"`
}
// Response for the estimate of the margin level and, if available, collateral was provided in the request, liqudation price for the specified position
type PositionEstimate struct {
// Margin level range estimate for the specified position
Margin *v2.MarginEstimate `json:"margin"`
// Liquidation price range estimate for the specified position. Only populated if available collateral was specified in the request
Liquidation *v2.LiquidationEstimate `json:"liquidation"`
}
type PositionResolution struct {
// The market ID where position resolution happened
MarketID string `json:"marketId"`
// Number of distressed parties on market
Distressed int `json:"distressed"`
// Number of parties closed out
Closed int `json:"closed"`
// The mark price at which parties were distressed/closed out
MarkPrice string `json:"markPrice"`
}
// Range of valid prices and the associated price monitoring trigger
type PriceMonitoringBounds struct {
// Minimum price that isn't currently breaching the specified price monitoring trigger
MinValidPrice string `json:"minValidPrice"`
// Maximum price that isn't currently breaching the specified price monitoring trigger
MaxValidPrice string `json:"maxValidPrice"`
// Price monitoring trigger associated with the bounds
Trigger *PriceMonitoringTrigger `json:"trigger"`
// Reference price used to calculate the valid price range
ReferencePrice string `json:"referencePrice"`
}
// PriceMonitoringParameters holds a list of triggers
type PriceMonitoringParameters struct {
// The list of triggers for this price monitoring
Triggers []*PriceMonitoringTrigger `json:"triggers"`
}
// Configuration of a market price monitoring auctions triggers
type PriceMonitoringSettings struct {
// Specified a set of PriceMonitoringParameters to be use for price monitoring purposes
Parameters *PriceMonitoringParameters `json:"parameters"`
}
// PriceMonitoringTrigger holds together price projection horizon τ, probability level p, and auction extension duration
type PriceMonitoringTrigger struct {
// Price monitoring projection horizon τ in seconds (> 0).
HorizonSecs int `json:"horizonSecs"`
// Price monitoring probability level p. (>0 and < 1)
Probability float64 `json:"probability"`
// Price monitoring auction extension duration in seconds should the price
// breach its theoretical level over the specified horizon at the specified
// probability level (> 0)
AuctionExtensionSecs int `json:"auctionExtensionSecs"`
}
type ProposalVote struct {
// Cast vote
Vote *fury.Vote `json:"vote"`
// Proposal ID the vote is cast on
ProposalID string `json:"proposalId"`
}
// Connection type for retrieving cursor-based paginated proposal vote information
type ProposalVoteConnection struct {
// The proposal votes in this connection
Edges []*ProposalVoteEdge `json:"edges"`
// The pagination information
PageInfo *v2.PageInfo `json:"pageInfo"`
}
// Edge type containing the proposal vote and cursor information returned by a ProposalVoteConnection
type ProposalVoteEdge struct {
// The proposal vote
Node *ProposalVote `json:"node"`
// The cursor for this proposal vote
Cursor *string `json:"cursor"`
}
type ProposalVoteSide struct {
// All votes cast for this side
Votes []*fury.Vote `json:"votes"`
// Total number of votes cast for this side
TotalNumber string `json:"totalNumber"`
// Total weight of governance token from the votes cast for this side
TotalWeight string `json:"totalWeight"`
// Total number of governance tokens from the votes cast for this side
TotalTokens string `json:"totalTokens"`
// Total equity like share weight for this side (only for UpdateMarket Proposals)
TotalEquityLikeShareWeight string `json:"totalEquityLikeShareWeight"`
}
type ProposalVotes struct {
// Yes votes cast for this proposal
Yes *ProposalVoteSide `json:"yes"`
// No votes cast for this proposal
No *ProposalVoteSide `json:"no"`
}
// Indicator showing whether the data-node is ready for the protocol upgrade to begin.
type ProtocolUpgradeStatus struct {
Ready bool `json:"ready"`
}
type PubKey struct {
Key *string `json:"key"`
}
func (PubKey) IsSignerKind() {}
// Connection type for retrieving cursor-based paginated reward summary information
type RewardSummaryConnection struct {
// List of reward summaries available for the connection
Edges []*RewardSummaryEdge `json:"edges"`
// Page information for the connection
PageInfo *v2.PageInfo `json:"pageInfo"`
}
// Edge type containing the reward summary and cursor information returned by a RewardSummaryConnection
type RewardSummaryEdge struct {
// The reward summary
Node *fury.RewardSummary `json:"node"`
// Cursor identifying the reward summary
Cursor string `json:"cursor"`
}
type SettleDistressed struct {
// The market in which a position was closed out
MarketID string `json:"marketId"`
// The party that was closed out
PartyID string `json:"partyId"`
// The margin taken from distressed party
Margin string `json:"margin"`
// The price at which the position was closed out
Price string `json:"price"`
}
type SettlePosition struct {
// The market in which a position was settled
MarketID string `json:"marketId"`
// The party who settled a position
PartyID string `json:"partyId"`
// The settle price
Price string `json:"price"`
// The trades that were settled to close the overall position
TradeSettlements []*TradeSettlement `json:"tradeSettlements"`
}
// Signer is the authorized signature used for the data.
type Signer struct {
Signer SignerKind `json:"signer"`
}
// All staking information related to a Party.
// Contains the current recognised balance by the network and
// all the StakeLink/Unlink seen by the network
type StakingSummary struct {
// The stake currently available for the party
CurrentStakeAvailable string `json:"currentStakeAvailable"`
// The list of all stake link/unlink for the party
Linkings *v2.StakesConnection `json:"linkings"`
}
// TargetStakeParameters contains parameters used in target stake calculation
type TargetStakeParameters struct {
// Specifies length of time window expressed in seconds for target stake calculation
TimeWindow int `json:"timeWindow"`
// Specifies scaling factors used in target stake calculation
ScalingFactor float64 `json:"scalingFactor"`
}
type TimeUpdate struct {
// RFC3339Nano time of new block time
Timestamp int64 `json:"timestamp"`
}
func (TimeUpdate) IsEvent() {}
// The fee paid by the party when a trade occurs
type TradeFee struct {
// The maker fee, paid by the aggressive party to the other party (the one who had an order in the book)
MakerFee string `json:"makerFee"`
// The infrastructure fee, a fee paid to the validators to maintain the Fury network
InfrastructureFee string `json:"infrastructureFee"`
// The fee paid to the liquidity providers that committed liquidity to the market
LiquidityFee string `json:"liquidityFee"`
}
type TradeSettlement struct {
// The size of the trade
Size int `json:"size"`
// The price of the trade
Price string `json:"price"`
}
// Filter to apply to the trade connection query
type TradesFilter struct {
PartyIds []string `json:"partyIds"`
MarketIds []string `json:"marketIds"`
OrderIds []string `json:"orderIds"`
}
// Filter to apply to the trade subscription request
type TradesSubscriptionFilter struct {
PartyIds []string `json:"partyIds"`
MarketIds []string `json:"marketIds"`
}
type TransactionSubmitted struct {
Success bool `json:"success"`
}
type TransferBalance struct {
// Account involved in transfer
Account *fury.AccountDetails `json:"account"`
// The new balance of the account
Balance string `json:"balance"`
}
type TransferResponse struct {
// The ledger entries and balances resulting from a transfer request
Transfers []*fury.LedgerEntry `json:"transfers"`
// The balances of accounts involved in the transfer
Balances []*TransferBalance `json:"balances"`
}
type TransferResponses struct {
// A group of transfer responses - events from core
Responses []*TransferResponse `json:"responses"`
}
// An asset originated from an Ethereum ERC20 Token
type UpdateErc20 struct {
// The lifetime limits deposit per address
// Note: this is a temporary measure that can be changed by governance
LifetimeLimit string `json:"lifetimeLimit"`
// The maximum you can withdraw instantly. All withdrawals over the threshold will be delayed by the withdrawal delay.
// There is no limit on the size of a withdrawal
// Note: this is a temporary measure that can be changed by governance
WithdrawThreshold string `json:"withdrawThreshold"`
}
func (UpdateErc20) IsUpdateAssetSource() {}
type UpdateInstrumentConfiguration struct {
Code string `json:"code"`
Product *fury.UpdateFutureProduct `json:"product"`
}
// Event types
type BusEventType string
const (
// Fury Time has changed
BusEventTypeTimeUpdate BusEventType = "TimeUpdate"
// Collateral has deposited in to this Fury network via the bridge
BusEventTypeDeposit BusEventType = "Deposit"
// Collateral has been withdrawn from this Fury network via the bridge
BusEventTypeWithdrawal BusEventType = "Withdrawal"
// The results from processing at transaction
BusEventTypeTransactionResult BusEventType = "TransactionResult"
)
var AllBusEventType = []BusEventType{
BusEventTypeTimeUpdate,
BusEventTypeDeposit,
BusEventTypeWithdrawal,
BusEventTypeTransactionResult,
}
func (e BusEventType) IsValid() bool {
switch e {
case BusEventTypeTimeUpdate, BusEventTypeDeposit, BusEventTypeWithdrawal, BusEventTypeTransactionResult:
return true
}
return false
}
func (e BusEventType) String() string {
return string(e)
}
func (e *BusEventType) UnmarshalGQL(v interface{}) error {
str, ok := v.(string)
if !ok {
return fmt.Errorf("enums must be strings")
}
*e = BusEventType(str)
if !e.IsValid() {
return fmt.Errorf("%s is not a valid BusEventType", str)
}
return nil
}
func (e BusEventType) MarshalGQL(w io.Writer) {
fmt.Fprint(w, strconv.Quote(e.String()))
}
// Describes the status of the data spec
type DataSourceSpecStatus string
const (
// Describes an active data spec
DataSourceSpecStatusStatusActive DataSourceSpecStatus = "STATUS_ACTIVE"
// Describes a data spec that is not listening to data
// anymore
DataSourceSpecStatusStatusDeactivated DataSourceSpecStatus = "STATUS_DEACTIVATED"
)
var AllDataSourceSpecStatus = []DataSourceSpecStatus{
DataSourceSpecStatusStatusActive,
DataSourceSpecStatusStatusDeactivated,
}
func (e DataSourceSpecStatus) IsValid() bool {
switch e {
case DataSourceSpecStatusStatusActive, DataSourceSpecStatusStatusDeactivated:
return true
}
return false
}
func (e DataSourceSpecStatus) String() string {
return string(e)
}
func (e *DataSourceSpecStatus) UnmarshalGQL(v interface{}) error {
str, ok := v.(string)
if !ok {
return fmt.Errorf("enums must be strings")
}
*e = DataSourceSpecStatus(str)
if !e.IsValid() {
return fmt.Errorf("%s is not a valid DataSourceSpecStatus", str)
}
return nil
}
func (e DataSourceSpecStatus) MarshalGQL(w io.Writer) {
fmt.Fprint(w, strconv.Quote(e.String()))
}
// Filter type for specifying the types of transfers to filter for
type TransferDirection string
const (
TransferDirectionTo TransferDirection = "To"
TransferDirectionFrom TransferDirection = "From"
TransferDirectionToOrFrom TransferDirection = "ToOrFrom"
)
var AllTransferDirection = []TransferDirection{
TransferDirectionTo,
TransferDirectionFrom,
TransferDirectionToOrFrom,
}
func (e TransferDirection) IsValid() bool {
switch e {
case TransferDirectionTo, TransferDirectionFrom, TransferDirectionToOrFrom:
return true
}
return false
}
func (e TransferDirection) String() string {
return string(e)
}
func (e *TransferDirection) UnmarshalGQL(v interface{}) error {
str, ok := v.(string)
if !ok {
return fmt.Errorf("enums must be strings")
}
*e = TransferDirection(str)
if !e.IsValid() {
return fmt.Errorf("%s is not a valid TransferDirection", str)
}
return nil
}
func (e TransferDirection) MarshalGQL(w io.Writer) {
fmt.Fprint(w, strconv.Quote(e.String()))
}