Brink Smart Contract Release

At Brink, we’re building critical infrastructure for automated transactions. Brink is a fully permissionless, non-custodial, and decentralized network that provides automated execution of transactions to the DeFi community.

What’s new

We’re excited to announce the release of our smart contract code! This is a huge milestone for the team and represents many weeks of effort. It’s still only a fraction of the code we’ll be releasing over the coming months, so stay tuned for more.

We’ve released 4 solidity repositories:

  • brink-core contains core contracts for Brink proxy accounts.
  • brink-verifiers are contracts that are used by proxy accounts to verify execution parameters and conditions for various types of transactions.
  • brink-adapters allow executors to interface with on-chain liquidity sources.
  • range-orders is our first Uniswap V3 integration: a new position manager for range orders

How Brink works

Brink allows users to sign transactions that will automatically execute when certain conditions are met. All transactions in Brink are gas-deferred, they are free to create and you don’t pay a gas cost until the transaction is fully executed. If a transaction expires or otherwise becomes unexecutable, it is completely free to the user. If an executor attempts to execute your transaction and fails, you don’t pay for the cost of the reverted transaction. If your transaction is executed successfully, the gas cost is taken out of the tokens involved in the transaction, so there is never a need for you to explicitly pay in ETH.

Examples of gas-deferred transactions are limit orders, stop-loss orders, automated LP rebalancing, dollar-cost-averaging, and more.

Proxy Account Core

Brink uses an extremely lightweight proxy contract that is deployed for each user. The cost of deployment for your proxy is bundled into the cost of your first successfully executed transaction. Brink accomplishes this using a concept in Ethereum called counterfactual contracts that allow proxy owners to interact with their proxy contract address before the contract code is deployed.

The assets that will be used for your Brink transactions can be deposited via transfer to your proxy contract address before or after the proxy is deployed. This is done just like any transfer to an Ethereum address.

Brink core provides a fully non-custodial solution for automated transactions on DeFi. Brink proxy owners always have full control over the assets held in their proxy account. Brink is providing a fundamental DeFi lego for transaction automation that fits perfectly into the ecosystem, built on top of existing AMM’s and other on-chain liquidity sources.

Transaction Verification

After a user signs a Brink transaction, it can only be executed when the signed conditions are met. These conditions are checked by verifier contracts, which are deployed separately from Brink proxy accounts. Verifier smart contracts prevent malicious actions on the network by reverting execution if conditions are not met.

Each verifier contract corresponds to a different order type. We currently have verifiers for limit orders and Uniswap V3 range orders. Additional verifiers will be released for stop-loss orders, Uniswap V3 specific LP take-profit and stop-loss, LP rebalancing, and token cost averaging. Verifiers are peripheral contracts that can be deployed outside of brink-core, so verifiers for new transaction types can be created and deployed by the community over time.

Brink Executor Network

The role of a Brink executor is to watch for optimal on-chain execution conditions for signed Brink transactions and execute these successfully for the highest reward possible. The reward mechanism for execution differs depending on the transaction type and is defined by that transaction type’s verifier contract code. Brink’s limit orders, for example, have an arbitrage-based reward incentive. Executors are allowed to take a signed amount of Token A from your proxy account if they return a signed amount of Token B to the proxy account, so the spread between the on-chain market price and your signed amounts becomes an arbitrage reward for the executor. Once the spread grows large enough for an executor to consider it profitable, they will attempt to be the first to execute the limit order.

Other transaction reward types could be built by the community, such as fixed-fee or time auction-based rewards. Different reward mechanisms have various trade-offs, but ideally incentivize competition, cost minimization, and speed of execution.

Controlled Executor Access for V1

Brink’s contracts have been designed to allow permissionless execution of transactions in a way that doesn’t allow malicious actions. However, because of the potential risk of unintended code vulnerabilities, the first deployment of Brink core will require that executors be explicitly granted permissions via an access control list. Once the contracts have undergone multiple audits, and a bounty program has been in place for a period of time, a V2 with permissionless execution will be deployed. Brink account holders will be able to opt-in to the V2 upgrade via a call to their proxy account. Since our team has no control over Brink accounts, we will not be able to force an upgrade.

Creation and use of Brink accounts will be permissionless in V1 immediately at mainnet launch.

MEV and Sandwich Attacks

While Brink doesn’t directly provide a solution for MEV, sandwich attacks, or other problems associated with smart contract-based AMM’s, it does mitigate these problems for Brink account owners by creating incentives for executors to find the most optimal execution strategies on behalf of the account owners. In an execution network, the executors are dealing with many transactions at scale. The ones that are able to source liquidity in the most efficient way will optimize for MEV and other potential loss of value, in order to maximize their own profits. Account holders benefit from optimized execution via lower costs of transaction execution.

Think about Brink’s execution network as an army of bots incentivized to automate transactions for you at the lowest possible cost. With the network’s economies of scale, this bot army is more well equipped to minimize MEV than any individual account owner would be. Brink’s network is harvesting the power of the dark forest to work for your benefit.

What’s next

Audits: We’re currently preparing for a formal smart contract audit which will be underway as soon as possible.

Bug Bounty: We will be introducing a bug bounty program to incentivize the community to review the smart contract code and report issues.

Documentation: In addition to our natspec generated docs found in each repository, we will be releasing detailed documentation for Brink. This will include a guide for community members who have expressed interest in building executors for Brink. If you’re interested in becoming an executor, please join our Discord and reach out in the #executors channel.

SDK and API release: Our SDK and API code is being prepared for open source release. This code helps developers interact with Brink accounts programmatically.

UI release: We will also be releasing our web UI code. This is a react UI that helps non-technical users interact with their Brink accounts. The UI will be accessible from https://brink.trade

Mainnet Launch: After the code has undergone a successful audit, we will deploy Brink V1 to mainnet.

Learn more about Brink:

Disclaimer

We’ve done our best to deploy secure code, but Brink has not been audited by a 3rd party. Like any Dapp, use caution, and be aware that there is always a risk of fund loss.

Brink is bringing automated transactions and conditional orders to DeFi.