Architecture
Definitive’s technical architecture borrows the best concepts from traditional finance execution while integrating DeFi native elements such as on-chain activity monitoring and cross-protocol smart contract execution.
The architecture is composed of 2 main components
Definitive Contracts: Modular, non-custodial, on-chain smart contracts that can be comp
Definitive Core: Proprietary off-chain Execution Engine
TradingVault Smart Contract
The TradingVault
is the main contract used to support advanced execution at Definitive. It is a fully non-custodial contract composed of modules that perform specific tasks such as swapping and access control.
OpenZeppelin's AccessControl
is used for role management. The different roles on a TradingVault
are:
DEFAULT_ADMIN_ROLE
Owner of the contract. It is set to address provided by the client or Definitive’s Multisig (for retail clients).
Can add/remove other roles below.
One
ROLE_CLIENT
Address provided by the client.
Can deposit/withdraw funds from the TradingVault .
Can initiate a Trading Session on the Definitive UI
Can initiate swaps from the Definitive UI.
Many
ROLE_DEFINITIVE
Address owned by the Definitive team.
Can perform swaps with assets in the TradingVault.
Many
TradingVault Setup
Definitive deploys a bespoke
TradingVault
(smart contract) per user per chain. The address of theTradingVault
is the same across all EVM chains.The client's address is designated as
ROLE_CLIENT
and only this address is able to deposit and withdraw funds.Definitive's address is designated as
ROLE_DEFINITIVE
and can perform predefined actions like swaps. This address CAN NOT withdraw funds from theTradingVault
.The
DEFAULT_ADMIN_ROLE
is set to a backup address owned by the client. There can only be oneDEFAULT_ADMIN_ROLE
perTradingVault
.We recommend using a different address than what is set for
ROLE_CLIENT
. In case theROLE_CLIENT
address is compromised or lost, only theDEFAULT_ADMIN_ROLE
can set a newROLE_CLIENT
.
All roles can be verified on-chain.
Executing Trades
Let's assume a client wants to swap ETH for USDC.
Once a
TradingVault
is set up, the client connects with their desired wallet provider (Fireblocks, Metamask Institutional, any EOA, etc.).ROLE_CLIENT
deposits ETH into theTradingVault
.ROLE_CLIENT
initiates a trading session by signing a payload that verifies that the address connected to the UI is, in fact, the same address withROLE_CLIENT
on theTradingVault
smart contract.Once the trading session is active, the client can execute trades on the UI in a way similar to how they would execute in CeFi.
To execute the trade on-chain, the
ROLE_DEFINITIVE
address call theTradingVault
with aswapPayload
(data such as from asset, to asset, slippage, price impact), and this triggers an on-chain swap at a whitelisted venue.If the swap is successful, the client now has USDC in the
TradingVault
.The funds can only be withdrawn from the
TradingVault
byROLE_CLIENT
.
The same architecture is applied to Definitive’s Automated Yield product. Individual smart contracts are deployed per user per position, with the same roles and access control as listed in this document.
Last updated