Backend

​Supabase​

Trade Condition Storage:

  • Process: When traders set up their trade conditions for automation, Splurge stores these details in a Supabase-managed database.

  • Security Measures: For added security, traders sign off on the trade details with a unique, randomly generated salt to prevent replay attacks. Splurge saves this signature in Supabase, enabling us to execute trades on the trader's behalf.

  • Token Approval: Traders must authorize their tokens for trading via the Splurge Contract.

Access Security:

  • RLS Policy: We implement a robust Row-Level Security (RLS) policy, ensuring traders can only access their own automation jobs.

  • JWT Validation: This security is enforced by verifying a unique JWT (JSON Web Token) for each wallet, generated by Dynamic.

  • Privacy Assurance: The only entities with access to your automation jobs are you, the trader, and Splurge.

Automation Infrastructure

  • Functionality: Splurge currently sources the best prices from various liquidity pools using GeckoTerminal. It then performs necessary calculations to determine if a trade's conditions are met.

  • Technology: These processes are containerized using Docker and operate continuously on Google Cloud for prompt trade execution.

  • Future Improvements: We aim to decentralize our Automation Infrastructure using ZK-Proofs. This will allow the evaluation of automation jobs to be distributed among various validators/nodes, enhancing security and reducing future costs.

Automation Execution

  • Triggering Trades: When trade conditions are met, our keeper bot is notified by the Automation Infrastructure.

  • Pre-Execution Check: Tenderly simulates the trade to confirm its security and the expected outcome.

  • Execution: The trade is executed through the Splurge Smart Contract's verifyExecuteTrade() function.

  • Settlement and Delivery: We utilize the 0x Protocol to settle trades at optimal rates across all liquidity pools. Post-settlement, the proceeds are directly sent to the trader.

Last updated