Raxol.Payments.Accounting (Raxol Payments v0.2.0)

Copy Markdown View Source

Reads the settlement-accounting deployment contract from the environment.

The accounting sidecar (a read-only container that books each Xochi settlement into Raxol.Payments.SettlementLedger) is configured entirely through env vars. Two deployments read the same contract: the main raxol release (root config/runtime.exs) and the slim raxol_acp sidecar release (packages/raxol_acp/config/runtime.exs). Both call env_config/0 so the contract lives in one place and the two config files cannot drift.

Contract

Env varMeaningDefault
RAXOL_ACCOUNTING_ENABLEDStart the ledger/accountant/monitor treefalse
RPC_ETH .. RPC_ROBINHOODPer-chain public RPC URL (read-only)(unset)
XOCHI_SOLVER_ADDRESSSolver wallet to read balances for(unset)
RAXOL_REBALANCE_INTERVAL_MSRebalanceMonitor sweep interval300000
RAXOL_PRICE_SOURCEUSD price source for margincoingecko

Read-only by construction: no wallet key is read here and none of the started processes move funds (the Riddler auto-rebalancer executes; the monitor only recommends). Omitting XOCHI_SOLVER_ADDRESS yields ledger-only mode -- the RebalanceMonitor is not started (see Raxol.ACP.Supervisor).

Summary

Functions

True when RAXOL_ACCOUNTING_ENABLED is exactly "true".

Reads the accounting contract into the two config values a deployment sets.

Functions

enabled?()

@spec enabled?() :: boolean()

True when RAXOL_ACCOUNTING_ENABLED is exactly "true".

env_config()

@spec env_config() :: {keyword(), boolean()}

Reads the accounting contract into the two config values a deployment sets.

Returns {accounting_opts, accounting_enabled?} where accounting_opts is the keyword list for config :raxol_payments, :accounting and accounting_enabled? is the boolean for config :raxol_acp, accounting_enabled:.