> ## Documentation Index
> Fetch the complete documentation index at: https://docs.eco.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Thales (thales)

> Positional markets protocol built on Synthetix offering binary options, speed markets, and sports markets on Optimism.

> [!NOTE]
>
> Archived documentation for `@eco-incorp/sauce@0.99.16`. Install this release with `npm install --save-exact @eco-incorp/sauce@0.99.16`. Links to guides outside this tab open current documentation.

Positional markets protocol built on Synthetix offering binary options, speed markets, and sports markets on Optimism.

| Fact | Value |
| - | - |
| Category | Options |
| Family | none |
| Namespace | `Thales` on optimism |
| Chains | optimism |

## What it offers

* **exerciseMarket**: Exercise a matured market position to claim payout
* **buyFromAMM**: Buy positional tokens (UP/DOWN) from the Thales AMM
* **createSpeedMarket**: Create a speed market position

## Notes

* Position 0 = UP (price goes up), Position 1 = DOWN (price goes down)
* Markets expire at set times - exercise only after maturation
* Speed markets have short durations (minutes to hours)
* Binary outcome: winning position gets payout, losing gets nothing
* Approve sUSD/USDC to thalesAMM before buying

## Its names in a program

On Optimism, `Thales` is a namespace: its contracts need no import.

```ts theme={null}
function main() {
  // Optimism's speedMarketsAMM, `0xE16B8a01490835EC1e76bAbbB3Cadd8921b32001`.
  require(Thales.SpeedMarketsAMM != 0);
}
```

## Deployments

| Chain | Contract | Address | In a program |
| - | - | - | - |
| [Optimism](https://docs.eco.com/sauce-versions/0.99.16/sauce-sdk/reference/chains/optimism.md) | speedMarketsAMM | `0xE16B8a01490835EC1e76bAbbB3Cadd8921b32001` | `Thales.SpeedMarketsAMM` |
| [Optimism](https://docs.eco.com/sauce-versions/0.99.16/sauce-sdk/reference/chains/optimism.md) | thalesAMM | `0x278B5A44397c9D8E52743fEdec263c4760dc1A1A` | `Thales.ThalesAMM` |

## ABI

### `PositionalMarketABI`

`import PositionalMarketABI from "./protocols/thales/PositionalMarketABI.json";`

* `exerciseOptions() returns (uint256)`

### `SpeedMarketsAMMABI`

`import SpeedMarketsAMMABI from "./protocols/thales/SpeedMarketsAMMABI.json";` Speaks for: speedMarketsAMM.

* `createNewMarket((address user, bytes32 asset, uint64 strikeTime, uint64 delta, int64 strikePrice, uint64 strikePricePublishTime, uint8 oracleSource, uint8 direction, address collateral, uint256 collateralAmount, address referrer, uint256 skewImpact) params) returns (address marketAddress)`

### `ThalesAMMABI`

`import ThalesAMMABI from "./protocols/thales/ThalesAMMABI.json";` Speaks for: thalesAMM.

* `buyFromAMM(address market, uint8 position, uint256 amount, uint256 expectedPayout, uint256 additionalSlippage) returns (uint256)`

## Next steps

* [Protocols](https://docs.eco.com/sauce-versions/0.99.16/sauce-sdk/reference/protocols.md): the other protocols, by what they do.
* [Protocols and tokens](https://docs.eco.com/sauce-versions/0.99.16/sauce/names.md): calling a contract by its namespace, or through its ABI.
* [Glossary](https://docs.eco.com/sauce-versions/0.99.16/sauce/glossary.md): the words these pages use, in plain terms.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.