V1

GitHub Certik Audit

Overview

Odos V1 marks a significant milestone in the evolution of DEX aggregation. It stands as the first DEX Aggregator designed to support multiple inputs and outputs within a single, atomic transaction. This innovative approach enhances the efficiency of cryptocurrency exchanges, while streamlining the trading process for our users.

At its core, the Odos V1 contract has been meticulously designed to be minimalist yet powerful. Its primary role is to facilitate a swap, but it goes beyond this basic functionality. It incorporates an essential safeguard for users - a mechanism to ensure the minimum expected output is indeed returned to the user after a transaction. This feature underscores our commitment to protecting user interests and delivering a fair and transparent trading experience.

Features

  • Enforce the expected minimum output. Revert if at the end of the swap transactions, the output is less than the minimum specified
  • Allow for multiple input tokens to support multi-input swaps
  • Allow for multiple output tokens to support multi-output swaps
  • Revenue mechanism built around positive slippage
  • Non-upgradeable static contract
  • Single function that a user interacts with

Revenue Streams

FunctionFee
SwapPositive Slippage

Audit

Router V1 was audited by Certik in March 2022. A copy of the report can be found in the Certik Console.

Deployments

Each of these addresses can be retrieved from the Odos API using the /info/router/v1/{chain_id} endpoint. More information about our API can be found here.

ChainRouter Address
Ethereum LogoEthereum0x76f4eeD9fE41262669D0250b2A97db79712aD855
Arbitrum LogoArbitrum0xdd94018F54e565dbfc939F7C44a16e163FaAb331
Optimism LogoOptimism0x69Dd38645f7457be13571a847FfD905f9acbaF6d
Polygon LogoPolygon0xa32EE1C40594249eb3183c10792BcF573D4Da47C
Avalanche LogoAvalanche0xfE7Ce93ac0F78826CD81D506B07Fe9f459c00214
BNB LogoBNB0x9f138be5aA5cC442Ea7cC7D18cD9E30593ED90b9
Fantom LogoFantom0x061dc8e41C05207BedD6242eA4b342ef294BE359
zkSync LogozkSync Era0xA269031037B4D5fa3F771c401D19E57def6Cb491

ABI

This is retrievable from our API using the /info/contract-info/v1 endpoint. More information about our API can be found here.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
{
  "abi": [
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": true,
          "internalType": "address",
          "name": "previousOwner",
          "type": "address"
        },
        {
          "indexed": true,
          "internalType": "address",
          "name": "newOwner",
          "type": "address"
        }
      ],
      "name": "OwnershipTransferred",
      "type": "event"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": false,
          "internalType": "address",
          "name": "sender",
          "type": "address"
        },
        {
          "indexed": false,
          "internalType": "uint256[]",
          "name": "amountsIn",
          "type": "uint256[]"
        },
        {
          "indexed": false,
          "internalType": "address[]",
          "name": "tokensIn",
          "type": "address[]"
        },
        {
          "indexed": false,
          "internalType": "uint256[]",
          "name": "amountsOut",
          "type": "uint256[]"
        },
        {
          "components": [
            {
              "internalType": "address",
              "name": "tokenAddress",
              "type": "address"
            },
            {
              "internalType": "uint256",
              "name": "relativeValue",
              "type": "uint256"
            },
            {
              "internalType": "address",
              "name": "receiver",
              "type": "address"
            }
          ],
          "indexed": false,
          "internalType": "struct OdosRouter.outputToken[]",
          "name": "outputs",
          "type": "tuple[]"
        },
        {
          "indexed": false,
          "internalType": "uint256",
          "name": "valueOutQuote",
          "type": "uint256"
        }
      ],
      "name": "Swapped",
      "type": "event"
    },
    {
      "inputs": [],
      "name": "owner",
      "outputs": [
        {
          "internalType": "address",
          "name": "",
          "type": "address"
        }
      ],
      "stateMutability": "view",
      "type": "function"
    },
    {
      "inputs": [],
      "name": "renounceOwnership",
      "outputs": [],
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "inputs": [
        {
          "components": [
            {
              "internalType": "address",
              "name": "tokenAddress",
              "type": "address"
            },
            {
              "internalType": "uint256",
              "name": "amountIn",
              "type": "uint256"
            },
            {
              "internalType": "address",
              "name": "receiver",
              "type": "address"
            },
            {
              "internalType": "bytes",
              "name": "permit",
              "type": "bytes"
            }
          ],
          "internalType": "struct OdosRouter.inputToken[]",
          "name": "inputs",
          "type": "tuple[]"
        },
        {
          "components": [
            {
              "internalType": "address",
              "name": "tokenAddress",
              "type": "address"
            },
            {
              "internalType": "uint256",
              "name": "relativeValue",
              "type": "uint256"
            },
            {
              "internalType": "address",
              "name": "receiver",
              "type": "address"
            }
          ],
          "internalType": "struct OdosRouter.outputToken[]",
          "name": "outputs",
          "type": "tuple[]"
        },
        {
          "internalType": "uint256",
          "name": "valueOutQuote",
          "type": "uint256"
        },
        {
          "internalType": "uint256",
          "name": "valueOutMin",
          "type": "uint256"
        },
        {
          "internalType": "address",
          "name": "executor",
          "type": "address"
        },
        {
          "internalType": "bytes",
          "name": "pathDefinition",
          "type": "bytes"
        }
      ],
      "name": "swap",
      "outputs": [
        {
          "internalType": "uint256[]",
          "name": "amountsOut",
          "type": "uint256[]"
        },
        {
          "internalType": "uint256",
          "name": "gasLeft",
          "type": "uint256"
        }
      ],
      "stateMutability": "payable",
      "type": "function"
    },
    {
      "inputs": [
        {
          "internalType": "address[]",
          "name": "tokens",
          "type": "address[]"
        },
        {
          "internalType": "uint256[]",
          "name": "amounts",
          "type": "uint256[]"
        },
        {
          "internalType": "address",
          "name": "dest",
          "type": "address"
        }
      ],
      "name": "transferFunds",
      "outputs": [],
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "inputs": [
        {
          "internalType": "address",
          "name": "newOwner",
          "type": "address"
        }
      ],
      "name": "transferOwnership",
      "outputs": [],
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "stateMutability": "payable",
      "type": "receive"
    }
  ]
}

Events

Swapped

This event is emitted when the swap function successfully performs a swap operation. The event provides crucial information about the swap operation which includes details about input tokens, output tokens, the sender of the operation, and other related details.

Parameters:

  • sender: This is an address type parameter that holds the address of the initiator of the swap operation.
  • amountsIn: This is a dynamic array of type uint256 that holds the amounts of input tokens that were swapped in the operation.
  • tokensIn: This is a dynamic array of type address that holds the addresses of the input tokens that were swapped in the operation.
  • amountsOut: This is a dynamic array of type uint256 that holds the amounts of output tokens that were received in the operation.
  • outputs: This is a dynamic array of type outputToken struct that contains details about the output tokens in the swap. Each outputToken struct includes the token address, relative value, and receiver.
  • valueOutQuote: This is a uint256 type parameter that represents the quoted value of the destination tokens for the executed path.