Documentation
¶
Overview ¶
Package testperpv1 is the Go-side orchestrator for the testperpv1 bot mode -- a real-transaction smoke test, not a real trading strategy. Same allocation/upload/handshake/wallet-init flow every bot mode's orchestrator follows (see arbv1's own package for the analogous structure), only MODE=testperpv1 selected at upload time instead.
It implements the brain.Brain interface and is responsible for:
- Allocating a slot on a Catscope/Solpipe validator pipeline (bid = 0, free tier).
- Uploading a WASM bot image to the validator with MODE=testperpv1.
- Completing the handshake with the running bot instance.
- Sending a child keypair to the bot via stdin, so this mode's Rust side (catscope-rust-bot/src/brain/testperpv1) can sign the real Solend/Kamino deposit/withdraw transactions its evaluate() state machine builds.
The WASM bot (catscope-rust-bot/src/brain/testperpv1) runs the real bootstrap -> deposit -> withdraw sequence for Solend then Kamino -- see that module's doc comment for why it exists and what it proves.
Index ¶
- Constants
- Variables
- func DoEchoRequest(payload string) catmsg.FixedPair
- func DoLstApy(symbol string, stakingApy float64) catmsg.FixedPair
- func DoTargetAllocation(symbol string, allocationPct float64) catmsg.FixedPair
- func DoTriggerTestAstralane() catmsg.FixedPair
- func DoWallet(key sgo.PrivateKey) catmsg.FixedPair
- type Configuration
- type Hook
Constants ¶
const ( KeyFlagEchoRequest uint8 = 1 KeyFlagEchoResponse uint8 = 2 KeyFlagWallet uint8 = 3 KeyFlagTargetAllocation uint8 = 4 KeyFlagLstApy uint8 = 5 KeyFlagTriggerTestAstralane uint8 = 6 // KeyFlagCommonAccountUsage is shared across every brain/* package // (not just this one) -- see the doc comment above. KeyFlagCommonAccountUsage uint8 = 200 )
Variables ¶
ErrBotNotConnectedYet is returned by SendBundlerTipUpdate while the bot hasn't finished its handshake yet -- mirrors arbv1's own sentinel of the same name. Not an error condition RunTipBroadcaster treats specially; it just logs and retries on its next tick.
Functions ¶
func DoLstApy ¶
DoLstApy builds the wire message for a real annualized LST staking-yield update (fraction, e.g. 0.073 for 7.3%/yr) for one liquid-staking-token symbol. symbol must fit in 16 bytes (jitoSOL/bSOL/mSOL all do).
func DoTargetAllocation ¶
DoTargetAllocation builds the wire message for a target portfolio allocation update for symbol (fraction of total portfolio value, 0.0-1.0). symbol must fit in 16 bytes (matches every currently tracked symbol: SOL/BTC/ETH/XRP/BNB/SUI).
func DoTriggerTestAstralane ¶
DoTriggerTestAstralane builds the wire message requesting the bot send a real tip payment to one of Astralane's tip wallets plus a second, deliberately inert self-transfer, tagged for Astralane -- proves the generic transactionprocessor::batch host import end-to-end without risking a real trading operation on it.
func DoWallet ¶
func DoWallet(key sgo.PrivateKey) catmsg.FixedPair
Types ¶
type Hook ¶
type Hook interface {
brain.Brain
SendBundlerTipUpdate(update bundler.TipUpdate) error
SendTriggerTestAstralane() error
}
Hook is brain.Brain plus SendBundlerTipUpdate/SendTriggerTestAstralane -- returned instead of a bare brain.Brain so cmd/*.go can call them on the same instance it hands to mothership.Create (a Hook value is itself a valid brain.Brain, since this interface embeds it). Mirrors arbv1.Hook's own reasoning for its trigger-sender methods.
func Create ¶
func Create(ctx context.Context, cancel context.CancelCauseFunc, parentKey sgo.PrivateKey, config *Configuration, db *sql.DB) (Hook, error)
Create creates a testperpv1 gRPC event hook. db is the already-open prefetch.db connection (see store.DB.Raw()), used to persist target allocation updates sent via SendTargetAllocation.
Source Files
¶
- eval.go
- init.go
- instance.go
- message.go
- testperpv1.go