Swapper

The Swapper Contract wraps the underlying decentralized exchange (DEX) to work with the Credit Manager. It checks the minimum received amounts and reverts swaps with too much slippage.

Deployments

Neutron: neutron1udr9fc3kd743dezrj38v2ac74pxxr6qsx4xt4nfpcfczgw52rvyqyjp5au

Osmosis: osmo1wee0z8c7tcawyl647eapqs4a88q8jpa7ddy6nn2nrs7t47p2zhxswetwla


Types

The types of the Rewards Collector Contract can be found here.

For reference on the Queries and Methods:

Base Types
type Uint128 = string
Coin Types
interface Coin {
  amount: Uint128
  denom: string
  [k: string]: unknown
}

Queries

config

Returns the Contracts configuration.

Query message
{
    config: {}    
}
Return output
{
    data: {
        router: string
        factory: string
        oracle: string"
    }
}

estimate_exact_in_swap

Query message
{
    estimate_exact_in_swap: {
        coin_in: Coin
        denom_out: string
        route?: {
            astro: {
                swaps: [
                    {
                        from: string
                        to: string
                    },
                    ...
                ]
        } | {
            osmo: {
                swaps: [
                    {
                        pool_id: number
                        to: string
                    },
                    ...
                ]
        } | null
    } 
}
Return output
{
    data: {
        router: string
        factory: string
        oracle: string"
    }
}

owner

Query message
{
    owner: {}  
}
Return output
{
    data: {
        router: string
        factory: string
        oracle: string"
    }
}

route

Query message
{
    route: {
        denom_in: string
        denom_out: string
    }
}
Return output
{
    data: {
        router: string
        factory: string
        oracle: string"
    }
}

routes

Query message
{
    routes: {
        limit?: number | null
        start_after?: [string, string] | null
    }
}
Return output
{
    data: {
        router: string
        factory: string
        oracle: string"
    }
}

Methods

swap_exact_in

Execution message
{
    swap_exact_in: {
        coin_in: Coin
        denom_out: string
        min_receive: Uint128
        route?: {
            astro: {
                swaps: [
                    {
                        from: string
                        to: string
                    },
                    ...
                ]
        } | {
            osmo: {
                swaps: [
                    {
                        pool_id: number
                        to: string
                    },
                    ...
                ]
        } | null
    }
}

Last updated