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:
type Uint128 = string
interface Coin {
amount: Uint128
denom: string
[k: string]: unknown
}
Queries
config
Returns the Contracts configuration.
{
config: {}
}
{
data: {
router: string
factory: string
oracle: string"
}
}
estimate_exact_in_swap
{
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
}
}
{
data: {
router: string
factory: string
oracle: string"
}
}
owner
{
owner: {}
}
{
data: {
router: string
factory: string
oracle: string"
}
}
route
{
route: {
denom_in: string
denom_out: string
}
}
{
data: {
router: string
factory: string
oracle: string"
}
}
routes
{
routes: {
limit?: number | null
start_after?: [string, string] | null
}
}
{
data: {
router: string
factory: string
oracle: string"
}
}
Methods
swap_exact_in
{
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