types

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2025 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package types contains various types, consts and vars for bidcollect

Index

Constants

View Source
const (
	SourceTypeGetHeader        = 0
	SourceTypeDataAPI          = 1
	SourceTypeUltrasoundStream = 2

	UltrasoundStreamDefaultURL = "ws://relay-builders-eu.ultrasound.money/ws/v1/top_bid"
	InitialBackoffSec          = 5
	MaxBackoffSec              = 120

	// bucketMinutes is the number of minutes to write into each CSV file (i.e. new file created for every X minutes bucket)
	BucketMinutes = 60

	// channel size for bid collector inputs
	BidCollectorInputChannelSize = 1000

	RedisChannel = "bidcollect/bids"
)

Variables

View Source
var CommonBidCSVFields = []string{
	"source_type",
	"received_at_ms",

	"timestamp_ms",
	"slot",
	"slot_t_ms",
	"value",

	"block_hash",
	"parent_hash",
	"builder_pubkey",
	"block_number",

	"block_fee_recipient",
	"relay",
	"proposer_pubkey",
	"proposer_fee_recipient",
	"optimistic_submission",
}

Functions

This section is empty.

Types

type CommonBid

type CommonBid struct {
	// Collector-internal fields
	SourceType   int   `json:"source_type"`
	ReceivedAtMs int64 `json:"received_at"`

	// Common fields
	Slot          uint64 `json:"slot"`
	BlockNumber   uint64 `json:"block_number"`
	BlockHash     string `json:"block_hash"`
	ParentHash    string `json:"parent_hash"`
	BuilderPubkey string `json:"builder_pubkey"`
	Value         string `json:"value"`

	// Ultrasound top-bid stream - https://github.com/ultrasoundmoney/docs/blob/main/top-bid-websocket.md
	BlockFeeRecipient string `json:"block_fee_recipient"`

	// Data API
	// - Ultrasound: https://relay-analytics.ultrasound.money/relay/v1/data/bidtraces/builder_blocks_received?slot=9194844
	// - Flashbots: https://boost-relay.flashbots.net/relay/v1/data/bidtraces/builder_blocks_received?slot=8969837
	Relay                string `json:"relay"`
	TimestampMs          int64  `json:"timestamp_ms"`
	ProposerPubkey       string `json:"proposer_pubkey"`
	ProposerFeeRecipient string `json:"proposer_fee_recipient"`
	OptimisticSubmission bool   `json:"optimistic_submission"`
}

func (*CommonBid) ToCSVFields

func (bid *CommonBid) ToCSVFields() []string

func (*CommonBid) ToCSVLine

func (bid *CommonBid) ToCSVLine(separator string) string

func (*CommonBid) UniqueKey

func (bid *CommonBid) UniqueKey() string

func (*CommonBid) ValueAsBigInt

func (bid *CommonBid) ValueAsBigInt() *big.Int

Jump to

Keyboard shortcuts

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