one_delta.deployment

Documentation for eth_defi.one_delta.deployment Python module.

1delta deployments.

Functions

fetch_deployment(web3, ...)

Construct 1delta deployment based on on-chain data.

Classes

OneDeltaDeployment

Describe 1delta deployment.

class OneDeltaDeployment

Bases: object

Describe 1delta deployment.

This contains all smart contracts needed to interact with 1delta procotol.

See fetch_deployment().

web3: web3.main.Web3

The Web3 instance for which all the contracts here are bound

flash_aggregator: web3.contract.contract.Contract

FlashAggregator contract proxy

quoter: web3.contract.contract.Contract

OneDeltaQuoter contract proxy

__init__(web3, flash_aggregator, broker_proxy, quoter)
Parameters
  • web3 (web3.main.Web3) –

  • flash_aggregator (web3.contract.contract.Contract) –

  • broker_proxy (web3.contract.contract.Contract) –

  • quoter (web3.contract.contract.Contract) –

Return type

None

fetch_deployment(web3, flash_aggregator_address, broker_proxy_address, quoter_address)

Construct 1delta deployment based on on-chain data.

  • We need associated Aave instance to be able to construct transactions to open and close positions

Polygon forked mainnet example:

@pytest.fixture
def aave_v3_deployment(web3):
    return fetch_aave_deployment(
        web3,
        pool_address="0x794a61358D6845594F94dc1DB02A252b5b4814aD",
        data_provider_address="0x69FA688f1Dc47d4B5d8029D5a35FB7a548310654",
        oracle_address="0xb023e699F5a33916Ea823A16485e259257cA8Bd1",
    )


@pytest.fixture
def one_delta_deployment(web3, aave_v3_deployment) -> OneDeltaDeployment:
    return fetch_1delta_deployment(
        web3,
        aave_v3_deployment,
        # flash_aggregator_address="0x168B4C2Cc2df4635D521Aa1F8961DD7218f0f427",
        flash_aggregator_address="0x74E95F3Ec71372756a01eB9317864e3fdde1AC53",
        broker_proxy_address="0x74E95F3Ec71372756a01eB9317864e3fdde1AC53",
    )
Returns

Data class representing 1delta deployment

Parameters
Return type

eth_defi.one_delta.deployment.OneDeltaDeployment