unrip/.env.example
philipp 41b9ec680b
Some checks failed
deploy / deploy (push) Failing after 1m35s
Implement funded NEAR Intents trade loop
Proof: first non-mocked tradeable loop for one pair using funded NEAR Intents inventory, Kafka, and PostgreSQL.

Assumptions: solver-side execution is performed by signed token_diff quote responses over the Solver Relay; EURe is treated as 1:1 with EUR; k3s runtime uses unrip-dev.near as the named signer account.

Still fake: signer key is not yet registered on intents.near, strategy and executor remain disarmed by default, and no live mainnet quote response has been submitted from this repo yet.
2026-04-02 10:01:15 +02:00

79 lines
2.9 KiB
Text

# Core NEAR Intents runtime
NEAR_INTENTS_API_KEY=replace_me
NEAR_INTENTS_ACCOUNT_ID=solver.near
NEAR_INTENTS_SIGNER_PRIVATE_KEY=ed25519:replace_me
NEAR_INTENTS_WS_URL=wss://solver-relay-v2.chaindefuser.com/ws
NEAR_INTENTS_RPC_URL=https://solver-relay-v2.chaindefuser.com/rpc
NEAR_INTENTS_BRIDGE_RPC_URL=https://bridge.chaindefuser.com/rpc
NEAR_INTENTS_VERIFIER_CONTRACT=intents.near
NEAR_RPC_URL=https://rpc.fastnear.com
NEAR_INTENTS_PAIR_FILTER=nep141:btc.omft.near->nep141:gnosis-0x420ca0f9b9b604ce0fd9c18ef134c705e5fa3430.omft.near
# Active pair metadata
TRADING_BTC_ASSET_ID=nep141:btc.omft.near
TRADING_BTC_SYMBOL=BTC
TRADING_BTC_DECIMALS=8
TRADING_BTC_CHAIN=btc:mainnet
TRADING_EURE_ASSET_ID=nep141:gnosis-0x420ca0f9b9b604ce0fd9c18ef134c705e5fa3430.omft.near
TRADING_EURE_SYMBOL=EURe
TRADING_EURE_DECIMALS=18
TRADING_EURE_CHAIN=eth:100
# Control APIs
NEAR_INTENTS_CONTROL_API_ENABLED=true
NEAR_INTENTS_CONTROL_HOST=0.0.0.0
NEAR_INTENTS_CONTROL_PORT=8081
MARKET_REFERENCE_CONTROL_HOST=0.0.0.0
MARKET_REFERENCE_CONTROL_PORT=8082
INVENTORY_SYNC_CONTROL_HOST=0.0.0.0
INVENTORY_SYNC_CONTROL_PORT=8083
LIQUIDITY_MANAGER_CONTROL_HOST=0.0.0.0
LIQUIDITY_MANAGER_CONTROL_PORT=8084
HISTORY_WRITER_CONTROL_HOST=0.0.0.0
HISTORY_WRITER_CONTROL_PORT=8085
STRATEGY_ENGINE_CONTROL_HOST=0.0.0.0
STRATEGY_ENGINE_CONTROL_PORT=8086
TRADE_EXECUTOR_CONTROL_HOST=0.0.0.0
TRADE_EXECUTOR_CONTROL_PORT=8087
# Kafka backbone
KAFKA_BROKERS=redpanda:9092
KAFKA_CLIENT_ID=unrip
KAFKA_TOPIC_RAW_NEAR_INTENTS_QUOTE=raw.near_intents.quote
KAFKA_TOPIC_NORM_SWAP_DEMAND=norm.swap_demand
KAFKA_TOPIC_REF_MARKET_PRICE=ref.market_price
KAFKA_TOPIC_STATE_INTENT_INVENTORY=state.intent_inventory
KAFKA_TOPIC_OPS_LIQUIDITY_ACTION=ops.liquidity_action
KAFKA_TOPIC_DECISION_TRADE_DECISION=decision.trade_decision
KAFKA_TOPIC_CMD_EXECUTE_TRADE=cmd.execute_trade
KAFKA_TOPIC_EXEC_TRADE_RESULT=exec.trade_result
KAFKA_CONSUMER_GROUP_HISTORY=history-writer-v1
KAFKA_CONSUMER_GROUP_INVENTORY=inventory-sync-v1
KAFKA_CONSUMER_GROUP_STRATEGY=strategy-engine-v1
KAFKA_CONSUMER_GROUP_EXECUTOR=trade-executor-v1
# PostgreSQL durable history store
POSTGRES_URL=postgresql://unrip:unrip@postgres:5432/unrip
# Service state
EXECUTOR_STATE_DIR=/var/lib/unrip/executor-state
LIQUIDITY_STATE_DIR=/var/lib/unrip/liquidity-state
# Pricing and sync cadence
MARKET_REFERENCE_REFRESH_MS=5000
MARKET_REFERENCE_COINGECKO_REFRESH_MS=15000
MARKET_REFERENCE_MAX_AGE_MS=30000
MARKET_REFERENCE_KRAKEN_TICKER_URL=https://api.kraken.com/0/public/Ticker?pair=XBTEUR
MARKET_REFERENCE_COINGECKO_URL=https://api.coingecko.com/api/v3/simple/price?ids=bitcoin&vs_currencies=eur
INVENTORY_SYNC_REFRESH_MS=15000
LIQUIDITY_REFRESH_MS=30000
# Strategy and executor safety defaults
STRATEGY_GROSS_THRESHOLD_PCT=2
STRATEGY_INITIAL_ARMED=false
STRATEGY_MAX_NOTIONAL_EURE=5
STRATEGY_PRICE_MAX_AGE_MS=30000
STRATEGY_INVENTORY_MAX_AGE_MS=30000
EXECUTOR_INITIAL_ARMED=false
EXECUTOR_RESPONSE_TIMEOUT_MS=10000
LIQUIDITY_WITHDRAWALS_FROZEN=true